我需要在Kubernetes上使用Helm部署GitLab。
我有一个问题:PVC正在等待处理。

我在PVC说明中看到了volume.alpha.kubernetes.io/storage-class: default,但是在values.yaml中设置了值gitlabDataStorageClass: gluster-heketi
我可以从https://github.com/gluster/gluster-kubernetes/blob/master/docs/examples/hello_world/README.md文章中部署简单的nginx
是的,我使用分布式存储GlusterFS https://github.com/gluster/gluster-kubernetes

# kubectl get pvc
NAME                  STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS     AGE
gitlab1-gitlab-data   Pending                                                                                         19s
gitlab1-gitlab-etc    Pending                                                                                         19s
gitlab1-postgresql    Pending                                                                                         19s
gitlab1-redis         Pending                                                                                         19s
gluster1              Bound     pvc-922b5dc0-6372-11e8-8f10-4ccc6a60fcbe   5Gi        RWO            gluster-heketi   43m

单个包装的结构:
# kubectl get pvc gitlab1-gitlab-data -o yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    volume.alpha.kubernetes.io/storage-class: default
  creationTimestamp: 2018-05-29T19:43:18Z
  finalizers:
  - kubernetes.io/pvc-protection
  name: gitlab1-gitlab-data
  namespace: default
  resourceVersion: "263950"
  selfLink: /api/v1/namespaces/default/persistentvolumeclaims/gitlab1-gitlab-data
  uid: 8958d4f5-6378-11e8-8f10-4ccc6a60fcbe
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
status:
  phase: Pending

在描述中我看到:
# kubectl describe pvc gitlab1-gitlab-data
Name:          gitlab1-gitlab-data
Namespace:     default
StorageClass:
Status:        Pending
Volume:
Labels:        <none>
Annotations:   volume.alpha.kubernetes.io/storage-class=default
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
Events:
  Type    Reason         Age                From                         Message
  ----    ------         ----               ----                         -------
  Normal  FailedBinding  2m (x43 over 12m)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set

我的values.yaml文件:
# Default values for kubernetes-gitlab-demo.
# This is a YAML-formatted file.

# Required variables

# baseDomain is the top-most part of the domain. Subdomains will be generated
# for gitlab, mattermost, registry, and prometheus.
# Recommended to set up an A record on the DNS to *.your-domain.com to point to
# the baseIP
# e.g. *.your-domain.com.    A    300    baseIP
baseDomain: my-domain.com

# legoEmail is a valid email address used by Let's Encrypt. It does not have to
# be at the baseDomain.
legoEmail: [email protected]

# Optional variables
# baseIP is an externally provisioned static IP address to use instead of the provisioned one.
#baseIP: 95.165.135.109
nameOverride: gitlab
# `ce` or `ee`
gitlab: ce
gitlabCEImage: gitlab/gitlab-ce:10.6.2-ce.0
gitlabEEImage: gitlab/gitlab-ee:10.6.2-ee.0
postgresPassword: NDl1ZjNtenMxcWR6NXZnbw==
initialSharedRunnersRegistrationToken: "tQtCbx5UZy_ByS7FyzUH"
mattermostAppSecret: NDl1ZjNtenMxcWR6NXZnbw==
mattermostAppUID: aadas
redisImage: redis:3.2.10
redisDedicatedStorage: true
redisStorageSize: 5Gi
redisAccessMode: ReadWriteOnce
postgresImage: postgres:9.6.5
# If you disable postgresDedicatedStorage, you should consider bumping up gitlabRailsStorageSize
postgresDedicatedStorage: true
postgresAccessMode: ReadWriteOnce
postgresStorageSize: 30Gi
gitlabDataAccessMode: ReadWriteOnce
#gitlabDataStorageSize: 30Gi
gitlabRegistryAccessMode: ReadWriteOnce
#gitlabRegistryStorageSize: 30Gi
gitlabConfigAccessMode: ReadWriteOnce
#gitlabConfigStorageSize: 1Gi
gitlabRunnerImage: gitlab/gitlab-runner:alpine-v10.6.0
# Valid values for provider are `gke` for Google Container Engine. Leaving it blank (or any othervalue) will disable fast disk options.
#provider: gke

# Gitlab pages
# The following 3 lines are needed to enable gitlab pages.
# pagesExternalScheme: http
# pagesExternalDomain: your-pages-domain.com
# pagesTlsSecret: gitlab-pages-tls # An optional reference to a tls secret to use in pages

## Storage Class Options
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
## If not defined, but provider is gke, will use SSDs
## Otherwise default: volume.alpha.kubernetes.io/storage-class: default
gitlabConfigStorageClass: gluster-heketi
gitlabDataStorageClass: gluster-heketi
gitlabRegistryStorageClass: gluster-heketi
postgresStorageClass: gluster-heketi
redisStorageClass: gluster-heketi

healthCheckToken: 'SXBAQichEJasbtDSygrD'
# Optional, for GitLab EE images only
#gitlabEELicense: base64-encoded-license

# Additional omnibus configuration,
# see https://docs.gitlab.com/omnibus/settings/configuration.html
# for possible configuration options
#omnibusConfigRuby: |
#  gitlab_rails['smtp_enable'] = true
#  gitlab_rails['smtp_address'] = "smtp.example.org"

gitlab-runner:
  checkInterval: 1
  # runnerRegistrationToken must equal initialSharedRunnersRegistrationToken
  runnerRegistrationToken: "tQtCbx5UZy_ByS7FyzUH"
  # resources:
  #   limits:
  #     memory: 500Mi
  #     cpu: 600m
  #   requests:
  #     memory: 500Mi
  #     cpu: 600m
  runners:
    privileged: true
    ## Build Container specific configuration
    ##
    # builds:
    #   cpuLimit: 200m
    #   memoryLimit: 256Mi
    #   cpuRequests: 100m
    #   memoryRequests: 128Mi

    ## Service Container specific configuration
    ##
    # services:
    #   cpuLimit: 200m
    #   memoryLimit: 256Mi
    #   cpuRequests: 100m
    #   memoryRequests: 128Mi

    ## Helper Container specific configuration
    ##
    # helpers:
    #   cpuLimit: 200m
    #   memoryLimit: 256Mi
    #   cpuRequests: 100m
    #   memoryRequests: 128Mi

您可以看到我有StorageClass:
# kubectl get sc
NAME             PROVISIONER               AGE
gluster-heketi   kubernetes.io/glusterfs   48m

最佳答案

如果没有到您使用的实际 Helm 的链接,那么任何人都不可能对go-template为什么不正确使用values.yaml进行故障排除。



我很感激您在values.yaml中设置了所需的值,但是只要StorageClass与任何现有的StorageClass不匹配,我不确定从那里开始会出现什么积极的事情。您当然可以尝试创建一个名为StorageClassdefault,该gluster-heketi包含与ojit_code SC相同的值,或者更新PVC以使用正确的SC。

老实说,这可能是掌 Helm chart 中的错误,但是,如果要部署GitLab,请在修复该错误之前(和/或获得该图表的链接以帮助您了解如何调整Yaml)。需要手动解决这种不良情况。

09-04 01:53