Browse Source

feat(flink): Update storageClass handling

Viacheslav Kropotko 4 years ago
parent
commit
5e2ce3e492
3 changed files with 10 additions and 6 deletions
  1. 3 2
      flink/templates/jobmanager.yaml
  2. 3 2
      flink/templates/taskmanager.yaml
  3. 4 2
      flink/values.yaml

+ 3 - 2
flink/templates/jobmanager.yaml

@@ -198,13 +198,14 @@ spec:
   volumeClaimTemplates:
     - metadata:
         name: jobmanager-data
-        annotations:
-          volume.alpha.kubernetes.io/storage-class: {{ .Values.jobmanager.persistent.storageClass }}
         labels:
 {{ include "flink.labels" . | indent 10 }}
       spec:
         accessModes:
           - ReadWriteOnce
+        {{- if eq (kindIs "invalid" .Values.jobmanager.persistent.storageClass) false }}
+        storageClassName: {{ .Values.jobmanager.persistent.storageClass | quote }}
+        {{- end }}
         resources:
           requests:
             storage: {{ .Values.jobmanager.persistent.size }}

+ 3 - 2
flink/templates/taskmanager.yaml

@@ -169,13 +169,14 @@ spec:
   volumeClaimTemplates:
     - metadata:
         name: taskmanager-data
-        annotations:
-          volume.alpha.kubernetes.io/storage-class: {{ .Values.taskmanager.persistent.storageClass }}
         labels:
 {{ include "flink.labels" . | indent 10 }}
       spec:
         accessModes:
           - ReadWriteOnce
+        {{- if eq (kindIs "invalid" .Values.taskmanager.persistent.storageClass) false }}
+        storageClassName: {{ .Values.taskmanager.persistent.storageClass | quote }}
+        {{- end }}
         resources:
           requests:
             storage: {{ .Values.taskmanager.persistent.size }}

+ 4 - 2
flink/values.yaml

@@ -189,9 +189,10 @@ jobmanager:
       annotations: {}
   nodeSelector: {}
   affinity: {}
-  tolerations: {}
+  tolerations: []
   persistent:
     enabled: false
+    # https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1
     storageClass:
     size: 8Gi
     mountPath: "/flink_state"
@@ -256,9 +257,10 @@ taskmanager:
     type: ClusterIP
   nodeSelector: {}
   affinity: {}
-  tolerations: {}
+  tolerations: []
   persistent:
     enabled: false
+    # https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1
     storageClass:
     size: 8Gi
     mountPath: "/flink_state"