Kubernetes 用 MySQL Operator 手冊  /  私有 Registry  /  使用 Helm 從私有 Registry 安裝 InnoDB Cluster

6.2 使用 Helm 從私有 Registry 安裝 InnoDB Cluster

例如

export REGISTRY="..."   # like 192.168.20.199:5000
export REPOSITORY="..." # like "mysql"
export NAMESPACE="mynamespace"
export DOCKER_SECRET_NAME="priv-reg-secret"

$> kubectl create namespace $NAMESPACE

$> kubectl -n $NAMESPACE create secret docker-registry $DOCKER_SECRET_NAME \
           --docker-server="https://$REGISTRY/v2/" \
           --docker-username=user --docker-password=pass \
           --docker-email=user@example.com

$> helm install mycluster mysql-operator/mysql-innodbcluster \
           --namespace $NAMESPACE \
           --set credentials.root.user='root' \
           --set credentials.root.password='sakila' \
           --set credentials.root.host='%' \
           --set serverInstances=3 \
           --set routerInstances=1 \
           --set image.registry=$REGISTRY \
           --set image.repository=$REPOSITORY \
           --set image.pullSecrets.enabled=true \
           --set image.pullSecrets.secretName=$DOCKER_SECRET_NAME \