charts/gitea/templates/statefulset.yaml
Jonathan Ervine 8b7572f474 Added gitea
2020-09-01 17:02:16 +08:00

83 lines
2.4 KiB
YAML

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 }}
serviceName: {{ include "gitea.fullname" . }}
template:
metadata:
labels:
{{- include "gitea.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "gitea.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 3000
protocol: TCP
- name: ssh
containerPort: 22
protocol: TCP
livenessProbe:
tcpSocket:
port: 3000
timeoutSeconds: 2
failureThreshold: 5
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
readinessProbe:
tcpSocket:
port: 3000
timeoutSeconds: 2
failureThreshold: 5
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: gitea-pv
mountPath: /data
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitea-pv
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.config.storageSize }}
storageClassName: {{ .Values.config.storageClassName | quote }}