datatracker/helm/templates/deployments/datatracker.yaml
Jennifer Richards d14cbd10e9 ci: refactor scout sidecar (#7338)
* ci: remove stray comma in settings_local.py

* ci: move scout sidecar to containers

initContainers sidecars not supported until kubernetes 1.29
2024-05-13 21:41:36 -04:00

87 lines
3.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "datatracker.datatracker.fullname" . }}
labels:
{{- include "datatracker.commonLabels" . | nindent 4 }}
app.kubernetes.io/name: {{ .Values.datatracker.name }}
spec:
{{- $podValues := .Values.datatracker }}
replicas: {{ $podValues.replicaCount }}
revisionHistoryLimit: {{ $podValues.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "datatracker.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: {{ $podValues.name }}
template:
metadata:
labels:
{{- include "datatracker.selectorLabels" . | nindent 8 }}
app.kubernetes.io/name: {{ $podValues.name }}
spec:
{{- with $podValues.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "datatracker.serviceAccountName.datatracker" . }}
securityContext:
{{- toYaml $podValues.podSecurityContext | nindent 8 }}
containers:
{{- if $podValues.scoutapm }}
- name: "scoutapm"
image: "{{ $podValues.scoutapm.image.repository }}:{{ default "latest" $podValues.scoutapm.image.tag }}"
imagePullPolicy: {{ default "IfNotPresent" $podValues.scoutapm.image.imagePullPolicy }}
livenessProbe:
exec:
command:
- "sh"
- "-c"
- "./core-agent probe --tcp 0.0.0.0:6590 | grep -q 'Agent found'"
{{- end }}
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml $podValues.securityContext | nindent 12 }}
image: "{{ $podValues.image.repository }}:{{ default .Chart.AppVersion $podValues.image.tag }}"
imagePullPolicy: {{ default "IfNotPresent" $podValues.image.imagePullPolicy }}
env:
- name: "CONTAINER_ROLE"
value: "datatracker"
{{- if $.Values.env }}
{{- range $key, $val := $.Values.env }}
- name: {{ $key | quote }}
value: {{ $val | quote }}
{{- end }}
{{- end }}
{{- with $podValues.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8000
protocol: TCP
livenessProbe:
{{- toYaml $podValues.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml $podValues.readinessProbe | nindent 12 }}
startupProbe:
{{- toYaml $podValues.startupProbe | nindent 12 }}
resources:
{{- toYaml $podValues.resources | nindent 12 }}
{{- with $podValues.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $podValues.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $podValues.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $podValues.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}