Deploy controller using statefulset instead of deployment

So that no two controllers are running simultaneously.
This commit is contained in:
Mehran Kholdi 2020-04-28 18:19:03 +04:30
parent 420b0f4ff7
commit a2fdcb9756

View File

@ -1,11 +1,22 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "rawfile-csi.fullname" . }}-controller
labels:
{{- include "rawfile-csi.labels" . | nindent 4 }}
spec:
type: ClusterIP
selector:
{{- include "rawfile-csi.selectorLabels" . | nindent 4 }}
clusterIP: None
---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: StatefulSet
metadata: metadata:
name: {{ include "rawfile-csi.fullname" . }}-controller name: {{ include "rawfile-csi.fullname" . }}-controller
spec: spec:
replicas: 1 replicas: 1
strategy: serviceName: {{ include "rawfile-csi.fullname" . }}
type: Recreate
selector: selector:
matchLabels: &selectorLabels matchLabels: &selectorLabels
{{- include "rawfile-csi.selectorLabels" . | nindent 6 }} {{- include "rawfile-csi.selectorLabels" . | nindent 6 }}