github.com/replicatedcom/ship@v0.50.0/integration/update/helm-values-files/expected/.ship/upstream/templates/jenkins-master-deployment.yaml (about)

     1  {{- if .Capabilities.APIVersions.Has "apps/v1" }}
     2  apiVersion: apps/v1
     3  {{- else }}
     4  apiVersion: apps/v1beta1
     5  {{- end }}
     6  kind: Deployment
     7  metadata:
     8    name: {{ template "jenkins.fullname" . }}
     9    labels:
    10      heritage: {{ .Release.Service | quote }}
    11      release: {{ .Release.Name | quote }}
    12      chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    13      component: "{{ .Release.Name }}-{{ .Values.Master.Name }}"
    14  spec:
    15    replicas: 1
    16    strategy:
    17      type: {{ if .Values.Persistence.Enabled }}Recreate{{ else }}RollingUpdate{{ end }}
    18    selector:
    19      matchLabels:
    20        component: "{{ .Release.Name }}-{{ .Values.Master.Component }}"
    21    template:
    22      metadata:
    23        labels:
    24          app: {{ template "jenkins.fullname" . }}
    25          heritage: {{ .Release.Service | quote }}
    26          release: {{ .Release.Name | quote }}
    27          chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    28          component: "{{ .Release.Name }}-{{ .Values.Master.Component }}"
    29        annotations:
    30          checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }}
    31          {{- if .Values.Master.PodAnnotations }}
    32  {{ toYaml .Values.Master.PodAnnotations | indent 8 }}
    33          {{- end }}
    34      spec:
    35        {{- if .Values.Master.NodeSelector }}
    36        nodeSelector:
    37  {{ toYaml .Values.Master.NodeSelector | indent 8 }}
    38        {{- end }}
    39        {{- if .Values.Master.Tolerations }}
    40        tolerations:
    41  {{ toYaml .Values.Master.Tolerations | indent 8 }}
    42        {{- end }}
    43        {{- if .Values.Master.Affinity }}
    44        affinity:
    45  {{ toYaml .Values.Master.Affinity | indent 8 }}
    46        {{- end }}
    47  {{- if .Values.Master.UsePodSecurityContext }}
    48        securityContext:
    49          runAsUser: {{ default 0 .Values.Master.RunAsUser }}
    50  {{- if and (.Values.Master.RunAsUser) (.Values.Master.FsGroup) }}
    51  {{- if not (eq .Values.Master.RunAsUser 0.0) }}
    52          fsGroup: {{ .Values.Master.FsGroup }}
    53  {{- end }}
    54  {{- end }}
    55  {{- end }}
    56        serviceAccountName: {{ if .Values.rbac.install }}{{ template "jenkins.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }}
    57  {{- if .Values.Master.HostNetworking }}
    58        hostNetwork: true
    59        dnsPolicy: ClusterFirstWithHostNet 
    60  {{- end }}
    61        initContainers:
    62          - name: "copy-default-config"
    63            image: "{{ .Values.Master.Image }}:{{ .Values.Master.ImageTag }}"
    64            imagePullPolicy: "{{ .Values.Master.ImagePullPolicy }}"
    65            command: [ "sh", "/var/jenkins_config/apply_config.sh" ]
    66            {{- if .Values.Master.InitContainerEnv }}
    67            env:
    68  {{ toYaml .Values.Master.InitContainerEnv | indent 12 }}
    69            {{- end }}
    70            resources:
    71  {{ toYaml .Values.Master.resources | indent 12 }}
    72            volumeMounts:
    73              -
    74                mountPath: /var/jenkins_home
    75                name: jenkins-home
    76              -
    77                mountPath: /var/jenkins_config
    78                name: jenkins-config
    79              {{- if .Values.Master.CredentialsXmlSecret }}
    80              -
    81                mountPath: /var/jenkins_credentials
    82                name: jenkins-credentials
    83                readOnly: true
    84              {{- end }}
    85              {{- if .Values.Master.SecretsFilesSecret }}
    86              -
    87                mountPath: /var/jenkins_secrets
    88                name: jenkins-secrets
    89                readOnly: true
    90              {{- end }}
    91              {{- if .Values.Master.Jobs }}
    92              -
    93                mountPath: /var/jenkins_jobs
    94                name: jenkins-jobs
    95                readOnly: true
    96              {{- end }}
    97              {{- if .Values.Master.InstallPlugins }}
    98              -
    99                mountPath: /var/jenkins_plugins
   100                name: plugin-dir
   101              {{- end }}
   102              -
   103                mountPath: /usr/share/jenkins/ref/secrets/
   104                name: secrets-dir
   105        containers:
   106          - name: {{ template "jenkins.fullname" . }}
   107            image: "{{ .Values.Master.Image }}:{{ .Values.Master.ImageTag }}"
   108            imagePullPolicy: "{{ .Values.Master.ImagePullPolicy }}"
   109            {{- if .Values.Master.UseSecurity }}
   110            args: [ "--argumentsRealm.passwd.$(ADMIN_USER)=$(ADMIN_PASSWORD)",  "--argumentsRealm.roles.$(ADMIN_USER)=admin"]
   111            {{- end }}
   112            env:
   113              - name: JAVA_TOOL_OPTIONS
   114                value: "{{ default "" .Values.Master.JavaOpts}}"
   115              - name: JENKINS_OPTS
   116                value: "{{ if .Values.Master.JenkinsUriPrefix }}--prefix={{ .Values.Master.JenkinsUriPrefix }} {{ end }}{{ default "" .Values.Master.JenkinsOpts}}"
   117              {{- if .Values.Master.UseSecurity }}
   118              - name: ADMIN_PASSWORD
   119                valueFrom:
   120                  secretKeyRef:
   121                    name: {{ template "jenkins.fullname" . }}
   122                    key: jenkins-admin-password
   123              - name: ADMIN_USER
   124                valueFrom:
   125                  secretKeyRef:
   126                    name: {{ template "jenkins.fullname" . }}
   127                    key: jenkins-admin-user
   128              {{- end }}
   129              {{- if .Values.Master.ContainerEnv }}
   130  {{ toYaml .Values.Master.ContainerEnv | indent 12 }}
   131              {{- end }}
   132            ports:
   133              - containerPort: 8080
   134                name: http
   135              - containerPort: {{ .Values.Master.SlaveListenerPort }}
   136                name: slavelistener
   137              {{- if .Values.Master.JMXPort }}
   138              - containerPort: {{ .Values.Master.JMXPort }}
   139                name: jmx
   140              {{- end }}
   141  {{- range $index, $port := .Values.Master.ExtraPorts }}
   142              - containerPort: {{ $port.port }}
   143                name: {{ $port.name }}
   144  {{- end }}
   145  {{- if .Values.Master.HealthProbes }}
   146            livenessProbe:
   147              httpGet:
   148                path: "{{ default "" .Values.Master.JenkinsUriPrefix }}/login"
   149                port: http
   150              initialDelaySeconds: {{ .Values.Master.HealthProbesLivenessTimeout }}
   151              timeoutSeconds: 5
   152              failureThreshold: {{ .Values.Master.HealthProbeLivenessFailureThreshold }}
   153            readinessProbe:
   154              httpGet:
   155                path: "{{ default "" .Values.Master.JenkinsUriPrefix }}/login"
   156                port: http
   157              initialDelaySeconds: {{ .Values.Master.HealthProbesReadinessTimeout }}
   158  {{- end }}
   159            # Resources configuration is a little hacky. This was to prevent breaking
   160            # changes, and should be cleanned up in the future once everybody had
   161            # enough time to migrate.
   162            resources:
   163  {{ if or .Values.Master.Cpu .Values.Master.Memory }}
   164              requests:
   165                cpu: "{{ .Values.Master.Cpu }}"
   166                memory: "{{ .Values.Master.Memory }}"
   167  {{ else }}
   168  {{ toYaml .Values.Master.resources | indent 12 }}
   169  {{ end }}
   170            volumeMounts:
   171  {{- if .Values.Persistence.mounts }}
   172  {{ toYaml .Values.Persistence.mounts | indent 12 }}
   173  {{- end }}
   174              -
   175                mountPath: /var/jenkins_home
   176                name: jenkins-home
   177                readOnly: false
   178              -
   179                mountPath: /var/jenkins_config
   180                name: jenkins-config
   181                readOnly: true
   182              {{- if .Values.Master.CredentialsXmlSecret }}
   183              -
   184                mountPath: /var/jenkins_credentials
   185                name: jenkins-credentials
   186                readOnly: true
   187              {{- end }}
   188              {{- if .Values.Master.SecretsFilesSecret }}
   189              -
   190                mountPath: /var/jenkins_secrets
   191                name: jenkins-secrets
   192                readOnly: true
   193              {{- end }}
   194              {{- if .Values.Master.Jobs }}
   195              -
   196                mountPath: /var/jenkins_jobs
   197                name: jenkins-jobs
   198                readOnly: true
   199              {{- end }}
   200              {{- if .Values.Master.InstallPlugins }}
   201              -
   202                mountPath: /usr/share/jenkins/ref/plugins/
   203                name: plugin-dir
   204                readOnly: false
   205              {{- end }}
   206              -
   207                mountPath: /usr/share/jenkins/ref/secrets/
   208                name: secrets-dir
   209                readOnly: false
   210        volumes:
   211  {{- if .Values.Persistence.volumes }}
   212  {{ toYaml .Values.Persistence.volumes | indent 6 }}
   213  {{- end }}
   214        - name: jenkins-config
   215          configMap:
   216            name: {{ template "jenkins.fullname" . }}
   217        {{- if .Values.Master.CredentialsXmlSecret }}
   218        - name: jenkins-credentials
   219          secret:
   220            secretName: {{ .Values.Master.CredentialsXmlSecret }}
   221        {{- end }}
   222        {{- if .Values.Master.SecretsFilesSecret }}
   223        - name: jenkins-secrets
   224          secret:
   225            secretName: {{ .Values.Master.SecretsFilesSecret }}
   226        {{- end }}
   227        {{- if .Values.Master.Jobs }}
   228        - name: jenkins-jobs
   229          configMap:
   230            name: {{ template "jenkins.fullname" . }}-jobs
   231        {{- end }}
   232        {{- if .Values.Master.InstallPlugins }}
   233        - name: plugin-dir
   234          emptyDir: {}
   235        {{- end }}
   236        - name: secrets-dir
   237          emptyDir: {}
   238        - name: jenkins-home
   239        {{- if .Values.Persistence.Enabled }}
   240          persistentVolumeClaim:
   241            claimName: {{ .Values.Persistence.ExistingClaim | default (include "jenkins.fullname" .) }}
   242        {{- else }}
   243          emptyDir: {}
   244        {{- end -}}
   245  {{- if .Values.Master.ImagePullSecret }}
   246        imagePullSecrets:
   247        - name: {{ .Values.Master.ImagePullSecret }}
   248  {{- end -}}