MySQL Operator for Kubernetes Manual  /  Private Registries  /  Install MySQL Operator for Kubernetes from Private Registry using Helm

6.1 Install MySQL Operator for Kubernetes from Private Registry using Helm

If the private registry is not authenticated, and after pushing the MySQL Operator for Kubernetes image to your private registry, execute the following on the host where helm is installed; and adjust the variable values as needed:

export REGISTRY="..."   # like 192.168.20.199:5000
export REPOSITORY="..." # like "mysql"
export NAMESPACE="mysql-operator"
helm install mysql-operator helm/mysql-operator \
    --namespace $NAMESPACE \
    --create-namespace \
    --set image.registry=$REGISTRY \
    --set image.repository=$REPOSITORY \
    --set envs.imagesDefaultRegistry="$REGISTRY" \
    --set envs.imagesDefaultRepository="$REPOSITORY"

Authenticated private registries need to create a namespace for MySQL Operator for Kubernetes, and also add a Kubernetes docker-registry secret in the namespace; then execute helm install with arguments that look similar to:

export REGISTRY="..."   # like 192.168.20.199:5000
export REPOSITORY="..." # like "mysql"
export NAMESPACE="mysql-operator"
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 mysql-operator helm/mysql-operator \
        --namespace $NAMESPACE \
        --set image.registry=$REGISTRY \
        --set image.repository=$REPOSITORY \
        --set image.pullSecrets.enabled=true \
        --set image.pullSecrets.secretName=$DOCKER_SECRET_NAME \
        --set envs.imagesPullPolicy='IfNotPresent' \
        --set envs.imagesDefaultRegistry="$REGISTRY" \
        --set envs.imagesDefaultRepository="$REPOSITORY"

To confirm the installation, check the status with commands such as helm list -n $NAMESPACE and kubectl -n $NAMESPACE get pods.