非接続OpenShift環境でミラーリングすべきOperatorカタログの見つけ方 （oc-mirrorプラグイン使用）

非接続OpenShift環境で新たなOperatorをインストールしたい時、イメージセットをミラーレジストリーにミラーリングする必要がありますが、ミラーリングすべき `Operatorカタログ` がわからないことがあります。そのような場合の見つけ方のヒントです。

＊ 当記事では、[oc-mirror プラグインを使用した非接続インストールのイメージのミラーリング](https://docs.redhat.com/ja/documentation/openshift_container_platform/4.12/html/installing/installing-mirroring-disconnected#oc-mirror-creating-image-set-config_installing-mirroring-disconnected) を行うことを想定しています。


まず、当該バージョン(この例では `v4.12`)で利用可能な `Operatorカタログ` をリストします。
以下の例では、4種類のOperatorカタログが存在することがわかります。ここにリストされた `Operatorカタログ` のいずれかに含まれているはずです。

```
# oc-mirror list operators --catalogs --version=4.12
Available OpenShift OperatorHub catalogs:
OpenShift 4.12:
registry.redhat.io/redhat/redhat-operator-index:v4.12
registry.redhat.io/redhat/certified-operator-index:v4.12
registry.redhat.io/redhat/community-operator-index:v4.12
registry.redhat.io/redhat/redhat-marketplace-index:v4.12
```


次に、各カタログに含まれる `Operator` をリストして、目当てのOperatorがあるかどうかを確認します。各 `Operatorカタログ` に含まれる `Operator` をリストします。
以下は、3番目にリストされた `community-operator` カタログに含まれる `Operator` の一覧をリストした例です。

```
# oc-mirror list operators --catalog=registry.redhat.io/redhat/community-operator-index:v4.12 --version=4.12
NAME                                       DISPLAY NAME                                                              DEFAULT CHANNEL
3scale-community-operator                  3scale API Management                                                     threescale-2.14
ack-acm-controller                         AWS Controllers for Kubernetes - Amazon ACM                               alpha
ack-acmpca-controller                      AWS Controllers for Kubernetes - Amazon ACM PCA                           alpha
ack-apigatewayv2-controller                AWS Controllers for Kubernetes - Amazon API Gateway v2                    alpha
ack-applicationautoscaling-controller      AWS Controllers for Kubernetes - Amazon Application Auto Scaling          alpha
ack-cloudfront-controller                  AWS Controllers for Kubernetes - Amazon CloudFront                        alpha
ack-cloudtrail-controller                  AWS Controllers for Kubernetes - Amazon CloudTrail                        alpha
ack-cloudwatch-controller                  AWS Controllers for Kubernetes - Amazon CloudWatch                        alpha
ack-cloudwatchlogs-controller              AWS Controllers for Kubernetes - Amazon CloudWatch Logs                   alpha
ack-documentdb-controller                  AWS Controllers for Kubernetes - Amazon DocumentDB                        alpha
ack-dynamodb-controller                    AWS Controllers for Kubernetes - Amazon DynamoDB                          alpha
ack-ec2-controller                         AWS Controllers for Kubernetes - Amazon EC2                               alpha
ack-ecr-controller                         AWS Controllers for Kubernetes - Amazon ECR                               alpha
ack-ecs-controller                         AWS Controllers for Kubernetes - Amazon ECS                               alpha
ack-efs-controller                         AWS Controllers for Kubernetes - Amazon Elastic File System (Amazon EFS)  alpha
ack-eks-controller                         AWS Controllers for Kubernetes - Amazon EKS                               alpha
ack-elasticache-controller                 AWS Controllers for Kubernetes - Amazon ElastiCache                       alpha
ack-elbv2-controller                       AWS Controllers for Kubernetes - Amazon ELB                               alpha
ack-emrcontainers-controller               AWS Controllers for Kubernetes - Amazon EMR on EKS                        alpha
ack-eventbridge-controller                 AWS Controllers for Kubernetes - Amazon EventBridge                       alpha
ack-iam-controller                         AWS Controllers for Kubernetes - Amazon IAM                               alpha
ack-kafka-controller                       AWS Controllers for Kubernetes - Amazon Kafka                             alpha
ack-keyspaces-controller                   AWS Controllers for Kubernetes - Amazon Keyspaces                         alpha
ack-kinesis-controller                     AWS Controllers for Kubernetes - Amazon Kinesis                           alpha
ack-kms-controller                         AWS Controllers for Kubernetes - Amazon KMS                               alpha
ack-lambda-controller                      AWS Controllers for Kubernetes - Amazon Lambda                            alpha
ack-memorydb-controller                    AWS Controllers for Kubernetes - MemoryDB                                 alpha
ack-mq-controller                          AWS Controllers for Kubernetes - Amazon MQ                                alpha
ack-networkfirewall-controller             AWS Controllers for Kubernetes - Amazon Network Firewall                  alpha
ack-opensearchservice-controller           AWS Controllers for Kubernetes - Amazon OpenSearch Service                alpha
ack-organizations-controller               AWS Controllers for Kubernetes - Amazon Organizations                     alpha
ack-pipes-controller                       AWS Controllers for Kubernetes - Amazon EventBridge Pipes                 alpha
ack-prometheusservice-controller           AWS Controllers for Kubernetes - Amazon Prometheus                        alpha
ack-rds-controller                         AWS Controllers for Kubernetes - Amazon RDS                               alpha
ack-route53-controller                     AWS Controllers for Kubernetes - Amazon Route53                           alpha
ack-route53resolver-controller             AWS Controllers for Kubernetes - Amazon Route53Resolver                   alpha
ack-s3-controller                          AWS Controllers for Kubernetes - Amazon S3                                alpha
ack-sagemaker-controller                   AWS Controllers for Kubernetes - Amazon SageMaker                         alpha
ack-secretsmanager-controller              AWS Controllers for Kubernetes - Amazon Secrets Manager                   alpha
ack-sfn-controller                         AWS Controllers for Kubernetes - Amazon Step Functions                    alpha
ack-sns-controller                         AWS Controllers for Kubernetes - Amazon SNS                               alpha
ack-sqs-controller                         AWS Controllers for Kubernetes - Amazon SQS                               alpha
aerospike-kubernetes-operator              Aerospike Kubernetes Operator                                             stable
airflow-helm-operator                      Airflow Helm Operator                                                     alpha
alvearie-imaging-ingestion                 Alvearie Imaging Ingestion Operator                                       alpha
amd-gpu-operator                           amd-gpu-operator                                                          alpha
annotationlab                              NLPLab                                                                    alpha
apicast-community-operator                 APIcast                                                                   stable
apicurio-registry                          Apicurio Registry Operator                                                2.x
apicurito                                  API Designer                                                              latest
apimatic-kubernetes-operator               APIMatic Operator                                                         alpha
application-services-metering-operator     Application Services Metering Operator                                    alpha
aqua                                       Aqua Security Operator                                                    2022.4.0
argocd-operator                            Argo CD                                                                   alpha
assisted-service-operator                  Infrastructure Operator for Red Hat OpenShift                             alpha
authorino-operator                         Authorino Operator                                                        stable
aws-efs-operator                           AWS EFS Operator                                                          stable
awss3-operator-registry                    AWS S3 Operator                                                           alpha
awx-operator                               AWX                                                                       alpha
azure-service-operator                     Azure Service Operator                                                    stable
beegfs-csi-driver-operator                 BeeGFS CSI Driver                                                         stable
bookkeeper-operator                        BookKeeper Operator                                                       alpha
bpfman-operator                            Bpfman Operator                                                           alpha
camel-k                                    Camel K Operator                                                          stable-v2
camel-karavan-operator                     Camel Karavan Operator                                                    alpha
cass-operator-community                    DataStax Kubernetes Operator for Apache Cassandra                         stable
cert-manager                               cert-manager                                                              stable
cert-utils-operator                        Cert Utils Operator                                                       alpha
cluster-aas-operator                       Cluster as a service operator                                             alpha
cluster-impairment-operator                cluster-impairment-operator                                               beta
cluster-manager                            Cluster Manager                                                           stable
cluster-relocation-operator                Cluster Relocation Operator                                               stable
cockroachdb                                CockroachDB Helm Operator                                                 stable-v6.x
codeflare-operator                         CodeFlare Operator                                                        alpha
community-kubevirt-hyperconverged          KubeVirt HyperConverged Cluster Operator                                  stable
community-trivy-operator                   Community Trivy Operator                                                  stable
community-windows-machine-config-operator  Community Windows Machine Config Operator                                 preview
customized-user-remediation                Customized User Remediation Operator - Community Edition                  alpha
cxl-operator                               extend-community-operator                                                 alpha
dapr-kubernetes-operator                   Dapr Control Plane Operator                                               alpha
datadog-operator                           Datadog Operator                                                          stable
datatrucker-operator                       DataTrucker.IO                                                            alpha
dbaas-operator                             OpenShift Database Access Operator                                        stable
debezium-operator                          Debezium Operator                                                         debezium-latest
dell-csi-operator                          Dell CSI Operator                                                         stable
dell-csm-operator                          Dell Container Storage Modules                                            stable
deployment-validation-operator             Deployment Validation Operator                                            alpha
devopsinabox                               Devops-in-a-box                                                           alpha
dns-operator                               DNS Operator                                                              stable
dynatrace-operator                         Dynatrace Operator                                                        alpha
eclipse-amlen-operator                     eclipse-amlen-operator                                                    alpha
eclipse-che                                Eclipse Che                                                               stable
ecr-secret-operator                        ECR Secret Operator                                                       v0.4
edp-keycloak-operator                      EDP Keycloak Operator                                                     stable
eginnovations-operator                     eG Innovations Universal Agent Operator                                   beta
egressip-ipam-operator                     Egressip Ipam Operator                                                    alpha
ember-csi-community-operator               Ember CSI Operator                                                        beta
etcd                                       etcd                                                                      singlenamespace-alpha
eventing-kogito                            Kogito Knative Eventing Source                                            alpha
external-secrets-operator                  External Secrets Operator                                                 alpha
falcon-operator                            [DEPRECATED] CrowdStrike Operator                                         alpha
fence-agents-remediation                   Fence Agents Remediation Operator - Community Edition                     stable
flink-kubernetes-operator                  Flink Kubernetes Operator                                                 alpha
flux                                       Flux                                                                      stable
forklift-operator                          Forklift Operator                                                         stable-v2.5
fossul-operator                            Fossul Operator                                                           alpha
gingersnap                                 gingersnap Operator                                                       alpha
github-arc-operator                        github-arc-operator                                                       alpha
gitlab-operator-kubernetes                 GitLab                                                                    stable
gitlab-runner-operator                     GitLab Runner                                                             stable
gitops-primer                              gitops-primer                                                             alpha
gitwebhook-operator                        GitWebhook operator                                                       alpha
global-load-balancer-operator              Global Load Balancer Operator                                             alpha
grafana-operator                           Grafana Operator                                                          v5
group-sync-operator                        Group Sync Operator                                                       alpha
hawtio-operator                            Hawtio Operator                                                           stable-v1
hazelcast-platform-operator                Hazelcast Platform Operator                                               alpha
hedvig-operator                            Hedvig Operator                                                           stable
hive-operator                              Hive for Red Hat OpenShift                                                alpha
horreum-operator                           Horreum                                                                   alpha
hyperfoil-bundle                           Hyperfoil                                                                 alpha
ibm-block-csi-operator-community           IBM block storage CSI driver operator                                     stable
ibm-security-verify-access-operator        IBM Security Verify Access Operator                                       stable
ibm-spectrum-scale-csi-operator            IBM Spectrum Scale CSI Plugin Operator                                    stable
ibmcloud-operator                          IBM Cloud Operator                                                        stable
infinispan                                 Infinispan Operator                                                       stable
integrity-shield-operator                  K8s Integrity Shield                                                      alpha-0.3.3
ipfs-operator                              IPFS Operator                                                             alpha
istio-workspace-operator                   Istio Workspace                                                           alpha
jaeger                                     Community Jaeger Operator                                                 stable
k8gb                                       k8gb                                                                      alpha
kaoto-operator                             Kaoto Operator                                                            alpha
keda                                       [DEPRECATED] KEDA                                                         alpha
keepalived-operator                        Keepalived Operator                                                       alpha
kepler-operator                            Kepler                                                                    alpha
keycloak-operator                          Keycloak Operator                                                         fast
keycloak-permissions-operator              Keycloak Permissions Operator                                             alpha
kiali                                      Kiali Community Operator                                                  stable
klusterlet                                 Klusterlet                                                                stable
kogito-operator                            Kogito                                                                    1.x
koku-metrics-operator                      Koku Metrics Operator                                                     beta
konveyor-operator                          Konveyor Operator                                                         alpha
korrel8r                                   Korrel8r                                                                  stable
kuadrant-operator                          Kuadrant Operator                                                         stable
kube-green                                 kube-green                                                                alpha
kubecost                                   Kubecost                                                                  alpha
kubernetes-imagepuller-operator            Kubernetes Image Puller Operator                                          stable
kubeturbo                                  Kubeturbo Operator                                                        stable
l5-operator                                L5 Operator                                                               alpha
layer7-operator                            Layer7 Operator                                                           preview
lbconfig-operator                          External Load-Balancer Configuration Operator                             beta
lib-bucket-provisioner                     lib-bucket-provisioner                                                    alpha
limitador-operator                         Limitador                                                                 stable
logging-operator                           Logging Operator                                                          beta
loki-helm-operator                         Loki Helm Operator                                                        alpha
loki-operator                              Community Loki Operator                                                   alpha
machine-deletion-remediation               Machine Deletion Remediation Operator - Community Edition                 stable
mariadb-operator                           MariaDB Operator                                                          alpha
marin3r                                    MARIN3R                                                                   stable
mercury-operator                           Mercury Operator                                                          1.0.x
microcks                                   Microcks Operator                                                         stable
mongodb-atlas-kubernetes                   MongoDB Atlas Operator                                                    stable
mongodb-operator                           MongoDB Operator                                                          alpha
move2kube-operator                         Konveyor Move2Kube                                                        stable
multi-nic-cni-operator                     multi-nic-cni-operator                                                    stable
multicluster-global-hub-operator           Multicluster Global Hub Operator                                          alpha
multicluster-operators-subscription        Multicluster Subscription Operator                                        release-2.5
must-gather-operator                       Must Gather Operator                                                      alpha
namespace-configuration-operator           Namespace Configuration Operator                                          alpha
ncn-operator                               ncn-operator                                                              alpha
ndmspc-operator                            NdmSpc operator                                                           alpha
netobserv-operator                         NetObserv Operator                                                        community
neuvector-community-operator               NeuVector Operator                                                        beta
nexus-operator                             EDP Nexus Operator                                                        stable
nexus-operator-m88i                        Nexus Operator                                                            alpha
nfs-provisioner-operator                   NFS Provisioner Operator                                                  alpha
nlp-server                                 nlp-server                                                                alpha
node-discovery-operator                    node-discovery-operator                                                   alpha
node-healthcheck-operator                  Node Health Check Operator                                                stable
node-maintenance-operator                  Node Maintenance Operator - Community Edition                             stable
nsm-operator                               nsm-operator                                                              alpha
oadp-operator                              OADP Operator                                                             stable
observability-operator                     Observability Operator                                                    development
oci-ccm-operator                           oci-ccm-operator                                                          alpha
ocm-operator                               OpenShift Cluster Manager Operator                                        alpha
odoo-operator                              Odoo Operator                                                             alpha
opendatahub-operator                       Open Data Hub Operator                                                    fast
openebs                                    OpenEBS                                                                   alpha
openshift-nfd-operator                     Node Feature Discovery Operator                                           stable
openshift-qiskit-operator                  QiskitPlayground                                                          alpha
opentelemetry-operator                     Community OpenTelemetry Operator                                          alpha
patch-operator                             Patch Operator                                                            alpha
patterns-operator                          Validated Patterns Operator                                               fast
pcc-operator                               Prisma Cloud Compute Operator                                             stable
pelorus-operator                           Pelorus Operator                                                          alpha
percona-postgresql-operator                Percona Operator for PostgreSQL                                           stable
percona-server-mongodb-operator            Percona Distribution for MongoDB Operator                                 stable
percona-xtradb-cluster-operator            Percona Operator for MySQL based on Percona XtraDB Cluster                stable
portworx-essentials                        Portworx Essentials                                                       stable
postgresql                                 Crunchy Postgres for Kubernetes                                           v5
proactive-node-scaling-operator            Proactive Node Scaling Operator                                           alpha
project-quay                               Quay                                                                      stable-3.11
prometheus                                 Prometheus Operator                                                       beta
prometheus-exporter-operator               Prometheus Exporter Operator                                              alpha
prometurbo                                 Prometurbo Operator                                                       stable
pubsubplus-eventbroker-operator            Solace PubSub+ Event Broker Operator                                      stable
pulp-operator                              Pulp Project                                                              beta
pulsar-operator                            Pulsar Operator                                                           alpha
pulsar-resources-operator                  Pulsar Resources Operator                                                 alpha
rabbitmq-cluster-operator                  RabbitMQ-cluster-operator                                                 stable
rabbitmq-messaging-topology-operator       rabbitmq-messaging-topology-operator                                      stable
rabbitmq-single-active-consumer-operator   rabbitmq-single-active-consumer-operator                                  stable
redis-operator                             Redis Operator                                                            stable
registry-operator                          Devfile Registry Operator                                                 beta
reportportal-operator                      reportportal-operator                                                     alpha
resource-locker-operator                   Resource Locker Operator                                                  alpha
rhoas-operator                             OpenShift Application Services (RHOAS)                                    beta
ripsaw                                     benchmark-operator                                                        alpha
sailoperator                               Sail Operator                                                             3.0-nightly
sap-commerce-operator                      SAP Commerce Operator                                                     alpha
sap-data-intelligence-observer-operator    SAP Data Intelligence 3 - Observer Operator                               stable
sap-hana-express-operator                  SAP Hana Express Operator                                                 stable
seldon-operator                            Seldon Operator                                                           stable
self-node-remediation                      Self Node Remediation Operator - Community Edition                        stable
service-binding-operator                   Service Binding Operator                                                  stable
shipwright-operator                        Shipwright Operator                                                       alpha
sigstore-helm-operator                     sigstore                                                                  alpha
silicom-sts-operator                       Silicom STS Operator                                                      alpha
skupper-operator                           Skupper                                                                   stable
sn-operator                                StreamNative Operator                                                     alpha
snapscheduler                              SnapScheduler                                                             stable
snyk-operator                              Snyk Operator                                                             stable
sonar-operator                             EDP Sonar Operator                                                        alpha
sonataflow-operator                        SonataFlow Operator                                                       alpha
sosivio                                    Sosivio | Predictive Troubleshooting for Kubernetes                       stable
sosreport-operator                         sosreport-operator                                                        alpha
spark-helm-operator                        Spark Helm Operator                                                       alpha
special-resource-operator                  Special Resource Operator                                                 alpha
stackgres-community                        StackGres                                                                 stable
stolostron                                 Stolostron                                                                community-0.3
stolostron-engine                          Stolostron Engine                                                         community-0.3
strimzi-kafka-operator                     Strimzi                                                                   stable
syndesis                                   Syndesis Operator                                                         latest
t8c                                        Turbonomic Platform Operator                                              stable
tagger                                     Tagger                                                                    alpha
tempo-operator                             Community Tempo Operator                                                  alpha
tf-controller                              Weave GitOps Terraform Controller                                         stable
tidb-operator                              TiDB Operator                                                             stable
trident-operator                           Astra Trident                                                             stable
ucs-ci-solutions-operator                  UCS-CI-Solutions-Operator                                                 alpha
universal-crossplane                       Upbound Universal Crossplane (UXP)                                        stable
varnish-operator                           Varnish Operator                                                          alpha
vault-config-operator                      Vault Config Operator                                                     alpha
verticadb-operator                         VerticaDB Operator                                                        v2-stable
victoriametrics-operator                   VictoriaMetrics Operator                                                  beta
volume-expander-operator                   Volume Expander Operator                                                  alpha
windup-operator                            Windup Operator                                                           alpha
yaks                                       YAKS Operator                                                             alpha
zookeeper-operator                         ZooKeeper Operator                                                        alpha
```

一例として、この `community-operator` Operatorカタログに含まれているOperator `grafana-operator` をミラーリングしたい場合のイメージセット設定ファイルの内容例は次のようになります。
```
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  local:
    path: /repo/oc-mirror-grafana
mirror:
  platform:
    channels:
    - name: stable-4.12
      type: ocp
  operators:
  - catalog: registry.redhat.io/redhat/community-operator-index:v4.12
    packages:
    - name: grafana-operator
      channels:
      - name: v5
  additionalImages:
  - name: registry.redhat.io/ubi8/ubi:latest
  helm: {}
```

そして、ミラーリングを完了しカタログソースを追加すると、次のように OperatorHub に表示されるようになります。
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2164968/1cabe554-c40d-d1bb-80ed-65717953ed49.png)

### 参考
https://docs.redhat.com/ja/documentation/openshift_container_platform/4.12/html/operators/olm-rh-catalogs

https://docs.redhat.com/ja/documentation/openshift_container_platform/4.12/html/operators/olm-restricted-networks

https://docs.redhat.com/ja/documentation/openshift_container_platform/4.12/html/installing/installing-mirroring-disconnected#oc-mirror-mirror-to-disk_installing-mirroring-disconnected