From 56dd155fc3c5000f3c189683d8bbe3f9b32979c2 Mon Sep 17 00:00:00 2001 From: Dylan Piergies Date: Wed, 8 Jul 2020 22:42:06 +0100 Subject: [PATCH] Use StatefulSet instead of Deployment Signed-off-by: Dylan Piergies --- stable/jenkins/README.md | 3 +-- stable/jenkins/templates/deprecation.yaml | 2 +- ...deployment.yaml => jenkins-master-statefulset.yaml} | 10 +++------- stable/jenkins/values.yaml | 6 +----- 4 files changed, 6 insertions(+), 15 deletions(-) rename stable/jenkins/templates/{jenkins-master-deployment.yaml => jenkins-master-statefulset.yaml} (98%) diff --git a/stable/jenkins/README.md b/stable/jenkins/README.md index 563e7825b8b3..626a1c92a367 100644 --- a/stable/jenkins/README.md +++ b/stable/jenkins/README.md @@ -11,7 +11,6 @@ Inspired by the awesome work of Carlos Sanchez This chart will do the following: * 1 x Jenkins Master with port 8080 exposed on an external LoadBalancer -* All using Kubernetes Deployments ## Installing the Chart @@ -140,7 +139,7 @@ The following tables list the configurable parameters of the Jenkins chart and t | `master.useSecurity` | Use basic security | `true` | | `master.securityRealm` | Jenkins XML for Security Realm | XML for `LegacySecurityRealm` | | `master.authorizationStrategy` | Jenkins XML for Authorization Strategy | XML for `FullControlOnceLoggedInAuthorizationStrategy` | -| `master.deploymentLabels` | Custom Deployment labels | Not set | +| `master.statefulSetLabels` | Custom StatefulSet labels | Not set | | `master.serviceLabels` | Custom Service labels | Not set | | `master.podLabels` | Custom Pod labels | Not set | | `master.adminUser` | Admin username (and password) created as a secret if useSecurity is true | `admin` | diff --git a/stable/jenkins/templates/deprecation.yaml b/stable/jenkins/templates/deprecation.yaml index 44bed6c7fd9f..fdd09e3626f8 100644 --- a/stable/jenkins/templates/deprecation.yaml +++ b/stable/jenkins/templates/deprecation.yaml @@ -42,7 +42,7 @@ {{- end }} {{- if .Values.Master.DeploymentLabels }} - {{ fail "`Master.DeploymentLabels` does no longer exist. It has been renamed to `master.deploymentLabels`" }} + {{ fail "`Master.DeploymentLabels` does no longer exist. It has been renamed to `master.statefulSetLabels`" }} {{- end }} {{- if .Values.Master.ServiceLabels }} diff --git a/stable/jenkins/templates/jenkins-master-deployment.yaml b/stable/jenkins/templates/jenkins-master-statefulset.yaml similarity index 98% rename from stable/jenkins/templates/jenkins-master-deployment.yaml rename to stable/jenkins/templates/jenkins-master-statefulset.yaml index fc037f33c6f1..0aac3cd6bfad 100644 --- a/stable/jenkins/templates/jenkins-master-deployment.yaml +++ b/stable/jenkins/templates/jenkins-master-statefulset.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 {{- else }} apiVersion: apps/v1beta1 {{- end }} -kind: Deployment +kind: StatefulSet metadata: name: {{ template "jenkins.fullname" . }} namespace: {{ template "jenkins.namespace" . }} @@ -13,7 +13,7 @@ metadata: "app.kubernetes.io/managed-by": "{{ .Release.Service }}" "app.kubernetes.io/instance": "{{ .Release.Name }}" "app.kubernetes.io/component": "{{ .Values.master.componentName }}" - {{- range $key, $val := .Values.master.deploymentLabels }} + {{- range $key, $val := .Values.master.statefulSetLabels }} {{ $key }}: {{ $val | quote }} {{- end}} {{- if .Values.master.deploymentAnnotations }} @@ -21,12 +21,8 @@ metadata: {{ toYaml .Values.master.deploymentAnnotations | indent 4 }} {{- end }} spec: + serviceName: {{ template "jenkins.fullname" . }} replicas: 1 - strategy: - type: {{ if .Values.persistence.enabled }}Recreate{{ else }}RollingUpdate - rollingUpdate: -{{ toYaml .Values.master.rollingUpdate | indent 6 }} - {{- end }} selector: matchLabels: "app.kubernetes.io/component": "{{ .Values.master.componentName }}" diff --git a/stable/jenkins/values.yaml b/stable/jenkins/values.yaml index 187fcbb198a2..c759edd73c82 100644 --- a/stable/jenkins/values.yaml +++ b/stable/jenkins/values.yaml @@ -112,10 +112,6 @@ master: # This values should not be changed unless you use your custom image of jenkins or any devired from. If you want to use # Cloudbees Jenkins Distribution docker, you should set jenkinsRef: "/usr/share/cloudbees-jenkins-distribution/ref" jenkinsRef: "/usr/share/jenkins/ref" - rollingUpdate: {} - # Ignored if Persistence is enabled - # maxSurge: 1 - # maxUnavailable: 25% resources: requests: cpu: "50m" @@ -150,7 +146,7 @@ master: # Jenkins master service annotations serviceAnnotations: {} # Jenkins master custom labels - deploymentLabels: {} + statefulSetLabels: {} # foo: bar # bar: foo # Jenkins master service labels