如何使用 helm3 创建部署,从 docker hub 拉取镜像?

时间:2021-01-28 02:06:26

标签: docker kubernetes kubernetes-helm

我的仓库中有 docker 镜像,akshay123007/lists-pods。我已经创建了舵图 图片:

 repository: akshay123007/lists-pods
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: ""

imagePullSecrets: 
  - name: regcred 
nameOverride: ""
fullnameOverride: ""

serviceAccount:
  # Specifies whether a service account should be created
  create: true
  # Annotations to add to the service account
  annotations: {}
  # The name of the service account to use.
  # If not set and create is true, a name is generated using the fullname template
  name: ""

podAnnotations: {}

podSecurityContext: {}
  # fsGroup: 2000

securityContext: {}
  # capabilities:
  #   drop:
  #   - ALL
  # readOnlyRootFilesystem: true
  # runAsNonRoot: true
  # runAsUser: 1000

service:
  type: ClusterIP
  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

autoscaling:
  enabled: false
  minReplicas: 1
  maxReplicas: 100
  targetCPUUtilizationPercentage: 80
  # targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}

当我安装 chart 时,我收到以下错误:无法拉取映像“akshay123007/lists-pods:1.16.0”:rpc 错误:代码 = 未知 desc = 来自守护进程的错误响应:akshay123007/lists-pods 的清单: 1.16.0 未找到:清单未知:清单未知。

我尝试更改图像:docker.io/akshay123007/lists-pods:latest,然后它说 errImagePull。我不知道是什么问题,任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

您忘记了应该在哪个注册表中获取您的图像。应该是这样的

image:  
    registry: YOUR_DOCKER_REGISTRY (EX: docker.io)  
    repository: akshay123007/lists-pods