4.2. Helm チャートを使用して、部分的な非接続環境でサポートされている Kubernetes プラットフォームに Red Hat Developer Hub をインストールする
部分的な非接続環境では、クラスターは registry.redhat.io などの外部レジストリーにアクセスできませんが、内部ミラーレジストリーにはアクセスできます。この方法では、クラスターから内部ミラーレジストリーに直接アクセスする必要があります。
前提条件
ワークステーションを設定している。
- Skopeo 1.17 以降がインストールされている。
- Yq 4.4 以降がインストールされている。
- Helm 3.13 以降がインストールされている。
- registry.redhat.io に対してアクティブな Skopeo セッションがある。
-
ターゲットミラーレジストリー (例:
registry.internal.example.com) に対して、アクティブな Skopeo セッションがある。 -
kubectlが設定された Kubernetes クラスターにアクセスできる。
手順
ターミナルで、次のコマンドを実行して Helm チャートをダウンロードして抽出します。
helm repo add _<helm_chart_repo_name>_ https://charts.openshift.io/ helm repo update helm pull _<helm_chart_repo_name>_/redhat-developer-hub --version _<rhdh_version>_ helm show values _<helm_chart_repo_name>_/redhat-developer-hub --version _<rhdh_version>_ > values.default.yaml以下は、
- <helm_chart_repo_name>
-
Helm チャートリポジトリーの名前を指定します (例:
openshift- helm -charts)。 - <rhdh_version>
-
使用する Red Hat Developer Hub のバージョンを指定します (例:
1.6.3)。
次のコマンドを実行し、
yqを使用してイメージダイジェストを抽出します。RHDH_IMAGE=$(yq '.upstream.backstage.image | .registry + "/" + .repository' values.default.yaml) RHDH_DIGEST=$(yq '.upstream.backstage.image.tag' values.default.yaml) PG_IMAGE=$(yq '.upstream.postgresql.image | .registry + "/" + .repository' values.default.yaml) PG_DIGEST=$(yq '.upstream.postgresql.image.tag' values.default.yaml)次のコマンドを入力して、イメージを内部ミラーレジストリーにミラーリングします。
skopeo login registry.redhat.io skopeo login _<mirror_registry_name>_ skopeo copy --remove-signatures \ docker://${PG_IMAGE}@${PG_DIGEST} \ docker://_<mirror_registry_name>_/_<postgresql_repo_name>_:${PG_DIGEST} skopeo copy --remove-signatures \ docker://${RHDH_IMAGE}@${RHDH_DIGEST} \ docker://_<mirror_registry_name>_/_<rhdh_repo_name>_${RHDH_DIGEST}以下は、
- <mirror_registry_name>
-
内部ミラーレジストリーの名前を指定します (例:
registry.internal.example.com)。 - <postgresql_repo_name>
-
PostgreSQL リポジトリーの名前を指定します (例:
rhdh/postgresql-15)。 - <rhdh_repo_name>
-
Red Hat Developer Hub リポジトリーの名前を指定します (例:
rhdh/rhdh-hub-rhel9)。
使用する Kubernetes プラットフォームの
values.yamlファイルを作成し、ローカル使用を反映するために次のイメージ参照をファイルに追加します。upstream: backstage: image: registry: "_<mirror_registry_name>_" repository: _<rhdh_repo_name>_ tag: "${RHDH_DIGEST}" postgresql: image: registry: "_<mirror_registry_name>_" repository: _<postgresql_repo_name>_ tag: "${PG_DIGEST}"AKS の場合は、次の
values.yamlファイルテンプレートを使用します。global: host: <app_address> route: enabled: false upstream: ingress: enabled: true className: webapprouting.kubernetes.azure.com host: backstage: image: pullSecrets: - rhdh-pull-secret podSecurityContext: fsGroup: 3000 postgresql: image: pullSecrets: - rhdh-pull-secret primary: podSecurityContext: enabled: true fsGroup: 3000 volumePermissions: enabled: trueEKS の場合は、次の
values.yamlファイルテンプレートを使用します。global: # TODO: Set your application domain name. host: <your Developer Hub domain name> route: enabled: false upstream: service: # NodePort is required for the ALB to route to the Service type: NodePort ingress: enabled: true annotations: kubernetes.io/ingress.class: alb alb.ingress.kubernetes.io/scheme: internet-facing # TODO: Using an ALB HTTPS Listener requires a certificate for your own domain. Fill in the ARN of your certificate, e.g.: alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:xxx:xxxx:certificate/xxxxxx alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' alb.ingress.kubernetes.io/ssl-redirect: '443' # TODO: Set your application domain name. external-dns.alpha.kubernetes.io/hostname: <your rhdh domain name> backstage: image: pullSecrets: - rhdh-pull-secret podSecurityContext: # you can assign any random value as fsGroup fsGroup: 2000 postgresql: image: pullSecrets: - rhdh-pull-secret primary: podSecurityContext: enabled: true # you can assign any random value as fsGroup fsGroup: 3000 volumePermissions: enabled: trueGKE の場合は、次の
values.yamlファイルテンプレートを使用します。global: host: <rhdh_domain_name> route: enabled: false upstream: service: type: NodePort ingress: enabled: true annotations: kubernetes.io/ingress.class: gce kubernetes.io/ingress.global-static-ip-name: <ADDRESS_NAME> networking.gke.io/managed-certificates: <rhdh_certificate_name> networking.gke.io/v1beta1.FrontendConfig: <ingress_security_config> className: gce backstage: image: pullSecrets: - rhdh-pull-secret podSecurityContext: fsGroup: 2000 postgresql: image: pullSecrets: - rhdh-pull-secret primary: podSecurityContext: enabled: true fsGroup: 3000 volumePermissions: enabled: true
次のコマンドを実行して、現在の namespace に Helm チャートをインストールします。
helm install rhdh ./_<helm_chart_archive_file_name>_ -f values.yaml以下は、
- <helm_chart_archive_file_name>
-
Helm チャートアーカイブファイルの名前を指定します (例:
redhat-developer-hub-1.6.3.tgz)。