gitea-sonarqube-bot/helm/templates/deployment.yaml
justusbunsi eb3cb301fc
Allow changing the port
This introduces a new application option `--port`/`-p` to switch the
listening port from 3000 (default) to another port.

Docker image can be configured using the corresponding environment
variable `GITEA_SQ_BOT_PORT`.

Helm Chart allows setting `.Values.app.listeningPort`

Resolves: #25

Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2022-06-17 13:34:06 +02:00

90 lines
2.9 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "helm.fullname" . }}
labels:
{{- include "helm.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "helm.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "helm.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "helm.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- if .Values.app.configLocationOverride }}
- name: GITEA_SQ_BOT_CONFIG_PATH
value: "{{ .Values.app.configLocationOverride }}"
{{- end}}
- name: GITEA_SQ_BOT_PORT
value: "{{ .Values.app.listeningPort }}"
ports:
- name: http
containerPort: {{ .Values.app.listeningPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /ping
port: http
readinessProbe:
httpGet:
path: /ping
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: sq-bot-config
{{- if .Values.app.configLocationOverride }}
mountPath: {{ dir .Values.app.configLocationOverride }}
{{- else }}
mountPath: /home/bot/config
{{- end }}
readOnly: true
{{- if .Values.volumeMounts }}
{{- toYaml .Values.volumeMounts | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: sq-bot-config
secret:
secretName: {{ include "helm.fullname" . }}
{{- if .Values.app.configLocationOverride }}
items:
- key: config.yaml
path: {{ base .Values.app.configLocationOverride }}
{{- end }}
{{- if .Values.volumes }}
{{- toYaml .Values.volumes | nindent 8 }}
{{- end }}