V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
scalaer
V2EX  ›  问与答

k8s 使用 helm 部署应用 imagePullSecrets 一直没有生效是啥原因?

  •  
  •   scalaer · 2019-09-12 15:10:14 +08:00 · 1756 次点击
    这是一个创建于 1713 天前的主题,其中的信息可能已经有所发展或是发生改变。

    templates/deployment.yaml 文件

    ...
        spec:
          serviceAccountName: {{ include "sparkoperator.serviceAccountName" . }}
          {{- if .Values.enableWebhook }}
          volumes:
            - name: webhook-certs
              secret:
                secretName: spark-webhook-certs
          {{- end }}
          containers:
          - name: sparkoperator
            image: {{ .Values.operatorImageName }}:{{ .Values.operatorVersion }}
            imagePullPolicy: {{ .Values.imagePullPolicy }}
            {{- if .Values.enableWebhook }}
            volumeMounts:
              - name: webhook-certs
                mountPath: /etc/webhook-certs
            {{- end }}
            {{- if .Values.enableMetrics }}
            ports:
              - containerPort: {{ .Values.metricsPort }}
            {{ end }}
            args:
            - -v={{ .Values.logLevel }}
            - -namespace={{ .Values.sparkJobNamespace }}
            - -ingress-url-format={{ .Values.ingressUrlFormat }}
            - -install-crds={{ .Values.installCrds }}
            - -controller-threads={{ .Values.controllerThreads }}
            - -resync-interval={{ .Values.resyncInterval }}
            - -logtostderr
            - -enable-batch-scheduler={{ .Values.enableBatchScheduler }}
            {{- if .Values.enableMetrics }}
            - -enable-metrics=true
            - -metrics-labels=app_type
            - -metrics-port={{ .Values.metricsPort }}
            - -metrics-endpoint={{ .Values.metricsEndpoint }}
            - -metrics-prefix={{ .Values.metricsPrefix }}
            {{- end }}
            {{- if .Values.enableWebhook }}
            - -enable-webhook=true
            - -webhook-svc-namespace={{ .Release.Namespace }}
            - -webhook-port={{ .Values.webhookPort }}
            - -webhook-svc-name={{ .Release.Name }}-webhook
            - -webhook-config-name={{ include "sparkoperator.fullname" . }}-webhook-config
            {{- end }}
            {{- if .Values.resources }}
            resources:
    {{ toYaml .Values.resources | indent 10 }}
            {{- end }}
          imagePullSecrets:
            - name: muduhwyunregsecret
    

    安装后,describe deployments, 发现没有 imagePullSecrets

    helm install xxx
    kubectl describe deploy xxx
    

    求 v 友指导下

    1 条回复    2019-09-12 15:26:21 +08:00
    littlespider89
        1
    littlespider89  
       2019-09-12 15:26:21 +08:00
    kubctl get --all-namespaces secret muduhwyunregsecret

    要 pull 的镜像是私有仓库的吗?如果是需要定义私有仓库 registry 的 docker 登录信息
    大概需要这样的操作

    kubectl create secret docker-registry muduhwyunregsecret --docker-server=registry.xxxxx.xx --docker-username=xxxxxxx --docker-password=xxxxxx --docker-email=xxxxx
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2207 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 15:45 · PVG 23:45 · LAX 08:45 · JFK 11:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.