2020-08-23 23:26:55 +05:30
|
|
|
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 05:37:42 +05:30
|
|
|
{{- if .Values.statefulset.labels }}
|
|
|
|
{{- toYaml .Values.statefulset.labels | nindent 6 }}
|
|
|
|
{{- end }}
|
2020-08-23 23:26:55 +05:30
|
|
|
serviceName: {{ include "gitea.fullname" . }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
annotations:
|
|
|
|
checksum/config: {{ include (print $.Template.BasePath "/gitea/config.yaml") . | sha256sum }}
|
2021-01-14 12:43:49 +05:30
|
|
|
checksum/ldap: {{ include "gitea.ldap_settings" . | sha256sum }}
|
2021-03-01 17:54:11 +05:30
|
|
|
checksum/oauth: {{ include "gitea.oauth_settings" . | sha256sum }}
|
2020-09-24 22:02:11 +05:30
|
|
|
{{- with .Values.gitea.podAnnotations }}
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2020-08-23 23:26:55 +05:30
|
|
|
labels:
|
2021-03-01 17:50:55 +05:30
|
|
|
{{- include "gitea.labels" . | nindent 8 }}
|
2021-03-17 05:37:42 +05:30
|
|
|
{{- if .Values.statefulset.labels }}
|
|
|
|
{{- toYaml .Values.statefulset.labels | nindent 8 }}
|
|
|
|
{{- end }}
|
2020-08-23 23:26:55 +05:30
|
|
|
spec:
|
2021-06-07 14:11:16 +05:30
|
|
|
{{- if .Values.schedulerName }}
|
|
|
|
schedulerName: "{{ .Values.schedulerName }}"
|
|
|
|
{{- end }}
|
2020-12-16 18:07:47 +05:30
|
|
|
{{- with .Values.imagePullSecrets }}
|
|
|
|
imagePullSecrets:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2020-08-23 23:26:55 +05:30
|
|
|
securityContext:
|
|
|
|
fsGroup: 1000
|
|
|
|
initContainers:
|
2021-06-30 01:39:16 +05:30
|
|
|
- name: init-directories
|
2021-04-29 14:42:48 +05:30
|
|
|
image: "{{ include "gitea.image" . }}"
|
2021-06-30 01:39:16 +05:30
|
|
|
command: ["/usr/sbin/init_directory_structure.sh"]
|
|
|
|
env:
|
|
|
|
- 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
|
|
|
|
{{- if .Values.statefulset.env }}
|
|
|
|
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
|
|
|
{{- end }}
|
|
|
|
volumeMounts:
|
|
|
|
- name: init
|
|
|
|
mountPath: /usr/sbin
|
|
|
|
- name: temp
|
|
|
|
mountPath: /tmp
|
|
|
|
- name: config
|
|
|
|
mountPath: /etc/gitea/conf
|
|
|
|
- name: data
|
|
|
|
mountPath: /data
|
|
|
|
{{- if .Values.extraVolumeMounts }}
|
|
|
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
|
|
{{- end }}
|
|
|
|
- name: configure-gitea
|
|
|
|
image: "{{ include "gitea.image" . }}"
|
|
|
|
command: ["/usr/sbin/configure_gitea.sh"]
|
|
|
|
securityContext:
|
|
|
|
runAsUser: 1000
|
2021-01-20 16:58:39 +05:30
|
|
|
env:
|
2021-04-29 14:42:48 +05:30
|
|
|
- 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 20:05:50 +05:30
|
|
|
- name: GITEA_TEMP
|
|
|
|
value: /tmp/gitea
|
2021-06-10 16:43:33 +05:30
|
|
|
{{- 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
|
2021-06-21 18:58:18 +05:30
|
|
|
value: {{ default (index .Values.gitea.ldap "bind-dn") .Values.gitea.ldap.bindDn | quote }}
|
2021-06-16 02:37:59 +05:30
|
|
|
- name: GITEA_LDAP_PASSWORD
|
2021-06-21 18:58:18 +05:30
|
|
|
value: {{ default (index .Values.gitea.ldap "bind-password") .Values.gitea.ldap.bindPassword | quote }}
|
2021-06-10 16:43:33 +05:30
|
|
|
{{- 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 14:42:48 +05:30
|
|
|
{{- if .Values.statefulset.env }}
|
|
|
|
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
|
|
|
{{- end }}
|
2020-08-23 23:26:55 +05:30
|
|
|
volumeMounts:
|
2020-09-25 19:07:55 +05:30
|
|
|
- name: init
|
|
|
|
mountPath: /usr/sbin
|
2021-06-09 20:05:50 +05:30
|
|
|
- name: temp
|
|
|
|
mountPath: /tmp
|
2020-08-23 23:26:55 +05:30
|
|
|
- name: data
|
|
|
|
mountPath: /data
|
2021-01-20 16:58:39 +05:30
|
|
|
{{- if .Values.extraVolumeMounts }}
|
|
|
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
|
|
{{- end }}
|
2020-08-23 23:26:55 +05:30
|
|
|
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
|
|
|
|
containers:
|
|
|
|
- name: {{ .Chart.Name }}
|
2021-04-29 14:42:48 +05:30
|
|
|
image: "{{ include "gitea.image" . }}"
|
2020-08-23 23:26:55 +05:30
|
|
|
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 14:42:48 +05:30
|
|
|
- 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 18:57:25 +05:30
|
|
|
- name: TMPDIR
|
|
|
|
value: /tmp/gitea
|
2021-06-30 00:53:32 +05:30
|
|
|
{{- if .Values.signing.enabled }}
|
|
|
|
- name: GNUPGHOME
|
|
|
|
value: {{ .Values.signing.gpgHome }}
|
|
|
|
{{- end }}
|
2021-04-29 14:42:48 +05:30
|
|
|
{{- if .Values.statefulset.env }}
|
|
|
|
{{- toYaml .Values.statefulset.env | nindent 12 }}
|
2020-09-10 15:45:34 +05:30
|
|
|
{{- end }}
|
2020-08-23 23:26:55 +05:30
|
|
|
ports:
|
|
|
|
- name: ssh
|
|
|
|
containerPort: {{ .Values.gitea.config.server.SSH_LISTEN_PORT }}
|
|
|
|
- name: http
|
|
|
|
containerPort: {{ .Values.gitea.config.server.HTTP_PORT }}
|
2021-02-17 15:14:40 +05:30
|
|
|
{{- if .Values.gitea.config.server.ENABLE_PPROF }}
|
2021-01-21 21:15:26 +05:30
|
|
|
- name: profiler
|
|
|
|
containerPort: 6060
|
|
|
|
{{- end }}
|
2021-03-01 20:16:05 +05:30
|
|
|
{{- if .Values.gitea.livenessProbe.enabled }}
|
2020-08-23 23:26:55 +05:30
|
|
|
livenessProbe:
|
|
|
|
tcpSocket:
|
|
|
|
port: http
|
2021-03-01 20:16:05 +05:30
|
|
|
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 23:26:55 +05:30
|
|
|
readinessProbe:
|
|
|
|
tcpSocket:
|
|
|
|
port: http
|
2021-03-01 20:16:05 +05:30
|
|
|
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 23:26:55 +05:30
|
|
|
resources:
|
|
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
2021-03-01 17:46:49 +05:30
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
2020-08-23 23:26:55 +05:30
|
|
|
volumeMounts:
|
2021-04-29 14:42:48 +05:30
|
|
|
- name: temp
|
2021-06-07 18:57:25 +05:30
|
|
|
mountPath: /tmp
|
2020-08-23 23:26:55 +05:30
|
|
|
- name: data
|
|
|
|
mountPath: /data
|
2021-01-20 16:58:39 +05:30
|
|
|
{{- if .Values.extraVolumeMounts }}
|
|
|
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
|
|
{{- end }}
|
2020-08-23 23:26:55 +05:30
|
|
|
{{- 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 19:07:55 +05:30
|
|
|
- name: init
|
|
|
|
secret:
|
|
|
|
secretName: {{ include "gitea.fullname" . }}-init
|
|
|
|
defaultMode: 0777
|
2020-08-23 23:26:55 +05:30
|
|
|
- name: config
|
2020-09-25 19:07:55 +05:30
|
|
|
secret:
|
|
|
|
secretName: {{ include "gitea.fullname" . }}
|
2021-01-20 16:58:39 +05:30
|
|
|
{{- if .Values.extraVolumes }}
|
|
|
|
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
|
|
|
{{- end }}
|
2021-04-29 14:42:48 +05:30
|
|
|
- name: temp
|
|
|
|
emptyDir: {}
|
2020-08-23 23:26:55 +05:30
|
|
|
{{- 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 13:54:37 +05:30
|
|
|
{{- 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 23:26:55 +05:30
|
|
|
spec:
|
|
|
|
accessModes:
|
|
|
|
{{- range .Values.persistence.accessModes }}
|
|
|
|
- {{ . | quote }}
|
|
|
|
{{- end }}
|
2020-10-29 22:40:10 +05:30
|
|
|
{{- if .Values.persistence.storageClass }}
|
|
|
|
storageClassName: {{ .Values.persistence.storageClass | quote }}
|
|
|
|
{{- end }}
|
2020-08-23 23:26:55 +05:30
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: {{ .Values.persistence.size | quote }}
|
|
|
|
{{- end }}
|