Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Deployment with StatefulSet #33

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions charts/jenkins/VALUES_SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ The following tables list the configurable parameters of the Jenkins chart and t
| `master.slaveListenerServiceType` | Defines how to expose the slaveListener service | `ClusterIP` |
| `master.slaveListenerLoadBalancerIP` | Static IP for the slaveListener LoadBalancer | Not set |

#### Kubernetes Deployment & Service
#### Kubernetes StatefulSet & Service
| Parameter | Description | Default |
| --------------------------------- | ------------------------------------ | ----------------------------------------- |
| `master.image` | Master image name | `jenkins/jenkins` |
Expand All @@ -108,7 +108,7 @@ The following tables list the configurable parameters of the Jenkins chart and t
| `master.extraPorts` | Open extra ports, for other uses | `[]` |
| `master.loadBalancerSourceRanges` | Allowed inbound IP addresses | `0.0.0.0/0` |
| `master.loadBalancerIP` | Optional fixed external IP | Not set |
| `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.nodeSelector` | Node labels for pod assignment | `{}` |
Expand All @@ -117,7 +117,7 @@ The following tables list the configurable parameters of the Jenkins chart and t
| `master.terminationGracePeriodSeconds` | Set TerminationGracePeriodSeconds | Not set |
| `master.tolerations` | Toleration labels for pod assignment | `[]` |
| `master.podAnnotations` | Annotations for master pod | `{}` |
| `master.deploymentAnnotations` | Annotations for master deployment | `{}` |
| `master.statefulSetAnnotations` | Annotations for master StatefulSet | `{}` |
| `master.lifecycle` | Lifecycle specification for master-container | Not set |
| `master.priorityClassName` | The name of a `priorityClass` to apply to the master pod | Not set |
| `master.admin.existingSecret` | The name of an existing secret containing the admin credentials. | `""`|
Expand Down
14 changes: 13 additions & 1 deletion charts/jenkins/templates/deprecation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,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 Expand Up @@ -317,4 +317,16 @@
{{- if .Values.master.JCasC.pluginVersion }}
{{ fail "master.JCasC.pluginVersion has been deprecated, please use master.installPlugins instead" }}
{{- end }}

{{- if .Values.master.deploymentLabels }}
{{ fail "`master.deploymentLabels` does no longer exist. It has been renamed to `master.statefulSetLabels`" }}
{{- end }}

{{- if .Values.master.deploymentAnnotations }}
{{ fail "`master.deploymentAnnotations` does no longer exist. It has been renamed to `master.statefulSetAnnotations`" }}
{{- end }}

{{- if .Values.master.rollingUpdate }}
{{ fail "`master.rollingUpdate` does no longer exist. It is no longer relevant, since a StatefulSet is used for the Jenkins master" }}
{{- end }}
{{- end }}
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 }}
{{- if .Values.master.statefulSetAnnotations }}
annotations:
{{ toYaml .Values.master.deploymentAnnotations | indent 4 }}
{{ toYaml .Values.master.statefulSetAnnotations | 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
10 changes: 3 additions & 7 deletions charts/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,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 @@ -140,7 +136,7 @@ master:
# Jenkins master service annotations
serviceAnnotations: {}
# Jenkins master custom labels
deploymentLabels: {}
statefulSetLabels: {}
# foo: bar
# bar: foo
# Jenkins master service labels
Expand Down Expand Up @@ -336,8 +332,8 @@ master:
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
# priorityClass: system-cluster-critical
podAnnotations: {}
# Add deployment annotation
deploymentAnnotations: {}
# Add StatefulSet annotations
statefulSetAnnotations: {}

ingress:
enabled: false
Expand Down