以下是一个指南,可以帮助您正确配置Argocd来访问GCR:
# Login and create a new `gcloud` context matching the cluster context
$ gcloud auth login
$ gcloud container clusters get-credentials CLUSTER_NAME
# Download service account key file and create Kubernetes secret for it.
$ gcloud iam service-accounts keys create gcr.json --iam-account=SERVICE_ACCOUNT_EMAIL
$ kubectl create secret generic regcred \
--from-file=gcr.json \
--namespace argocd
# Define custom volume to hold the image pull secret
$ kubectl patch deployment argocd-server \
-p '{"spec": {"template": {"spec": {"volumes": [{"name": "regcred", "secret": {"secretName": "regcred"}}]}}}}'
# Mount the volume to the desired path in the container and set the imagePullSecrets key to use the credentials.
$ kubectl patch deployment argocd-server \
-p '{"spec": {"template": {"spec": {"containers": [{"name": "argocd-server", "volumeMounts": [{"name": "regcred", "mountPath": "/home/argocd/.docker/config.json", "subPath": "config.json"}], "imagePullSecrets": [{"name": "regcred"}]}]}}}}'
以上是一个配置Argocd来