helm: add helm chart
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
{{- if .Values.mongo.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "buildpath.fullname" . }}-mongo
|
||||
labels:
|
||||
{{- include "buildpath.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mongo
|
||||
spec:
|
||||
serviceName: {{ include "buildpath.fullname" . }}-mongo
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "buildpath.componentSelectorLabels" (set . "component" "mongo") | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "buildpath.componentSelectorLabels" (set . "component" "mongo") | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.mongo.runAsUser }}
|
||||
runAsGroup: {{ .Values.mongo.runAsGroup }}
|
||||
fsGroup: {{ .Values.mongo.runAsGroup }}
|
||||
containers:
|
||||
- name: mongo
|
||||
image: "{{ .Values.mongo.image.repository }}:{{ .Values.mongo.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.mongo.image.pullPolicy }}
|
||||
args:
|
||||
- mongod
|
||||
- --wiredTigerCacheSizeGB
|
||||
- {{ .Values.mongo.wiredTigerCacheSizeGB | quote }}
|
||||
env:
|
||||
- name: MONGO_INITDB_ROOT_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "buildpath.fullname" . }}
|
||||
key: MONGO_USER
|
||||
- name: MONGO_INITDB_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "buildpath.fullname" . }}
|
||||
key: MONGO_PASS
|
||||
{{- if .Values.mongo.auth.initialDatabase }}
|
||||
- name: MONGO_INITDB_DATABASE
|
||||
value: {{ .Values.mongo.auth.initialDatabase | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.mongo.extraEnv }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: mongo
|
||||
containerPort: 27017
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data/db
|
||||
- name: config
|
||||
mountPath: /data/configdb
|
||||
resources:
|
||||
{{- toYaml .Values.mongo.resources | nindent 12 }}
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "buildpath.fullname" . }}-mongo-config
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.mongo.dataVolume.accessMode | quote }}
|
||||
storageClassName: {{ .Values.mongo.dataVolume.storageClassName | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.mongo.dataVolume.size | quote }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user