Installing Hybrid Manager on AWS EKS using the Hybrid Manager Operator#
Hybrid Manager Operatorを使用して、 Amazon EKS にHybrid Managerをインストールできます。これは、EKSクラスターにHybrid Managerプラットフォームを展開するHelmチャートです。オペレーターは、プラットフォームのインストール、アップグレード、アンインストールを含む、Hybrid Managerプラットフォームのライフサイクルを管理する責任を負います。
重要
インストールプロセスのこの部分を開始する前に、 Prerequisites for AI Factory on Hybrid Manager を完了します。 EKSクラスターの作成、必要なコンポーネントのインストール、およびHybrid Manager Operatorの準備ができた環境の構成をステップ実行します。
インストールするバージョンを設定します#
EDB Hybrid Managerプラットフォームのバージョンは、環境変数EDB_PLATFORM_VERSIONによって設定されます。これは、インストールするプラットフォームのバージョンに設定する必要があります。たとえば、バージョンv1.2.0をインストールするには、次のように環境変数を設定します。
export EDB_PLATFORM_VERSION="v1.2.0"
トークンを設定します#
このインストールプロセスでは、EDBサブスクリプショントークンを環境変数として保存する必要があります。 EDB Account Profile に移動して、取得できます。プロンプトが表示されたら、ログインします。そこに、Repos 2.0トークンのエントリがあります。
Repo Token#
この値を取得して、環境変数として設定します。
export EDB_SUBSCRIPTION_TOKEN="your-token"
ブートストラップキットを入手する#
Hybrid Managerは、ブートストラップキットを使用してインストールされます。このキットは、EDB Hybrid Managerプラットフォームのインストールに使用されるスクリプトとチャートのコレクションです。
op-op-op-eks-install-operator.sh - このスクリプトは、EKSクラスターにHybrid Manager Operatorをインストールします。
op-eks-install-secrets.sh - このスクリプトは、インストールプロセスに必要なシークレットをインストールします。
op-prepare-op.sh - このスクリプトは、インストールプロセスの値ファイルを準備します。
op-default-env.sh - このファイルには、インストールプロセスのデフォルトの環境変数が含まれています。
op-hm-default.yaml - このファイルには、構成のデフォルト値が含まれています。
すべてのファイルをローカルマシンのディレクトリにコピーし、cd
をそのディレクトリにコピーします。
Hybrid Manager Operatorのインストール#
Hybrid Manager Operatorをインストールするには、
op-eks-install-operator.sh
スクリプトを実行します。すでにトークンを環境変数として設定しているため、スクリプトにパイプできます。また、環境変数OPERATOR_VERSION
をインストールするオペレーターのバージョン、たとえばv1.2.0
に設定する必要があります。これは通常、インストールするEDB Hybrid
Managerプラットフォームと同じバージョンであるため、次のように設定できます。
export OPERATOR_VERSION=$EDB_PLATFORM_VERSION
次に、スクリプトを実行してオペレーターをインストールできます。
echo $EDB_SUBSCRIPTION_TOKEN | $SHELL op-eks-install-operator.sh
シークレットのインストール#
インストールプロセスでは、多数のシークレットをKubernetesクラスターにインストールする必要があります。これらのシークレットは、EDBダウンロードリポジトリで認証し、EDBソフトウェア展開プラットフォームの資格情報を保存するために使用されます。
ブートストラッププロセスに必要なシークレットをインストールするには、
install-secrets.sh
スクリプトを実行します。トークンは環境変数として既に設定しているため、スクリプトにパイプできます。
echo $EDB_SUBSCRIPTION_TOKEN | $SHELL op-eks-install-secrets.sh
Enter the password for pgai-platform@docker.enterprisedb.com
namespace/edbpgai-bootstrap created
namespace/upm-replicator created
secret/edb-cred created
secret/edb-cred created
secret/edb-cred annotated
namespace/upm-griptape created
secret/fernet-secret created
namespace/upm-lakekeeper created
secret/pg-confounding-key created
PG_CONFOUNDING_KEY is 01234567890123456789ABCDEFG - store safely
このプロセスでは、ハイブリッドマネージャーを実行するために必要なシークレットを作成します。これらのシークレットの詳細については、次の場所で確認できます。
** A secret for Griptape and configures DeltaLake object storage GenAI Builderのオプショナル**
** A secret for Catalog カタログを使用する場合のオプショナル**
** custom secrets for Migration Portal 移行ポータルとの内部通信を保護するオプション** も参照してください。
値ファイルの準備#
ブートストラッププロセスでは、Helmチャートで多くの値を設定する必要があります。これらの値は、values.yaml
というファイルに保存されます。このファイルは、 op-default-env.sh
ファイルの変数を使用するprepare.sh
スクリプトを実行して作成できます。 op-default-env.sh
ファイルを編集して、必要な値を設定します。
これは、デフォルトのop-default-env.sh ファイルです。
# exports for EKS
export EDB_PLATFORM_VERSION="v1.2.0"
export CONTAINER_REGISTRY_URI="docker.enterprisedb.com/pgai-platform"
export IMAGESET_REGISTRY_URI=$CONTAINER_REGISTRY_URI
export IMAGESET_AUTHTYPE="token"
export PORTAL_DOMAIN_NAME="portal.foo.network"
export TRANSPORTER_RW_SERVICE_DOMAIN_NAME="transporter.foo.network"
export BEACON_SERVICE_DOMAIN_NAME="beacon.foo.network"
export AUTHENTICATION_EMAIL="owner@mycompany.com"
export AUTHENTICATION_USER="owner@mycompany.com"
export LOCATION_NAME="default-location"
export STORAGE_CLASS="gp2"
export TRANSPORTER_FIPS_ENABLED=false
# Set a password hash for the user or pass a password to have it hashed for you.
# If you pass a password, you will need to remove it from your history.
# You can hash a password using the following command:
# echo -n "password" | htpasswd -BinC 10 admin | cut -d: -f2
#
# export AUTHENTICATION_PASSWORD="password"
# If setting AUTHENTICATION_PASSWORD_HASH, ensure it is single quoted to prevent variable expansion (e.g. $2y$10$...).
export AUTHENTICATION_PASSWORD_HASH=$2y$10$vKOAXfLHbeV1OQxMpxlLdOIwnX.JAN.ZrD9ZU//ocrNQwhQIMtXhy
次に、 op-default-env.sh ファイルの変数の簡単なガイドを示します。
Variable |
Description |
|---|---|
CONTAINER_REGISTRY_URI |
使用するコンテナレジストリのURI。これはEDBダウンロードリポジトリに設定されます。 |
IMAGESET_REGISTRY_URI |
イメージセットレジストリのURI。これはEDBダウンロードリポジトリに設定されます。 |
IMAGESET_AUTHTYPE |
イメージセットレジストリの認証タイプ。 EDBダウンロードリポジトリでの認証にトークンを使用するため、トークンに設定します。 |
PORTAL_DOMAIN_NAME |
ドメインは、HMコンソールにアクセスするためのパブリックURLとして機能します。以下の推奨事項を参照してください。 |
TRANSPORTER_RW_SERVICE_DOMAIN_NAME |
Data Migration Service内部的に`transporter`のドメイン名。以下の推奨事項を参照してください。 |
BEACON_SERVICE_DOMAIN_NAME |
ビーコンサービスのドメイン名。 |
AUTHENTICATION_EMAIL |
作成するユーザーのメールアドレス。 |
AUTHENTICATION_USER |
作成するユーザーのユーザー名。 |
AUTHENTICATION_PASSWORD |
作成するユーザーのパスワード。これは、プレーンテキストとして、またはAUTHENTICATION_PASSWORD_HASHを使用したハッシュとして設定できます。 |
AUTHENTICATION_PASSWORD_HASH |
作成するパスワードのハッシュ。 |
LOCATION_NAME |
エージェントのロケーション名。以前はビーコンエージェントとして知られていました。 |
STORAGE_CLASS |
インストールに使用するストレージクラス。これは、AWSのEBSボリュームのgp2に設定されます。 |
TRANSPORTER_FIPS_ENABLED |
TransporterサービスのFIPSモードを有効にするかどうか。 |
!!!note PORTAL_DOMAIN_NAMEおよびTRANSPORTER_RW_SERVICE_DOMAIN_NAMEの推奨事項
一貫性と管理を容易にするために、
PORTAL_DOMAIN_NAMEからTRANSPORTER_RW_SERVICE_DOMAIN_NAMEを取得します。最も一般的なアプローチは、
portal サブドメインをdms に置き換えることです。
次の表は、トップレベルドメイン examplecompany.com
に基づいたさまざまな例を使用してこの関係を示しています。
PORTAL_DOMAIN_NAME |
TRANSPORTER_RW_SERVICE_DOMAIN_NAME |
|---|---|
portal.examplecompany.com |
dms.examplecompany.com |
portal-dev.examplecompany.com |
dms-dev.examplecompany.com |
portal.hm001.examplecompany.com |
dms.hm001.examplecompany.com |
portal-hm-us-east-001.examplecompany.com |
dms-hm-us-east-001.examplecompany.com |
op-prepare-op.sh スクリプトを実行して、 values.yaml
ファイルを作成します。
$SHELL op-prepare-op.sh
これにより、 op-default-env.sh
ファイルで設定された値を使用してvalues.yaml
ファイルが作成されます。
ブートストラッププロセス用に2つの値を作成する必要があります。これらはAES_256_KEYとAUTHENTICATION_PASSWORD_HASHです。次のコマンドを使用してこれらの値を作成できます。
export AES_256_KEY=$(openssl rand -base64 32)
ハッシュするパスワードがある場合は、次のコマンドで行うことができます。
export AUTHENTICATION_PASSWORD_HASH=$(echo -n $AUTHENTICATION_PASSWORD | htpasswd -BinC 10 admin | cut -d: -f2)
次に、 values.yaml
ファイルを編集し、インストールに必要な値を設定する必要があります。
values.yaml ファイルで適切なキーを見つけ、次のように値を設定します。
$<name> エントリを、同じ名前の環境変数を設定した値に置き換えます。
spec.componentsParameters.upm-istio-gateway.cookie_aeskeyを$AES_256_KEYに設定します。spec.imageRegistryを$CONTAINER_REGISTRY_URIに設定します。spec.globalParameters.portal_domain_nameを$PORTAL_DOMAIN_NAMEに設定します。spec.componentsParameters.transporter-rw-service.domain_nameを$TRANSPORTER_RW_SERVICE_DOMAIN_NAMEに設定します。parameters.transporter-dp-agent.rw_service_urlをhttps://、続いて$TRANSPORTER_RW_SERVICE_DOMAIN_NAME、/transporterに設定します。前に提供した例の最初の例に従って、これはhttps://dms.examplecompany.com/transporterになります。spec.componentsParameters.upm-beacon.server_hostを$BEACON_SERVICE_DOMAIN_NAMEに設定します。spec.pgai.portal.authentication.staticPasswords[0].emailを$AUTHENTICATION_EMAILに設定します。spec.pgai.portal.authentication.staticPasswords[0].hashを$AUTHENTICATION_PASSWORD_HASHに設定します。spec.pgai.portal.authentication.staticPasswords[0].usernameを$AUTHENTICATION_USERに設定します。spec.pgai.portal.authentication.staticPasswords[0].userID“c5998173-a605-449a-a9a5-4a9c33e26df”を設定します。spec.beaconAgent.locationを$LOCATION_NAMEに設定しますspec.globalParameters.storage_classを$STORAGE_CLASSに設定します。spec.componentsParameters.transporter-data-operator.fips_enabledを$TRANSPORTER_FIPS_ENABLEDに設定します。ブール値は文字列として処理されるため、引用符で囲まれていることを確認します。
hm-values.yaml
ファイルには、インストールプロセスに必要な値が含まれています。
Hybrid Managerプラットフォームのインストール#
次の手順は、前の手順で作成した値ファイルをハイブリッドマネージャーオペレーターに適用することです。これにより、EKSクラスターへのHybrid Managerプラットフォームのインストールがトリガーされます。
kubectl apply -f ./hm-values.yaml
次を実行して、インストールのステータスを確認できます。
kubectl get hybridcontrolplanes.edbpgai.edb.com
完了すると、出力はこれに似ているはずです。
NAME PHASE
edbpgai deployed
デプロイしない場合は、次を実行します。
kubectl get hybridcontrolplanes.edbpgai.edb.com -o yaml
インストールのステータスの詳細については、Hybrid Manager Operatorのログを確認できます。
ホスト名解決の構成#
イングレスゲートウェイのIPアドレスを取得します。実行します
kubectl -n istio-system get service istio-ingressgateway -o jsonpath={.status.loadBalancer.ingress[0].hostname} | strings | nslookup
このコマンドは、次のような出力を結果ます。
Server: 192.168.111.1
Address: 192.168.111.1#53
Non-authoritative answer:
Name: k8s-istiosys-istioing-b3dc9b4f3c-81dc5c45b1d5f6d2.elb.us-east-1.amazonaws.com
Address: 52.70.180.102
次に、 op-default-env.sh
で指定されたドメインが上記のコマンドから取得したIPアドレスを指すようにDNSサービスまたは/etc/hosts
ファイルを構成する必要があります。これらのドメインはPORTAL_DOMAIN_NAME
、TRANSPORTER_RW_SERVICE_DOMAIN_NAME
、およびBEACON_SERVICE_DOMAIN_NAME
にあります。上記の例では、それぞれportal.examplecompany.com
、dms.examplecompany.com 、およびbeacon.examplecompany.com
に設定されます。
DNSの構成#
DNS構成で、これらのドメインごとに、取得したIPアドレスをポイントするCNAMEレコードを作成します。したがって、この例では、
examplecompany.com のDNSゾーンファイルに次のレコードを作成します。
cluster IN A 52.70.180.102
portal IN CNAME cluster.examplecompany.com
transporter IN CNAME cluster.examplecompany.com
beacon IN CNAME cluster.examplecompany.com
これは単純化された例です。実際の構成は、DNSプロバイダーとDNSレコードの管理方法によって異なります。
/etc/hosts の構成DNSサービスがない場合#
DNSサービスを構成していない場合は、IPアドレスをローカルの/etc/hosts
ファイルに追加することを検討します。この追加により、op-default-env.sh
ファイルで設定したドメイン名を使用してハイブリッドマネージャーコンソールにアクセスできます。
次に、次のようにIPアドレスを/etc/hosts ファイルに追加できます。
echo "52.70.180.102 portal.examplecompany.com dms.examplecompany.com beacon.examplecompany.com" | sudo tee -a /etc/hosts
IPアドレスを、前に取得した値に置き換えます。これは一時的な解決策であり、運用環境では使用しないでください。運用展開には、適切なDNSサービスを使用することをお勧めします。
/etc/hosts ファイルの設定は、設定したマシンでのみ機能します。
次のステップ#
connecting to the HM Console によるインストールを検証できるようになりました。
op-default-env.sh#
# exports for EKS
export EDB_PLATFORM_VERSION="v1.2.0"
export CONTAINER_REGISTRY_URI="docker.enterprisedb.com/pgai-platform"
export IMAGESET_REGISTRY_URI=$CONTAINER_REGISTRY_URI
export IMAGESET_AUTHTYPE="token"
export PORTAL_DOMAIN_NAME="portal.foo.network"
export TRANSPORTER_RW_SERVICE_DOMAIN_NAME="transporter.foo.network"
export BEACON_SERVICE_DOMAIN_NAME="beacon.foo.network"
export AUTHENTICATION_EMAIL="owner@mycompany.com"
export AUTHENTICATION_USER="owner@mycompany.com"
export LOCATION_NAME="default-location"
export STORAGE_CLASS="gp2"
export TRANSPORTER_FIPS_ENABLED=false
# Set a password hash for the user or pass a password to have it hashed for you.
# If you pass a password, you will need to remove it from your history.
# You can hash a password using the following command:
# echo -n "password" | htpasswd -BinC 10 admin | cut -d: -f2
#
# export AUTHENTICATION_PASSWORD="password"
# If setting AUTHENTICATION_PASSWORD_HASH, ensure it is single quoted to prevent variable expansion (e.g. $2y$10$...).
export AUTHENTICATION_PASSWORD_HASH=$2y$10$vKOAXfLHbeV1OQxMpxlLdOIwnX.JAN.ZrD9ZU//ocrNQwhQIMtXhy
op-op-op-eks-install-operator.sh#
registry="docker.enterprisedb.com"
username="pgai-platform"
password=""
echo "Enter the password for ${username}@${registry}"
read -s password
if [ -z "$password" ]; then
echo 1>&2 "Error: password is required" >&2
echo 1>&2
usage
exit 1
fi
kubectl create namespace edb-hcp-operator-system
helm repo add enterprisedb-edbpgai "https://downloads.enterprisedb.com/${password}/${RELEASE}pgai-platform/helm/charts/"
helm repo update
kubectl create secret docker-registry edb-hcp-operator-pull-secret \
--docker-server="${registry}" \
--docker-username="${RELEASE}${username}" \
--docker-password="${password}" \
--namespace edb-hcp-operator-system
helm upgrade \
-n edb-hcp-operator-system \
--install \
--set "imagePullSecrets[0].name=edb-hcp-operator-pull-secret" \
--set controllerManager.manager.image.tag=$OPERATOR_VERSION \
--set controllerManager.manager.image.repository=docker.enterprisedb.com/${RELEASE}pgai-platform/edb-hcp-operator/manager \
--version $OPERATOR_VERSION \
edb-hcp-operator enterprisedb-edbpgai/edb-hcp-operator
op-eks-install-secrets.sh#
registry="docker.enterprisedb.com"
username="pgai-platform"
password=""
echo "Enter the password for ${username}@${registry}"
read -s password
if [ -z "$password" ]; then
echo 1>&2 "Error: password is required" >&2
echo 1>&2
usage
exit 1
fi
kubectl create ns edbpgai-bootstrap
kubectl create ns upm-replicator
kubectl create secret docker-registry edb-cred \
-n edbpgai-bootstrap \
--docker-server="${registry}" \
--docker-username="${username}" \
--docker-password="${password}"
kubectl create secret docker-registry edb-cred \
-n upm-replicator \
--docker-server="${registry}" \
--docker-username="${username}" \
--docker-password="${password}"
kubectl annotate secret -n upm-replicator edb-cred replicator.v1.mittwald.de/replicate-to="*" --overwrite
kubectl create namespace upm-griptape
FERNET_KEY=$(dd if=/dev/urandom bs=32 count=1 2>/dev/null | base64)
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: fernet-secret
namespace: upm-griptape
stringData:
FERNET_KEY: ${FERNET_KEY}
EOF
kubectl create namespace upm-lakekeeper
PG_CONFOUNDING_KEY=$(dd if=/dev/urandom bs=32 count=1 2>/dev/null | base64)
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: pg-confounding-key
namespace: upm-lakekeeper
stringData:
PG_CONFOUNDING_KEY: ${PG_CONFOUNDING_KEY}
EOF
echo "PG_CONFOUNDING_KEY is ${PG_CONFOUNDING_KEY} - store safely"
op-hm-default.yaml#
apiVersion: edbpgai.edb.com/v1alpha1
kind: HybridControlPlane
metadata:
name: edbpgai
spec:
source:
useLocalKustomizations: true
flavour: eks
version: v1.2.0+appl
imageRegistry: ${CONTAINER_REGISTRY_URI}
imagePullSecrets:
- name: edb-cred
namespace: edbpgai-bootstrap
globalParameters:
internal_backup_folder: 4befab698c8d
portal_domain_name: ${PORTAL_DOMAIN_NAME}
storage_class: ${STORAGE_CLASS}
componentsParameters:
edb-migration-portal:
enable_pdb: "false"
transporter-data-operator:
fips_enabled: "${TRANSPORTER_FIPS_ENABLED}"
transporter-dp-agent:
rw_service_url: https://${TRANSPORTER_RW_SERVICE_DOMAIN_NAME}/transporter
transporter-rw-service:
domain_name: ${TRANSPORTER_RW_SERVICE_DOMAIN_NAME}
upm-api-pnxt-metric:
log_level: info
tsdb_host: thanos-query.monitoring.svc.cluster.local
tsdb_port: "9090"
upm-api-pnxt-pd:
log_level: info
upm-beaco-ff-base:
usage_generator_interval: 24h
upm-beaco-usages:
usage_generator_interval: 24h
upm-beacon:
server_host: ${BEACON_SERVICE_DOMAIN_NAME}
beacon_server_replicas: "1"
external_metrics_replicas: "1"
beacon_db_hibernation: "\"off\""
upm-istio-gateway:
cookie_aeskey: ${AES_256_KEY}
upm-prometheus:
memory: 4Gi
pgai:
portal:
authentication:
idpConnectors: []
staticPasswords:
- email: ${AUTHENTICATION_EMAIL}
hash: ${AUTHENTICATION_HASH}
username: ${AUTHENTICATION_USERNAME}
userID: ${AUTHENTICATION_USER_ID}
beaconAgent:
applianceProviderEnabled: true
plaintext: true
beaconServerAddress: "upm-beacon-server-ingestion.upm-beacon.svc.cluster.local:8080"
tlsInsecure: false
location: "devspatcher"
logLevel: "debug"
beaconDBConnected: true
inCluster: true
provisioning:
loadBalancersEnabled: true
nodePortDomain: "nodeportdomain.com"
imageDiscovery: true
imagesetDiscoveryAuthenticationType: "eks_managed_identity"
imagesetDiscoveryContainerRegistryURL: 123456079902.dkr.ecr.us-east-1.amazonaws.com
providers:
- appliance
op-prepare-op.sh#
# !/bin/bash
echo "HM Operator values.yaml preparation\n"
# Import the eks-default-env file
source ./default-env.sh
# If EDB_PLATFORM_VERSION is not set, error and exit
if [ -z "$EDB_PLATFORM_VERSION" ]; then
echo "EDB_PLATFORM_VERSION is not set, please set it to the version of EDB Platform you are deploying"
exit
fi
# Test for the presence of yq
if ! command -v yq &> /dev/null
then
echo "yq could not be found, please install it"
exit
fi
cp hm-default.yaml hm-values.yaml
# Prepare values.yaml for EKS
export AES_256_KEY=$(openssl rand -base64 32)
# if AUTHENTICATION_PASSWORD_HASH is not set, generate it
if [ -z "$AUTHENTICATION_PASSWORD_HASH" ]; then
echo "Generating password hash - please ensure you remove the password from your history"
export AUTHENTICATION_PASSWORD_HASH=$(echo -n $AUTHENTICATION_PASSWORD | htpasswd -BinC 10 admin | cut -d: -f2)
else
echo "Using prehashed password"
fi
if [[ "$EDB_PLATFORM_VERSION" == v1.2.* ]]; then
echo "EDB Platform version is v1.2.*"
yq -i .spec.imageRegistry = env(CONTAINER_REGISTRY_URI) |
.spec.componentsParameters.upm-istio-gateway.cookie_aeskey = env(AES_256_KEY) |
.spec.globalParameters.portal_domain_name = env(PORTAL_DOMAIN_NAME) |
.spec.globalParameters.storage_class = env(STORAGE_CLASS) |
.spec.componentsParameters.transporter-data-operator.fips_enabled = (env(TRANSPORTER_FIPS_ENABLED)|tostring) |
.spec.componentsParameters.transporter-rw-service.domain_name = env(TRANSPORTER_RW_SERVICE_DOMAIN_NAME) |
.spec.componentsParameters.transporter-dp-agent.rw_service_url= "https://"+env(TRANSPORTER_RW_SERVICE_DOMAIN_NAME)+"/transporter" |
.spec.componentsParameters.upm-beacon.server_host= env(BEACON_SERVICE_DOMAIN_NAME) |
.spec.pgai.portal.authentication.staticPasswords[0].email=env(AUTHENTICATION_EMAIL) |
.spec.pgai.portal.authentication.staticPasswords[0].hash=env(AUTHENTICATION_PASSWORD_HASH) |
.spec.pgai.portal.authentication.staticPasswords[0].username=env(AUTHENTICATION_USER) |
.spec.pgai.portal.authentication.staticPasswords[0].userID="c5998173-a605-449a-a9a5-4a9c33e26df" |
.spec.beaconAgent.provisioning.imagesetDiscoveryContainerRegistryURL= env(IMAGESET_REGISTRY_URI) |
.spec.beaconAgent.provisioning.imagesetDiscoveryAuthenticationType= env(IMAGESET_AUTHTYPE) |
.spec.beaconAgent.location=env(LOCATION_NAME) hm-values.yaml
fi
echo "Your hm-values.yaml file is ready"