7.7.2. 外部 PostgreSQL と連携するように CodeReady Workspaces を設定する
前提条件
-
oc
ツールが利用できる。
手順
CodeReady Workspaces のプロジェクトを事前に作成します。
$ oc create namespace openshift-workspaces
CodeReady Workspaces サーバーデータベースの認証情報を保存するためにシークレットを作成します。
$ oc create secret generic <server-database-credentials> \ 1 --from-literal=user=<database-user> \ 2 --from-literal=password=<database-password> \ 3 -n openshift-workspaces
RH-SSO データベース認証情報を保存するためのシークレットを作成します。
$ oc create secret generic <identity-database-credentials> \ 1 --from-literal=password=<identity-database-password> \ 2 -n openshift-workspaces
パッチを適用して
crwctl
コマンドを実行し、Red Hat CodeReady Workspaces をデプロイします。以下は例になります。$ crwctl server:deploy --che-operator-cr-patch-yaml=patch.yaml ...
patch.yaml には、Operator がデータベースのデプロイを省略し、既存のデータベースの接続詳細を CodeReady Workspaces サーバーに渡すことができるようにするために以下が含まれる必要があります。
spec: database: externalDb: true chePostgresHostName: <hostname> 1 chePostgresPort: <port> 2 chePostgresSecret: <server-database-credentials> 3 chePostgresDb: <database> 4 spec: auth: identityProviderPostgresSecret: <identity-database-credentials> 5
関連情報