Mysql for K8S installation issue - failed to pull operator image due to secret namespace
search cancel

Mysql for K8S installation issue - failed to pull operator image due to secret namespace

book

Article ID: 297314

calendar_today

Updated On:

Products

VMware Tanzu MySQL

Issue/Introduction

Customer faced the issue while installing tanzu-mysql-for-kubernetes-1.5.0:
helm install --wait my-mysql-operator /tmp/tanzu-sql-with-mysql-operator/ --values=operator-values-overrides.yaml --namespace=mysql-for-kubernetes-system --create-namespace 
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config 
Error: timed out waiting for the condition
Checking the operator pod status and describe it to check the "Events" output:
  • kubectl get pods -n mysql-for-kubernetes-system -o wide // There should be a pod named my-mysql-operator-xxxxx
  • kubectl describe pod <my-mysql-operator-xxxx> -n mysql-for-kubernetes-system
Events:
 Type   Reason  Age            From   Message
 ----   ------  ----            ----   -------
 Normal  BackOff 8m16s (x16081 over 2d15h) kubelet Back-off pulling image "registry.tanzu.vmware.com/tanzu-mysql-for-kubernetes/tanzu-mysql-operator:1.5.0"

 Warning Failed  3m15s (x711 over 2d15h)  kubelet Failed to pull image "registry.tanzu.vmware.com/tanzu-mysql-for-kubernetes/tanzu-mysql-operator:1.5.0": rpc error: code = Unknown desc = failed to pull and unpack image "registry.tanzu.vmware.com/tanzu-mysql-for-kubernetes/tanzu-mysql-operator:1.5.0": failed to resolve reference "registry.tanzu.vmware.com/tanzu-mysql-for-kubernetes/tanzu-mysql-operator:1.5.0": pulling from host registry.tanzu.vmware.com failed with status code [manifests 1.5.0]: 401 Unauthorized
Here, we can identified issue was due to the "failed to pull image from host registry.tanzu.vmware.com failed with status code [manifests 1.5.0]: 401 Unauthorized".

Environment

Product Version: VMware SQL with MySQL for Kubernetes v1.5.x +

Resolution

For this issue, run below command to test if the username and password are correct to login and able to pull the images.

docker login registry.tanzu.vmware.com
docker pull registry.tanzu.vmware.com/tanzu-mysql-for-kubernetes/tanzu-mysql-operator:1.5.0

Once you confirm that the above command is valid, run the following command to check the namespace to see if there are two namespaces, "mysql-for-kubernetes-system" and "tanzu-mysql-for-kubernetes-system".

kubectl get ns

If yes, it may be that you are creating the secret and installing the operator under a different namespace, that's why the issue occurs. To resolve this issue, customer needs to delete the secret and recreate it using the same namespace as operator's. Then, delete the pod "my-mysql-operator-xxx" and it should work fine.