Search code examples
postgresqlamazon-web-serviceskubernetesgitlab

Setting storageClass on Gitlab helmcart for Postgres, Minio, etc


I'm trying to deploy the gitlab helm chart:

https://docs.gitlab.com/charts/

But when I updated the values.yml Postgres deployment with a custom storageClass the PVC does not show a storageClass has been set.

...
postgresql:
  persistence:
    storageClass: ebs-sc
    size: 8Gi
...
helm install --namespace gitlab -f values.yml gitlab gitlab/gitlab
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ebs-sc
  namespace: gitlab
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp3
  iopsPerGB: "10"
  fsType: ext4
reclaimPolicy: Delete

My configuration files are above , postgres is part of the larger values.yml file found:

https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/values.yaml?ref_type=heads

Read this from gitlab and it shows the postgres config above

https://docs.gitlab.com/charts/installation/storage.html
https://gitlab.com/gitlab-org/charts/gitlab/blob/master/examples/storage/helm_options.yml

Solution

  • Realized I missed a step in https://docs.gitlab.com/charts/installation/storage.html

    Needed to run kubectl patch storageclass CUSTOM_STORAGE_CLASS_NAME -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}

    which seems to just override anything set in the values.yml.