Update Deployment and statefulSet
This commit is contained in:
parent
fcb45ec331
commit
d2f602bf79
@ -1,33 +1,38 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-oc-catalog
|
||||
name: oc-catalog
|
||||
labels:
|
||||
app: oc-catalog
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
serviceName: "{{ .Release.Name }}-oc-catalog"
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: oc-catalog
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: oc-catalog
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: oc-catalog
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
- containerPort: {{ .Values.service.targetPort }}
|
||||
env:
|
||||
- name: MONGO_DATABASE
|
||||
value: "DC_myDC"
|
||||
value: {{ .Values.mongo.database }}
|
||||
- name: MONGO_URI
|
||||
value: "mongodb://mongo:27017"
|
||||
value: {{ .Values.mongo.uri }}
|
||||
imagePullSecrets:
|
||||
{{- if .Values.imagePullSecrets }}
|
||||
{{- range .Values.imagePullSecrets }}
|
||||
{{- range .Values.imagePullSecrets }}
|
||||
- name: {{ .name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
@ -1,12 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-oc-catalog
|
||||
name: oc-catalog
|
||||
labels:
|
||||
app: oc-catalog
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
selector:
|
||||
app: {{ .Chart.Name }}
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: {{ .Values.service.targetPort }}
|
||||
type: {{ .Values.service.type }}
|
||||
selector:
|
||||
app: oc-catalog
|
||||
release: {{ .Release.Name }}
|
@ -16,4 +16,3 @@ mongo:
|
||||
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
|
||||
|
34
helm/oc-mongo-express/templates/deployment.yaml
Normal file
34
helm/oc-mongo-express/templates/deployment.yaml
Normal file
@ -0,0 +1,34 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: oc-catalog
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ include "mongo-express.name" . }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ include "mongo-express.name" . }}
|
||||
spec:
|
||||
containers:
|
||||
- name: mongo-express
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
ports:
|
||||
- containerPort: {{ .Values.service.port }}
|
||||
env:
|
||||
- name: ME_CONFIG_BASICAUTH_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.env.secretName }}
|
||||
key: {{ .Values.env.usernameSecret }}
|
||||
- name: ME_CONFIG_BASICAUTH_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.env.secretName }}
|
||||
key: {{ .Values.env.passwordSecret }}
|
||||
imagePullSecrets:
|
||||
{{- if .Values.imagePullSecrets }}
|
||||
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
|
||||
{{- end }}
|
@ -16,3 +16,4 @@ imagePullSecrets:
|
||||
secret:
|
||||
usernameKey: mongo-username
|
||||
passwordKey: mongo-password
|
||||
secretName: mongo-secret
|
||||
|
@ -1,10 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .Values.persistence.name }}
|
||||
name: {{ .Values.mongo.pvcName }}
|
||||
labels:
|
||||
app: mongo
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size }}
|
||||
{{- if .Values.persistence.storageClass }}
|
||||
storageClassName: {{ .Values.persistence.storageClass }}
|
||||
{{- end }}
|
||||
|
@ -2,7 +2,10 @@ apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-mongo-secret
|
||||
labels:
|
||||
app: mongo
|
||||
release: {{ .Release.Name }}
|
||||
type: Opaque
|
||||
data:
|
||||
username: {{ .Values.secret.username }}
|
||||
password: {{ .Values.secret.password }}
|
||||
username: {{ .Values.secret.username | b64enc }}
|
||||
password: {{ .Values.secret.password | b64enc }}
|
@ -2,10 +2,12 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mongo
|
||||
labels:
|
||||
app: mongo
|
||||
spec:
|
||||
selector:
|
||||
app: mongo
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: {{ .Values.service.port }}
|
||||
targetPort: {{ .Values.mongo.containerPort }}
|
||||
|
@ -1,11 +1,11 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-mongo
|
||||
name: mongo
|
||||
labels:
|
||||
app: mongo
|
||||
spec:
|
||||
serviceName: "{{ .Release.Name }}-mongo"
|
||||
serviceName: "mongo"
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
|
@ -13,7 +13,12 @@ persistence:
|
||||
enabled: true
|
||||
accessMode: ReadWriteOnce
|
||||
size: 1Gi
|
||||
storageClass: ""
|
||||
|
||||
secret:
|
||||
username: dGVzdA== # base64 encoding of 'test'
|
||||
password: dGVzdA== # base64 encoding of 'test'
|
||||
|
||||
mongo:
|
||||
containerPort: 27017
|
||||
pvcName: mongo-pvc-helm
|
Loading…
Reference in New Issue
Block a user