From a2fdcb9756539fe5537b5233cc9db8081c493adc Mon Sep 17 00:00:00 2001 From: Mehran Kholdi Date: Tue, 28 Apr 2020 18:19:03 +0430 Subject: [PATCH] Deploy controller using statefulset instead of deployment So that no two controllers are running simultaneously. --- .../templates/01-controller-plugin.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/deploy/charts/rawfile-csi/templates/01-controller-plugin.yaml b/deploy/charts/rawfile-csi/templates/01-controller-plugin.yaml index 6b958bf..eac219d 100644 --- a/deploy/charts/rawfile-csi/templates/01-controller-plugin.yaml +++ b/deploy/charts/rawfile-csi/templates/01-controller-plugin.yaml @@ -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 -kind: Deployment +kind: StatefulSet metadata: name: {{ include "rawfile-csi.fullname" . }}-controller spec: replicas: 1 - strategy: - type: Recreate + serviceName: {{ include "rawfile-csi.fullname" . }} selector: matchLabels: &selectorLabels {{- include "rawfile-csi.selectorLabels" . | nindent 6 }}