Microsoft Azure Kubernetes Service への Red Hat Developer Hub のインストール


Red Hat Developer Hub 1.2

Red Hat Customer Content Services

概要

Red Hat Developer Hub は、開発者ポータルを構築するためのエンタープライズグレードのプラットフォームです。管理ユーザーは、ロール、権限、その他の設定を設定することで、Operator または Helm チャートを使用して Microsoft Azure Kubernetes Service (AKS) に Developer Hub のインスタンスをデプロイすることを、他のユーザーに許可できます。

第1章 Azure Kubernetes Service (AKS) への Red Hat Developer Hub のインストール

次のいずれかの方法を使用して、Microsoft Azure Kubernetes Service (AKS) に Red Hat Developer Hub をインストールできます。

  • Red Hat Developer Hub Operator
  • Red Hat Developer Hub Helm チャート

1.1. Operator を使用した AKS への Developer Hub のデプロイ

Red Hat Developer Hub Operator を使用して、AKS に Developer Hub をデプロイできます。

手順

  1. rhdh-operator-<VERSION>.yaml という名前の Red Hat Developer Hub Operator マニフェストファイルを取得し、次のフラグメントを追加して db-statefulset.yamldeployment.yaml のデフォルト設定を変更します。

    securityContext:
      fsGroup: 300
    Copy to Clipboard

    マニフェストで指定された場所は次のとおりです。

    db-statefulset.yaml: | spec.template.spec
    deployment.yaml: | spec.template.spec
    Copy to Clipboard
  2. 変更した Operator マニフェストを Kubernetes クラスターに適用します。

    kubectl apply -f rhdh-operator-<VERSION>.yaml
    Copy to Clipboard
    注記

    前のコマンドの実行はクラスター範囲であり、適切なクラスター権限が必要です。

  3. 次の例に示すように、Red Hat 認証情報を使用して rhdh-pull-secret という名前の ImagePull Secret を作成し、保護された registry.redhat.io からイメージにアクセスします。

    kubectl -n <your_namespace> create secret docker-registry rhdh-pull-secret \
        --docker-server=registry.redhat.io \
        --docker-username=<redhat_user_name> \
        --docker-password=<redhat_password> \
        --docker-email=<email>
    Copy to Clipboard
  4. rhdh-ingress.yaml という名前の Ingress マニフェストファイルを作成し、次のように Developer Hub サービス名を指定します。

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: rhdh-ingress
      namespace: <your_namespace>
    spec:
      ingressClassName: webapprouting.kubernetes.azure.com
      rules:
        - http:
            paths:
              - path: /
                pathType: Prefix
                backend:
                  service:
                    name: backstage-<your-CR-name>
                    port:
                      name: http-backend
    Copy to Clipboard
  5. 作成した Ingress をデプロイするには、次のコマンドを実行します。

    kubectl -n <your_namespace> apply -f rhdh-ingress.yaml
    Copy to Clipboard
  6. 次の例を使用して、Developer Hub 設定を含む app-config-rhdh という名前の ConfigMap を作成します。

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: app-config-rhdh
    data:
      "app-config-rhdh.yaml": |
        app:
          title: Red Hat Developer Hub
          baseUrl: https://<app_address>
        backend:
          auth:
            keys:
              - secret: "${BACKEND_SECRET}"
          baseUrl: https://<app_address>
          cors:
            origin: https://<app_address>
    Copy to Clipboard
  7. secrets-rhdh という名前のシークレットを作成し、次の例に示すように、Base64-encoded 文字列値の BACKEND_SECRET という名前のキーを追加します。

    apiVersion: v1
    kind: Secret
    metadata:
      name: secrets-rhdh
    stringData:
      BACKEND_SECRET: "xxx"
    Copy to Clipboard
  8. rhdh.yaml という名前のカスタムリソース (CR) マニフェストファイルを作成し、次のように以前に作成した rhdh-pull-secret を追加します。

    apiVersion: rhdh.redhat.com/v1alpha1
    kind: Backstage
    metadata:
      name: <your-rhdh-cr>
    spec:
      application:
        imagePullSecrets:
          - rhdh-pull-secret
        appConfig:
          configMaps:
            - name: "app-config-rhdh"
        extraEnvs:
          secrets:
            - name: "secrets-rhdh"
    Copy to Clipboard
  9. CR マニフェストを namespace に適用します。

    kubectl -n <your_namespace> apply -f rhdh.yaml
    Copy to Clipboard
  10. URL: https://<app_address> を使用して、デプロイした Developer Hub にアクセスします。ここで、<app_address> は、前に取得した Ingress アドレス (たとえば、https://108.141.70.228) です。
  11. オプション: CR を削除するには、次のコマンドを実行します。

    kubectl -n <your_namespace> delete -f rhdh.yaml
    Copy to Clipboard

1.2. Helm チャートを使用した AKS への Developer Hub のデプロイ

Developer Hub アプリケーションを Azure Kubernetes Services (AKS) にデプロイすると、アプリケーションのビルド、テスト、デプロイのための包括的なソリューションにアクセスできます。

前提条件

  • アクティブなサブスクリプションを持つ Microsoft Azure アカウントがある。
  • Azure CLI がインストールされている。
  • kubectl CLI がインストールされている。
  • kubectl を使用してクラスターにログインしており、developer または admin 権限を持っている。
  • Helm 3 以降がインストールされている。

