apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.commonLabels" . | nindent 4 }} spec: {{ if .Values.ordinals.enabled }} ordinals: start: {{ .Values.ordinals.start }} {{ end }} replicas: {{ .Values.replicaCount }} serviceName: {{ include "common.names.fullname" . }} selector: matchLabels: {{- include "common.labels.selectorLabels" . | nindent 6 }} template: metadata: annotations: checksum/config-jvm: {{ include (print $.Template.BasePath "/config-jvm.yaml") . | sha256sum }} {{- if .Values.additionalConfigMaps }} checksum/config-additional: {{ include (print $.Template.BasePath "/configmap-additional-config.yaml") . | sha256sum }} {{- end }} {{- if .Values.fluentd.enabled }} checksum/config-fluentd: {{ include (print $.Template.BasePath "/configmap-fluentd.yaml") . | sha256sum }} {{- end }} {{- include "bamboo.podAnnotations" . | nindent 8 }} labels: {{- include "common.labels.selectorLabels" . | nindent 8 }} {{- include "bamboo.podLabels" . | nindent 8 }} spec: serviceAccountName: {{ include "bamboo.serviceAccountName" . }} terminationGracePeriodSeconds: {{ .Values.bamboo.shutdown.terminationGracePeriodSeconds }} hostAliases: {{- include "bamboo.additionalHosts" . | nindent 8 }} {{- if .Values.openshift.runWithRestrictedSCC }} {{- else }} {{- if .Values.bamboo.securityContextEnabled }} {{- with .Values.bamboo.securityContext }} securityContext: {{ toYaml . | nindent 8 }} {{- if not .fsGroup }} fsGroup: 2005 {{- end }} {{- end }} {{- end }} {{- end }} initContainers: {{- include "bamboo.additionalInitContainers" . | nindent 8 }} {{- if and .Values.volumes.sharedHome.nfsPermissionFixer.enabled (not .Values.openshift.runWithRestrictedSCC) }} - name: nfs-permission-fixer image: {{ .Values.volumes.sharedHome.nfsPermissionFixer.imageRepo }}:{{ .Values.volumes.sharedHome.nfsPermissionFixer.imageTag }} imagePullPolicy: IfNotPresent {{- if .Values.volumes.sharedHome.nfsPermissionFixer.resources }} resources: {{- with .Values.volumes.sharedHome.nfsPermissionFixer.resources }} {{- toYaml . | nindent 12 }} {{- end }} {{- end }} securityContext: runAsUser: 0 # make sure we run as root so we get the ability to change the volume permissions volumeMounts: - name: shared-home mountPath: {{ .Values.volumes.sharedHome.nfsPermissionFixer.mountPath | quote }} {{- if .Values.volumes.sharedHome.subPath }} subPath: {{ .Values.volumes.sharedHome.subPath | quote }} {{- end }} command: ["sh", "-c", {{ include "bamboo.sharedHome.permissionFix.command" . | quote }}] {{- end }} {{- include "common.jmx.initContainer" . | nindent 8 }} {{- if .Values.bamboo.additionalCertificates.secretName }} - name: import-certs image: {{ include "bamboo.image" . | quote }} imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: keystore mountPath: /var/ssl - name: certs mountPath: /tmp/crt command: ["/bin/bash"] args: ["-c", {{ include "bamboo.addCrtToKeystoreCmd" . }}] {{- end }} containers: - name: {{ if .Values.bamboo.useHelmReleaseNameAsContainerName}}{{ include "common.names.fullname" . }}{{ else }}{{ .Chart.Name }}{{ end }} image: {{ include "bamboo.image" . | quote }} imagePullPolicy: {{ .Values.image.pullPolicy }} env: {{ if .Values.ingress.https }} - name: ATL_TOMCAT_SCHEME value: "https" - name: ATL_TOMCAT_SECURE value: "true" {{ end }} - name: ATL_BASE_URL value: {{ include "bamboo.baseUrl" . | quote }} {{ if .Values.bamboo.service.contextPath }} - name: ATL_TOMCAT_CONTEXTPATH value: {{ .Values.bamboo.service.contextPath | quote }} {{ end }} - name: ATL_TOMCAT_PORT value: {{ .Values.bamboo.ports.http | quote }} {{ if .Values.ingress.host }} - name: ATL_PROXY_NAME value: {{ .Values.ingress.host | quote }} - name: ATL_PROXY_PORT value: {{ include "bamboo.ingressPort" . | quote }} {{ end }} {{- include "bamboo.databaseEnvVars" . | nindent 12 }} - name: SET_PERMISSIONS value: {{ .Values.bamboo.setPermissions | quote }} - name: BAMBOO_SHARED_HOME value: {{ .Values.volumes.sharedHome.mountPath | quote }} - name: JVM_SUPPORT_RECOMMENDED_ARGS valueFrom: configMapKeyRef: key: additional_jvm_args name: {{ include "common.names.fullname" . }}-jvm-config - name: JVM_MINIMUM_MEMORY valueFrom: configMapKeyRef: key: min_heap name: {{ include "common.names.fullname" . }}-jvm-config - name: JVM_MAXIMUM_MEMORY valueFrom: configMapKeyRef: key: max_heap name: {{ include "common.names.fullname" . }}-jvm-config {{ if .Values.bamboo.brokerUrl }} - name: ATL_CLIENT_BROKER_URL value: {{ .Values.bamboo.brokerUrl | quote }} {{ end }} {{ if .Values.bamboo.securityToken.secretName }} - name: SECURITY_TOKEN valueFrom: secretKeyRef: name: {{ .Values.bamboo.securityToken.secretName }} key: {{ .Values.bamboo.securityToken.secretKey }} {{ end }} {{ if .Values.bamboo.disableAgentAuth }} - name: ATL_BAMBOO_DISABLE_AGENT_AUTH value: "true" {{ end }} {{ if .Values.bamboo.license.secretName }} - name: ATL_LICENSE valueFrom: secretKeyRef: name: {{ .Values.bamboo.license.secretName }} key: {{ .Values.bamboo.license.secretKey }} {{ end }} {{ if .Values.bamboo.sysadminCredentials.secretName }} - name: ATL_ADMIN_USERNAME valueFrom: secretKeyRef: name: {{ .Values.bamboo.sysadminCredentials.secretName }} key: {{ .Values.bamboo.sysadminCredentials.usernameSecretKey }} - name: ATL_ADMIN_PASSWORD valueFrom: secretKeyRef: name: {{ .Values.bamboo.sysadminCredentials.secretName }} key: {{ .Values.bamboo.sysadminCredentials.passwordSecretKey }} - name: ATL_ADMIN_FULLNAME valueFrom: secretKeyRef: name: {{ .Values.bamboo.sysadminCredentials.secretName }} key: {{ .Values.bamboo.sysadminCredentials.displayNameSecretKey }} - name: ATL_ADMIN_EMAIL valueFrom: secretKeyRef: name: {{ .Values.bamboo.sysadminCredentials.secretName }} key: {{ .Values.bamboo.sysadminCredentials.emailAddressSecretKey }} {{ end }} {{ if .Values.bamboo.import.type }} - name: ATL_IMPORT_OPTION value: {{ .Values.bamboo.import.type }} - name: ATL_IMPORT_PATH value: {{ .Values.bamboo.import.path }} {{ end }} - name: ATL_BAMBOO_ENABLE_UNATTENDED_SETUP value: {{ .Values.bamboo.unattendedSetup | quote }} {{- include "bamboo.additionalEnvironmentVariables" . | nindent 12 }} ports: - name: http containerPort: {{ .Values.bamboo.ports.http }} protocol: TCP - name: jms containerPort: {{ .Values.bamboo.ports.jms }} protocol: TCP {{- include "common.jmx.port" . | nindent 12 }} {{- include "bamboo.additionalPorts" . | nindent 12 }} {{- if .Values.bamboo.readinessProbe.enabled }} readinessProbe: {{- if .Values.bamboo.readinessProbe.customProbe}} {{- with .Values.bamboo.readinessProbe.customProbe }} {{- toYaml . | nindent 12 }} {{- end }} {{- else }} httpGet: port: {{ .Values.bamboo.ports.http }} path: {{ .Values.bamboo.service.contextPath }}/rest/api/latest/status initialDelaySeconds: {{ .Values.bamboo.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.bamboo.readinessProbe.periodSeconds }} timeoutSeconds: {{ .Values.bamboo.readinessProbe.timeoutSeconds }} failureThreshold: {{ .Values.bamboo.readinessProbe.failureThreshold }} {{- end }} {{- end }} {{- if .Values.bamboo.startupProbe.enabled }} startupProbe: tcpSocket: port: {{ .Values.bamboo.ports.http }} initialDelaySeconds: {{ .Values.bamboo.startupProbe.initialDelaySeconds }} periodSeconds: {{ .Values.bamboo.startupProbe.periodSeconds }} failureThreshold: {{ .Values.bamboo.startupProbe.failureThreshold }} {{- end }} {{- if .Values.bamboo.livenessProbe.enabled }} livenessProbe: {{- if .Values.bamboo.livenessProbe.customProbe}} {{- with .Values.bamboo.livenessProbe.customProbe }} {{- toYaml . | nindent 12 }} {{- end }} {{- else }} tcpSocket: port: {{ .Values.bamboo.ports.http }} initialDelaySeconds: {{ .Values.bamboo.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.bamboo.livenessProbe.periodSeconds }} timeoutSeconds: {{ .Values.bamboo.livenessProbe.timeoutSeconds }} failureThreshold: {{ .Values.bamboo.livenessProbe.failureThreshold }} {{- end }} {{- end }} {{- with .Values.bamboo.containerSecurityContext}} securityContext: {{- toYaml . | nindent 12}} {{- end}} {{- with .Values.bamboo.resources.container }} resources: {{- toYaml . | nindent 12 }} {{- end }} volumeMounts: {{- include "bamboo.volumeMounts" . | nindent 12 }} {{- include "common.jmx.config.volumeMounts" . | nindent 12 }} {{- include "bamboo.additionalVolumeMounts" . | nindent 12 }} {{- include "bamboo.additionalLibraries" . | nindent 12 }} {{- include "bamboo.additionalBundledPlugins" . | nindent 12 }} {{- range $i, $n := .Values.additionalFiles }} - name: {{ .name }}-{{$i}} mountPath: {{ .mountPath }}/{{ .key }} subPath: {{ .key }} {{ end }} {{- range $i, $n := .Values.additionalConfigMaps }} {{- range .keys }} - name: {{ .fileName | replace "_" "-" | replace "." "-" }} mountPath: {{ .mountPath }}/{{ .fileName }} subPath: {{ .fileName }} {{ end }} {{- end }} lifecycle: {{- if .Values.bamboo.postStart.command }} postStart: exec: command: ["/bin/sh", "-c", {{- .Values.bamboo.postStart.command | quote }}] {{- end }} preStop: exec: command: ["sh", "-c", {{ .Values.bamboo.shutdown.command | quote }}] {{- include "fluentd.container" . | nindent 8 }} {{- include "bamboo.additionalContainers" . | nindent 8 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.bamboo.topologySpreadConstraints }} topologySpreadConstraints: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.schedulerName }} schedulerName: {{ .Values.schedulerName | quote }} {{- end }} {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} {{- end }} volumes: {{- range $i, $n := .Values.additionalFiles }} - name: {{ .name }}-{{$i}} {{ .type }}: {{ if hasPrefix .type "secret" }}{{ .type}}Name{{ else }}name{{ end }}: {{ .name }} items: - key: {{ .key }} path: {{ .key }} {{ end }} {{- range $i, $key := .Values.additionalConfigMaps }} {{- with $ }} {{- range $key.keys }} - name: {{ .fileName | replace "_" "-" | replace "." "-" }} configMap: name: {{ include "common.names.fullname" $ }}-{{ $key.name }} {{- if .defaultMode }} defaultMode: {{ .defaultMode }} {{- end }} items: - key: {{ .fileName }} path: {{ .fileName }} {{- end }} {{ end }} {{- end }} {{ include "bamboo.volumes" . | nindent 8 }} {{ include "fluentd.config.volume" . | nindent 8 }} {{ include "common.jmx.config.volume" . | nindent 8 }} {{ include "bamboo.volumeClaimTemplates" . | nindent 2 }}