Эх сурвалжийг харах

Add support for specifying restart policy

Waqar Ahmed 4 жил өмнө
parent
commit
d9c1000ab8

+ 17 - 5
charts/ix-chart/2009.0.1/questions.yaml

@@ -37,11 +37,23 @@
   description: "Upgrade Policy"
   label: "Update Strategy"
   schema:
-    - type: string
-      default: "RollingUpdate"
-      enum:
-        - "RollingUpdate"
-        - "Recreate"
+    type: string
+    default: "RollingUpdate"
+    enum:
+      - "RollingUpdate"
+      - "Recreate"
+
+# Restart Policy
+- variable: restartPolicy
+  description: "Restart Policy for workload"
+  label: "Restart Policy"
+  schema:
+    type: string
+    default: "Always"
+    enum:
+      - "Always"
+      - "OnFailure"
+      - "Never"
 
 # Configurable CMD / Entrypoint / Environment Variables
 - variable: containerCommand

+ 3 - 1
charts/ix-chart/2009.0.1/templates/deployment.yaml

@@ -5,6 +5,8 @@ metadata:
   labels:
     {{- include "ix-chart.labels" . | nindent 4 }}
 spec:
+  strategy:
+      type: {{ .Values.updateStrategy }}
   selector:
     matchLabels:
       {{- include "ix-chart.selectorLabels" . | nindent 6 }}
@@ -18,7 +20,7 @@ spec:
         k8s.v1.cni.cncf.io/networks: {{ join ", " .Values.ixExternalInterfacesConfigurationNames }}
         {{- end }}
     spec:
-      strategy: {{ .Values.updateStrategy }}
+      restartPolicy: {{ .Values.restartPolicy | quote }}
       containers:
         - name: {{ .Chart.Name }}
           {{- if or .Values.hostPathVolumes .Values.persistentVolumeClaims }}

+ 3 - 0
charts/ix-chart/2009.0.1/values.yaml

@@ -10,6 +10,9 @@ image:
 # Update strategy
 updateStrategy: "RollingUpdate"
 
+# Restart Policy
+restartPolicy: "Always"
+
 # Container CMD / entrypoint
 containerCommand: []
 containerArgs: []