helmfile.yaml 1.55 KB
environments:
  default:
    values:
      - namespace: redis
        namePrefix: "test-"
        redisServer:
          jsonPatches: []
          strategicMergePatches: []
        images:
          redis: "redis:6.2.6"

---
releases:

  - name: {{ .Values.namePrefix }}redis-server
    namespace: {{ .Values.namespace }}
    chart: charts/redis-server
    values:
      - set-common-values.yaml.gotmpl
    jsonPatches:
      {{- if not (empty (.Values.redisServer.jsonPatches)) }}
      {{- .Values.redisServer.jsonPatches | toYaml | indent 6 }}
      {{- end }}
    strategicMergePatches:
      - apiVersion: apps/v1
        kind: Deployment
        metadata:
          name: {{ .Values.namePrefix }}redis-server
          namespace: {{ .Values.namespace }}
        spec:
          selector:
            matchLabels:
              app: {{ .Values.namePrefix }}redis-server
          template:
            metadata:
              labels:
                app: {{ .Values.namePrefix }}redis-server
            spec:
              volumes:
                - name: redis-data
                  persistentVolumeClaim:
                    claimName: {{ .Values.namePrefix }}redis-data
      - apiVersion: v1
        kind: Service
        metadata:
          name: {{ .Values.namePrefix }}redis
          namespace: {{ .Values.namespace }}
        spec:
          selector:
            app: {{ .Values.namePrefix }}redis-server
      {{- if not (empty (.Values.redisServer.strategicMergePatches)) }}
      {{- .Values.redisServer.strategicMergePatches | toYaml | indent 6 }}
      {{- end }}