2020-08-23 19:56:55 +02:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: StatefulSet
|
|
|
|
metadata:
|
|
|
|
name: {{ include "gitea.fullname" . }}
|
|
|
|
labels:
|
|
|
|
{{- include "gitea.labels" . | nindent 4 }}
|
|
|
|
spec:
|
|
|
|
replicas: {{ .Values.replicaCount }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
2021-03-17 01:07:42 +01:00
|
|
|
{{- if .Values.statefulset.labels }}
|
|
|
|
{{- toYaml .Values.statefulset.labels | nindent 6 }}
|
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
serviceName: {{ include "gitea.fullname" . }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
annotations:
|
|
|
|
checksum/config: {{ include (print $.Template.BasePath "/gitea/config.yaml") . | sha256sum }}
|
2021-01-14 08:13:49 +01:00
|
|
|
checksum/ldap: {{ include "gitea.ldap_settings" . | sha256sum }}
|
2021-03-01 13:24:11 +01:00
|
|
|
checksum/oauth: {{ include "gitea.oauth_settings" . | sha256sum }}
|
2020-09-24 18:32:11 +02:00
|
|
|
{{- with .Values.gitea.podAnnotations }}
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
labels:
|
2021-03-01 13:20:55 +01:00
|
|
|
{{- include "gitea.labels" . | nindent 8 }}
|
2021-03-17 01:07:42 +01:00
|
|
|
{{- if .Values.statefulset.labels }}
|
|
|
|
{{- toYaml .Values.statefulset.labels | nindent 8 }}
|
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
spec:
|
2021-06-07 10:41:16 +02:00
|
|
|
{{- if .Values.schedulerName }}
|
|
|
|
schedulerName: "{{ .Values.schedulerName }}"
|
|
|
|
{{- end }}
|
2020-12-16 13:37:47 +01:00
|
|
|
{{- with .Values.imagePullSecrets }}
|
|
|
|
imagePullSecrets:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
securityContext:
|
|
|
|
fsGroup: 1000
|
|
|
|
initContainers:
|
|
|
|
- name: init
|
2021-04-29 11:12:48 +02:00
|
|
|
image: "{{ include "gitea.image" . }}"
|
2020-09-25 15:37:55 +02:00
|
|
|
command: ["/usr/sbin/init_gitea.sh"]
|
2021-01-20 12:28:39 +01:00
|
|
|
env:
|
2021-04-29 11:12:48 +02:00
|
|
|
- name: GITEA_APP_INI
|
|
|
|
value: /data/gitea/conf/app.ini
|
|
|
|
- name: GITEA_CUSTOM
|
|
|
|
value: /data/gitea
|
|
|
|
- name: GITEA_WORK_DIR
|
|
|
|
value: /data
|
2021-06-09 16:35:50 +02:00
|
|
|
- name: GITEA_TEMP
|
|
|
|
value: /tmp/gitea
|
2021-06-10 13:13:33 +02:00
|
|
|
{{- if .Values.gitea.ldap.existingSecret }}
|
|
|
|
- name: GITEA_LDAP_BIND_DN
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: bindDn
|
|
|
|
name: {{ .Values.gitea.ldap.existingSecret }}
|
|
|
|
- name: GITEA_LDAP_PASSWORD
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: bindPassword
|
|
|
|
name: {{ .Values.gitea.ldap.existingSecret }}
|
|
|
|
{{- else }}
|
|
|
|
- name: GITEA_LDAP_BIND_DN
|
|
|
|
value: {{ .Values.gitea.ldap.bindDn | quote }}
|
2021-06-15 23:07:59 +02:00
|
|
|
- name: GITEA_LDAP_PASSWORD
|
2021-06-10 13:13:33 +02:00
|
|
|
value: {{ .Values.gitea.ldap.bindPassword | quote }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.gitea.admin.existingSecret }}
|
|
|
|
- name: GITEA_ADMIN_USERNAME
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: username
|
|
|
|
name: {{ .Values.gitea.admin.existingSecret }}
|
|
|
|
- name: GITEA_ADMIN_PASSWORD
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: password
|
|
|
|
name: {{ .Values.gitea.admin.existingSecret }}
|
|
|
|
{{- else }}
|
|
|
|
- name: GITEA_ADMIN_USERNAME
|
|
|
|
value: {{ .Values.gitea.admin.username | quote }}
|
|
|
|
- name: GITEA_ADMIN_PASSWORD
|
|
|
|
value: {{ .Values.gitea.admin.password | quote }}
|
|
|
|
{{- end }}
|
2021-04-29 11:12:48 +02:00
|
|
|
{{- if .Values.statefulset.env }}
|
|
|
|
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
volumeMounts:
|
2020-09-25 15:37:55 +02:00
|
|
|
- name: init
|
|
|
|
mountPath: /usr/sbin
|
2021-06-09 16:35:50 +02:00
|
|
|
- name: temp
|
|
|
|
mountPath: /tmp
|
2020-08-23 19:56:55 +02:00
|
|
|
- name: config
|
|
|
|
mountPath: /etc/gitea/conf
|
|
|
|
- name: data
|
|
|
|
mountPath: /data
|
2021-01-20 12:28:39 +01:00
|
|
|
{{- if .Values.extraVolumeMounts }}
|
|
|
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
|
|
|
|
containers:
|
|
|
|
- name: {{ .Chart.Name }}
|
2021-04-29 11:12:48 +02:00
|
|
|
image: "{{ include "gitea.image" . }}"
|
2020-08-23 19:56:55 +02:00
|
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
|
|
env:
|
|
|
|
# SSH Port values have to be set here as well for openssh configuration
|
|
|
|
- name: SSH_LISTEN_PORT
|
|
|
|
value: {{ .Values.gitea.config.server.SSH_LISTEN_PORT | quote }}
|
|
|
|
- name: SSH_PORT
|
|
|
|
value: {{ .Values.gitea.config.server.SSH_PORT | quote }}
|
2021-04-29 11:12:48 +02:00
|
|
|
- name: GITEA_APP_INI
|
|
|
|
value: /data/gitea/conf/app.ini
|
|
|
|
- name: GITEA_CUSTOM
|
|
|
|
value: /data/gitea
|
|
|
|
- name: GITEA_WORK_DIR
|
|
|
|
value: /data
|
|
|
|
- name: GITEA_TEMP
|
|
|
|
value: /tmp/gitea
|
2021-06-07 15:27:25 +02:00
|
|
|
- name: TMPDIR
|
|
|
|
value: /tmp/gitea
|
2021-04-29 11:12:48 +02:00
|
|
|
{{- if .Values.statefulset.env }}
|
|
|
|
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
2020-09-10 12:15:34 +02:00
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
ports:
|
|
|
|
- name: ssh
|
|
|
|
containerPort: {{ .Values.gitea.config.server.SSH_LISTEN_PORT }}
|
|
|
|
- name: http
|
|
|
|
containerPort: {{ .Values.gitea.config.server.HTTP_PORT }}
|
2021-02-17 10:44:40 +01:00
|
|
|
{{- if .Values.gitea.config.server.ENABLE_PPROF }}
|
2021-01-21 16:45:26 +01:00
|
|
|
- name: profiler
|
|
|
|
containerPort: 6060
|
|
|
|
{{- end }}
|
2021-03-01 15:46:05 +01:00
|
|
|
{{- if .Values.gitea.livenessProbe.enabled }}
|
2020-08-23 19:56:55 +02:00
|
|
|
livenessProbe:
|
|
|
|
tcpSocket:
|
|
|
|
port: http
|
2021-03-01 15:46:05 +01:00
|
|
|
initialDelaySeconds: {{ .Values.gitea.livenessProbe.initialDelaySeconds }}
|
|
|
|
periodSeconds: {{ .Values.gitea.livenessProbe.periodSeconds }}
|
|
|
|
timeoutSeconds: {{ .Values.gitea.livenessProbe.timeoutSeconds }}
|
|
|
|
successThreshold: {{ .Values.gitea.livenessProbe.successThreshold }}
|
|
|
|
failureThreshold: {{ .Values.gitea.livenessProbe.failureThreshold }}
|
|
|
|
{{- else if .Values.gitea.customLivenessProbe }}
|
|
|
|
livenessProbe:
|
|
|
|
{{- toYaml .Values.gitea.customLivenessProbe | nindent 12 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.gitea.readinessProbe.enabled }}
|
2020-08-23 19:56:55 +02:00
|
|
|
readinessProbe:
|
|
|
|
tcpSocket:
|
|
|
|
port: http
|
2021-03-01 15:46:05 +01:00
|
|
|
initialDelaySeconds: {{ .Values.gitea.readinessProbe.initialDelaySeconds }}
|
|
|
|
periodSeconds: {{ .Values.gitea.readinessProbe.periodSeconds }}
|
|
|
|
timeoutSeconds: {{ .Values.gitea.readinessProbe.timeoutSeconds }}
|
|
|
|
successThreshold: {{ .Values.gitea.readinessProbe.successThreshold }}
|
|
|
|
failureThreshold: {{ .Values.gitea.readinessProbe.failureThreshold }}
|
|
|
|
{{- else if .Values.gitea.customReadinessProbe }}
|
|
|
|
readinessProbe:
|
|
|
|
{{- toYaml .Values.gitea.customReadinessProbe | nindent 12 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.gitea.startupProbe.enabled }}
|
|
|
|
startupProbe:
|
|
|
|
tcpSocket:
|
|
|
|
port: http
|
|
|
|
initialDelaySeconds: {{ .Values.gitea.startupProbe.initialDelaySeconds }}
|
|
|
|
periodSeconds: {{ .Values.gitea.startupProbe.periodSeconds }}
|
|
|
|
timeoutSeconds: {{ .Values.gitea.startupProbe.timeoutSeconds }}
|
|
|
|
successThreshold: {{ .Values.gitea.startupProbe.successThreshold }}
|
|
|
|
failureThreshold: {{ .Values.gitea.startupProbe.failureThreshold }}
|
|
|
|
{{- else if .Values.gitea.customStartupProbe }}
|
|
|
|
startupProbe:
|
|
|
|
{{- toYaml .Values.gitea.customStartupProbe | nindent 12 }}
|
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
resources:
|
|
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
2021-03-01 13:16:49 +01:00
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
2020-08-23 19:56:55 +02:00
|
|
|
volumeMounts:
|
2021-04-29 11:12:48 +02:00
|
|
|
- name: temp
|
2021-06-07 15:27:25 +02:00
|
|
|
mountPath: /tmp
|
2020-08-23 19:56:55 +02:00
|
|
|
- name: data
|
|
|
|
mountPath: /data
|
2021-01-20 12:28:39 +01:00
|
|
|
{{- if .Values.extraVolumeMounts }}
|
|
|
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
{{- 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:
|
2020-09-25 15:37:55 +02:00
|
|
|
- name: init
|
|
|
|
secret:
|
|
|
|
secretName: {{ include "gitea.fullname" . }}-init
|
|
|
|
defaultMode: 0777
|
2020-08-23 19:56:55 +02:00
|
|
|
- name: config
|
2020-09-25 15:37:55 +02:00
|
|
|
secret:
|
|
|
|
secretName: {{ include "gitea.fullname" . }}
|
2021-01-20 12:28:39 +01:00
|
|
|
{{- if .Values.extraVolumes }}
|
|
|
|
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
|
|
|
{{- end }}
|
2021-04-29 11:12:48 +02:00
|
|
|
- name: temp
|
|
|
|
emptyDir: {}
|
2020-08-23 19:56:55 +02:00
|
|
|
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
|
|
|
- name: data
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: {{ .Values.persistence.existingClaim }}
|
|
|
|
{{- else if not .Values.persistence.enabled }}
|
|
|
|
- name: data
|
|
|
|
emptyDir: {}
|
|
|
|
{{- else if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
|
|
|
volumeClaimTemplates:
|
|
|
|
- metadata:
|
|
|
|
name: data
|
2021-01-22 09:24:37 +01:00
|
|
|
{{- with .Values.persistence.annotations }}
|
|
|
|
annotations:
|
|
|
|
{{- range $key, $value := . }}
|
|
|
|
{{ $key }}: {{ $value }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.persistence.labels }}
|
|
|
|
labels:
|
|
|
|
{{- range $key, $value := . }}
|
|
|
|
{{ $key }}: {{ $value }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
spec:
|
|
|
|
accessModes:
|
|
|
|
{{- range .Values.persistence.accessModes }}
|
|
|
|
- {{ . | quote }}
|
|
|
|
{{- end }}
|
2020-10-29 18:10:10 +01:00
|
|
|
{{- if .Values.persistence.storageClass }}
|
|
|
|
storageClassName: {{ .Values.persistence.storageClass | quote }}
|
|
|
|
{{- end }}
|
2020-08-23 19:56:55 +02:00
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: {{ .Values.persistence.size | quote }}
|
|
|
|
{{- end }}
|