Commit 0b17f471 authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason
Browse files

Merge branch 'continue-pvc-support' into 'master'

Continue PVC support Community Contribution

See merge request gitlab-org/cluster-integration/auto-deploy-image!238
parents 8368df9d 2224b3df
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
apiVersion: v1
description: GitLab's Auto-deploy Helm Chart
name: auto-deploy-app
version: 2.21.1
version: 2.22.0
icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png
+7 −0
Original line number Diff line number Diff line
@@ -91,3 +91,10 @@
| ciliumNetworkPolicy.enabled         | Enable container cilium network policy | `false` |
| ciliumNetworkPolicy.alerts.enabled         | Enable alert generation for container cilium network policy | `false` |
| ciliumNetworkPolicy.spec            | [Cilium network policy](https://docs.cilium.io/en/v1.8/concepts/kubernetes/policy/#ciliumnetworkpolicy/) definition | `{ endpointSelector: {}, ingress: [{ fromEndpoints: [{ matchLabels: { app.gitlab.com/managed_by: gitlab } }] }] }` |
| persistence.enabled           | Allow a [persistent volume claim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims) (PVC) to be mounted as a volume. <br/> **Warning:** Auto-created PVCs are deleted any time `persistence.enabled` is set to `false`. | `false` |
| persistence.volumes[].name         | The name of the volume. | `data` |
| persistence.volumes[].mount.path         | The mount path in the deployment containers. | `/pvc-mount` |
| persistence.volumes[].mount.subPath      | (Optional) The [subPath](https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath) of the path. | |
| persistence.volumes[].claim.accessMode   | The access mode of the PVC. | `ReadWriteOnce` |
| persistence.volumes[].claim.size         | The storage size of the PVC. | `8Gi` |
| persistence.volumes[].claim.storageClass | (Optional) The storage class of the PVC. If not specified, it falls back to the default storage class from the provider. | `nil` |
+7 −0
Original line number Diff line number Diff line
@@ -49,6 +49,13 @@ Get SecRule's arguments with unescaped single&double quotes
{{- printf "SecRule %s %s %s" .variable $operator $action -}}
{{- end -}}

{{/*
Generate a name for a Persistent Volume Claim
*/}}
{{- define "pvcName" -}}
{{- printf "%s-%s" (include "fullname" .context) .name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "sharedlabels" -}}
app: {{ template "appname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version| replace "+" "_" }}"
+20 −0
Original line number Diff line number Diff line
@@ -60,6 +60,16 @@ spec:
{{- if and (semverCompare ">= 1.19.x" .Capabilities.KubeVersion.Version) (.Values.topologySpreadConstraints) }}
      topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.persistence.enabled }}
{{- $context := . }}
      volumes:
{{- range $volume := .Values.persistence.volumes }}
        - name: {{ $volume.name | quote }}
          persistentVolumeClaim:
            {{ $args := dict "context" $context "name" $volume.name }}
            claimName: {{ template "pvcName" $args }}
{{- end }}
{{- end }}
      terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
      containers:
@@ -145,4 +155,14 @@ spec:
          timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
        resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.persistence.enabled }}
        volumeMounts:
{{- range $volume := .Values.persistence.volumes }}
          - name: {{ $volume.name | quote }}
            mountPath: {{ $volume.mount.path | quote }}
            {{- if $volume.mount.subPath }}
            subPath: {{ $volume.mount.subPath | quote }}
            {{- end }}
{{- end }}
{{- end }}
{{- end -}}
+24 −0
Original line number Diff line number Diff line
{{- if .Values.persistence.enabled -}}
{{- $context := . }}
{{- range $volume := .Values.persistence.volumes }}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  {{ $args := dict "context" $context "name" $volume.name }}
  name: {{ template "pvcName" $args }}
  labels:
    track: "{{ $.Values.application.track }}"
    tier: "{{ $.Values.application.tier }}"
{{ include "sharedlabels" $context | indent 4 }}
spec:
  accessModes:
    - {{ $volume.claim.accessMode | quote }}
  resources:
    requests:
      storage: {{ $volume.claim.size | quote }}
  {{- if $volume.claim.storageClass }}
  storageClassName: {{ $volume.claim.storageClass | quote }}
  {{- end }}
{{- end }}
{{- end -}}
Loading