我目前正在尝试将 ArgoCD 添加到我的项目中,并且正在努力从我的 GitLab 容器注册表中提取镜像。
这是我的值(value)观 yaml:
# Default values for oc-backend.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: registry.gitlab.com/open-concepts/open-concepts-backend
tag: master
pullPolicy: Always
imagePullSecrets:
- name: registry-credentials
nameOverride: "oc-app"
fullnameOverride: "oc-backend-test"
serviceAccount:
# Specifies whether a service account should be created
create: true
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podSecurityContext:
{}
# fsGroup: 2000
securityContext:
{}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: NodePort
port: 80
ingress:
enabled: false
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}
还有 secret yaml:
apiVersion: v1
kind: Secret
metadata:
name: registry-credentials
namespace: argocd
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: xxxx
我知道 dockerconfigjson 可以工作,因为我事先测试过它。
➜ kubectl get secret registry-credentials --namespace=argocd
NAME TYPE DATA AGE
registry-credentials kubernetes.io/dockerconfigjson 1 56m
但是,我仍然通过 ArgoCD 收到拒绝错误。有人可以检查我的配置是否正确吗?
TIA
最佳答案
解决方案:我在编码之前删除了用户、密码和电子邮件。现在可以工作了!
关于kubernetes - 尽管提供了 dockerconfigjson,ArgoCD 仍无法提取图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74083363/