docker - 无法使用 helm 在 Kubernetes 上使用持久存储设置 docker 私有(private)注册表

标签 docker kubernetes docker-registry

我正在尝试使用 helm 在 kubernetes 集群上设置一个 docker 私有(private)注册表。但我收到 pvc 错误。错误是:

Events:
  Type     Reason       Age                  From                   Message
  ----     ------       ----                 ----                   -------
  Normal   Scheduled    22m                  default-scheduler      Successfully assigned docker-reg/docker-private-registry-docker-registry-6454b85dbb-zpdjc to 192.168.1.19
  Warning  FailedMount  2m10s (x9 over 20m)  kubelet, 192.168.1.19  Unable to mount volumes for pod "docker-private-registry-docker-registry-6454b85dbb-zpdjc_docker-reg(82c8be80-eb43-11e8-85c9-b06ebfd124ff)": timeout expired waiting for volumes to attach or mount for pod "docker-reg"/"docker-private-registry-docker-registry-6454b85dbb-zpdjc". list of unmounted volumes=[data]. list of unattached volumes=[auth data docker-private-registry-docker-registry-config default-token-xc4p7]

这个错误的原因可能是什么?我也尝试先创建一个 pvc,然后将现有的 pvc 与 docker 注册表的 helm 一起使用,但它给出了相同的错误。

脚步:
  • 创建 htpasswd 文件
  • 编辑 values.yml并将 htpasswd 文件的内容添加到 htpasswd key 。
  • 修改values.yml启用持久性
  • 运行helm install stable/docker-registry --namespace docker-reg --name docker-private-registry --values helm-docker-reg/values.yml
  • values.yml文件:
    # Default values for docker-registry.
    # This is a YAML-formatted file.
    # Declare variables to be passed into your templates.
    replicaCount: 1
    
    updateStrategy:
      # type: RollingUpdate
      # rollingUpdate:
      #   maxSurge: 1
      #   maxUnavailable: 0
    
    podAnnotations: {}
    
    image:
      repository: registry
      tag: 2.6.2
      pullPolicy: IfNotPresent
    # imagePullSecrets:
        # - name: docker
    service:
      name: registry
      type: ClusterIP
      # clusterIP:
      port: 5000
      # nodePort:
      annotations: {}
      # foo.io/bar: "true"
    ingress:
      enabled: false
      path: /
      # Used to create an Ingress record.
      hosts:
        - chart-example.local
      annotations:
        # kubernetes.io/ingress.class: nginx
        # kubernetes.io/tls-acme: "true"
      tls:
        # Secrets must be manually created in the namespace.
        # - 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
    persistence:
      accessMode: 'ReadWriteOnce'
      enabled: true
      size: 10Gi
      storageClass: 'rook-ceph-block'
    
    # set the type of filesystem to use: filesystem, s3
    storage: filesystem
    
    # Set this to name of secret for tls certs
    # tlsSecretName: registry.docker.example.com
    secrets:
      haSharedSecret: ""
      htpasswd: "dasdma:$2y$05$bnLaYEdTLawodHz2ULzx2Ob.OUI6wY6bXr9WUuasdwuGZ7TIsTK2W"
    # Secrets for Azure
    #   azure:
    #     accountName: ""
    #     accountKey: ""
    #     container: ""
    # Secrets for S3 access and secret keys
    #   s3:
    #     accessKey: ""
    #     secretKey: ""
    # Secrets for Swift username and password
    #   swift:
    #     username: ""
    #     password: ""
    
    # Options for s3 storage type:
    # s3:
    #  region: us-east-1
    #  bucket: my-bucket
    #  encrypt: false
    #  secure: true
    
    # Options for swift storage type:
    # swift:
    #  authurl: http://swift.example.com/
    #  container: my-container
    
    configData:
      version: 0.1
      log:
        fields:
          service: registry
      storage:
        cache:
          blobdescriptor: inmemory
      http:
        addr: :5000
        headers:
          X-Content-Type-Options: [nosniff]
      health:
        storagedriver:
          enabled: true
          interval: 10s
          threshold: 3
    
    securityContext:
      enabled: true
      runAsUser: 1000
      fsGroup: 1000
    
    priorityClassName: ""
    
    nodeSelector: {}
    
    tolerations: []
    

    最佳答案

    它现在正在工作。问题出在此处记录的 openebs 存储 - https://docs.openebs.io/docs/next/tsgiscsi.html

    关于docker - 无法使用 helm 在 Kubernetes 上使用持久存储设置 docker 私有(private)注册表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53363094/

    相关文章:

    linux - 在 ubuntu live disk 中运行 docker

    docker - 部署Tensorflow服务客户端脚本

    kubernetes - 字段kubernetes.io/ingress.class的 Helm 升级命令错误

    kubernetes - Pod 无法安装软件包(apt-get update 或 apt-get install )

    docker - docker 注册表:https而不是http

    docker - 由于--log-opts,Docker运行失败

    docker - Docker注册表无法删除图像?

    mysql - Laravel Sail 重建默认数据库

    ssl - Helm Ingress 中的 Traefik LetsEncrypt 证书

    docker - 重新创建Docker镜像而不是重复使用-用于微服务