AKS の詳細と基本的な Developer Hub デプロイメントの比較

  • 権限の問題: Developer Hub コンテナーでは、特定の操作を試行したときに権限関連のエラー (Permission denied など) が発生する可能性があります。このエラーは、PodSpec.securityContextfsGroup を調整することで解決できます。
  • Ingress 設定: AKS では、インストールした Developer Hub インスタンスにアクセスするために、Ingress を設定することが不可欠です。Developer Hub インスタンスにアクセスするには、次のコマンドを使用して、NGINX ベースの Ingress コントローラーであるルーティングアドオンを有効にする必要があります。

    az aks approuting enable --resource-group <your_ResourceGroup> --name <your_ClusterName>
    Copy to Clipboard
    ヒント

    Azure CLI 拡張機能 aks-preview のインストールが必要な場合があります。拡張機能が自動的にインストールされない場合は、次のコマンドを使用して手動でインストールする必要があります。

    az extension add --upgrade -n aks-preview --allow-preview true
    Copy to Clipboard
    注記

    Ingress コントローラーをインストールすると、Ingress コントローラーを含む app-routing-system namespace がクラスターにデプロイされます。後で Developer Hub アプリケーションにアクセスできるように、インストールした Ingress コントローラーからの Developer Hub アプリケーションのアドレス (たとえば、108.141.70.228) をメモしておきます。これは、後で <app_address> として参照されます。

    kubectl get svc nginx --namespace app-routing-system -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
    Copy to Clipboard
  • namespace の管理: 次のコマンドを使用して、AKS で Developer Hub デプロイメントの専用 namespace を作成できます。

    kubectl create namespace <your_namespace>
    Copy to Clipboard

手順

  1. 次のコマンドを実行して AKS にログインします。

    az login [--tenant=<optional_directory_name>]
    Copy to Clipboard
  2. 次のコマンドを実行してリソースグループを作成します。

    az group create --name <resource_group_name> --location <location>
    Copy to Clipboard
    ヒント

    次のコマンドを実行すると、利用可能なリージョンをリスト表示できます。

    az account list-locations -o table
    Copy to Clipboard
  3. 次のコマンドを実行して AKS クラスターを作成します。

    az aks create \
    --resource-group <resource_group_name> \
    --name <cluster_name> \
    --enable-managed-identity \
    --generate-ssh-keys
    Copy to Clipboard

    追加オプションは --help を参照してください。

  4. 次のコマンドを実行してクラスターに接続します。

    az aks get-credentials --resource-group <resource_group_name> --name <cluster_name>
    Copy to Clipboard

    上記のコマンドは、Kubernetes クライアントを設定し、AKS クラスターを指すように kubeconfig の現在のコンテキストを設定します。

  5. ターミナルを開き、次のコマンドを実行して Helm チャートリポジトリーを追加します。

    helm repo add openshift-helm-charts https://charts.openshift.io/
    Copy to Clipboard
  6. <rhdh> namespace を作成してアクティブ化します。

    DEPLOYMENT_NAME=<redhat-developer-hub>
    NAMESPACE=<rhdh>
    kubectl create namespace ${NAMESPACE}
    kubectl config set-context --current --namespace=${NAMESPACE}
    Copy to Clipboard
  7. 次のコマンドを実行して、Red Hat Ecosystem から Developer Hub イメージをプルするために使用するプルシークレットを作成します。

    kubectl -n $NAMESPACE create secret docker-registry rhdh-pull-secret \
        --docker-server=registry.redhat.io \
        --docker-username=<redhat_user_name> \
        --docker-password=<redhat_password> \
        --docker-email=<email>
    Copy to Clipboard
  8. 次のテンプレートを使用して、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: true
    Copy to Clipboard
  9. 次のコマンドを実行して、Helm チャートを使用して Developer Hub をインストールします。

    helm -n $NAMESPACE install -f values.yaml $DEPLOYMENT_NAME openshift-helm-charts/redhat-developer-hub --version 1.2.6
    Copy to Clipboard
  10. デプロイメントのステータスを確認します。

    kubectl get deploy $DEPLOYMENT_NAME -n $NAMESPACE
    Copy to Clipboard
  11. クラスターの Developer Hub データベースパスワードとルーターベース URL の値を使用して、Developer Hub Helm チャートのインスタンスを設定します。

    PASSWORD=$(kubectl get secret redhat-developer-hub-postgresql -o jsonpath="{.data.password}" | base64 -d)
    CLUSTER_ROUTER_BASE=$(kubectl get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//')
    helm upgrade $DEPLOYMENT_NAME -i "https://github.com/openshift-helm-charts/charts/releases/download/redhat-redhat-developer-hub-1.2.6/redhat-developer-hub-1.2.6.tgz" \
        --set global.clusterRouterBase="$CLUSTER_ROUTER_BASE" \
        --set global.postgresql.auth.password="$PASSWORD"
    Copy to Clipboard
  12. 次のコマンドを実行して、実行中の Developer Hub インスタンスの URL を表示します。

    echo "https://$DEPLOYMENT_NAME-$NAMESPACE.$CLUSTER_ROUTER_BASE"
    Copy to Clipboard

検証

  • 実行中の Developer Hub インスタンスの URL をブラウザーで開き、Developer Hub を使用します。

アップグレード

  • デプロイメントをアップグレードするには、次のコマンドを実行します。

    helm upgrade $DEPLOYMENT_NAME -i https://github.com/openshift-helm-charts/charts/releases/download/redhat-redhat-developer-hub-1.2.6/redhat-developer-hub-1.2.6.tgz
    Copy to Clipboard

削除

  • デプロイメントを削除するには、次のコマンドを実行します。

    helm -n $NAMESPACE delete $DEPLOYMENT_NAME
    Copy to Clipboard

法律上の通知

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat