Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
Use StatefulSet instead of Deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Piergies <[email protected]>
  • Loading branch information
dylanpiergies committed Jul 8, 2020
1 parent 71b2272 commit 56dd155
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
3 changes: 1 addition & 2 deletions stable/jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Inspired by the awesome work of Carlos Sanchez <mailto:[email protected]>
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

Expand Down Expand Up @@ -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` |
Expand Down
2 changes: 1 addition & 1 deletion stable/jenkins/templates/deprecation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" . }}
Expand All @@ -13,20 +13,16 @@ 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 }}
annotations:
{{ 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 }}"
Expand Down
6 changes: 1 addition & 5 deletions stable/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -150,7 +146,7 @@ master:
# Jenkins master service annotations
serviceAnnotations: {}
# Jenkins master custom labels
deploymentLabels: {}
statefulSetLabels: {}
# foo: bar
# bar: foo
# Jenkins master service labels
Expand Down

0 comments on commit 56dd155

Please sign in to comment.