working commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
{{- define "mstore.imagePath" -}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.imagePath -}}
|
||||
{{- .Values.global.imagePath -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- .Values.main.image.path -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,10 @@
|
||||
{{- define "mstore.servicePort" -}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.mstorePort -}}
|
||||
{{- .Values.global.mstorePort -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- .Values.main.service.port -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{{- define "mstore.storageClass" -}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- .Values.main.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{{- define "mstore.storageSize" -}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.mstoreStorageSize -}}
|
||||
{{- .Values.global.mstoreStorageSize -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- .Values.main.storageSize -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
{{- define "mstore.username" -}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.mstoreUsername -}}
|
||||
{{- .Values.global.mstoreUsername -}}
|
||||
{{- else -}}
|
||||
{{- fail "Istore username is empty, fill it in global values.yaml !" -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.main.auth.username -}}
|
||||
{{- .Values.main.auth.username -}}
|
||||
{{- else -}}
|
||||
{{- fail "Istore username is empty, fill it in values.yaml !" -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "mstore.password" -}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.mstoreUserpass -}}
|
||||
{{- .Values.global.mstoreUserpass -}}
|
||||
{{- else -}}
|
||||
{{- fail "Istore password is empty, fill it in global values.yaml !"}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.main.auth.password -}}
|
||||
{{- .Values.main.auth.password -}}
|
||||
{{- else -}}
|
||||
{{- fail "Istore password is empty, fill it in values.yaml !"}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
name: mstored-config
|
||||
data:
|
||||
mstored.yaml: |-
|
||||
service:
|
||||
address: 0.0.0.0
|
||||
port: {{ include "mstore.servicePort" . }}
|
||||
asDaemon: false
|
||||
@@ -0,0 +1,37 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mstore
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mstore
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mstore
|
||||
spec:
|
||||
restartPolicy: Always
|
||||
containers:
|
||||
- securityContext:
|
||||
privileged: true
|
||||
image: {{ include "mstore.imagePath" . }}/{{ .Values.main.image.name }}:{{ .Values.main.image.tag }}
|
||||
imagePullPolicy: {{ .Values.main.image.imagePullPolicy }}
|
||||
name: mstore
|
||||
ports:
|
||||
- containerPort: {{ include "mstore.servicePort" . }}
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /app/etc/mstore
|
||||
- name: db-volume
|
||||
mountPath: /var/data
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: mstored-config
|
||||
- name: db-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: mstore-data
|
||||
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mstore
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: mstore
|
||||
ports:
|
||||
- port: {{ include "mstore.servicePort" . }}
|
||||
protocol: TCP
|
||||
targetPort: {{ include "mstore.servicePort" . }}
|
||||
name: api
|
||||
type: {{ .Values.main.service.type }}
|
||||
@@ -0,0 +1,12 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: mstore-data
|
||||
spec:
|
||||
storageClassName: {{ include "mstore.storageClass" . }}
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ include "mstore.storageSize" . }}
|
||||
Reference in New Issue
Block a user