Skip to content

Commit

Permalink
feat(*): use the external mongo hosts value (#22)
Browse files Browse the repository at this point in the history
* feat(*): use the external mongo hosts value

* chore(*): update version
  • Loading branch information
Xinzhao Xu authored Jan 15, 2021
1 parent 0a2200f commit e659dda
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions manifests/infra-mongo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
appVersion: v0.1.0
appVersion: v0.1.1
description: A helm chart for mongo
name: infra-mongo
type: application
version: v0.1.0
version: v0.1.1
2 changes: 1 addition & 1 deletion manifests/infra-mongo/templates/pv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- range $index, $value := tuple "kube-master-1" "kube-master-2" "kube-master-3" }}
{{- range $index, $value := .Values.platformConfig.mongoHosts }}
---
apiVersion: v1
kind: PersistentVolume
Expand Down
6 changes: 3 additions & 3 deletions manifests/infra-mongo/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{{- range tuple "0" "1" "2" }}
{{- range $index, $value := .Values.platformConfig.mongoHosts }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: infra-mongo-infra-mongo-{{ . }}
name: infra-mongo-infra-mongo-{{ $index }}
namespace: {{ $.Release.Namespace | quote }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
volumeName: infra-mongo-infra-mongo-{{ . }}
volumeName: infra-mongo-infra-mongo-{{ $index }}
{{- end }}
2 changes: 1 addition & 1 deletion manifests/infra-mongo/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
serviceName: {{ .Values.serviceName | quote }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
replicas: {{ default 1 .Values.replicaCount }}
replicas: {{ len .Values.platformConfig.mongoHosts }}
template:
metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }}
Expand Down
5 changes: 4 additions & 1 deletion manifests/infra-mongo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ platformConfig:
imageRepositoryLibrary: library
imageRepositoryRelease: release
imagePullPolicy: Always
mongoHosts:
- kube-master-1
- kube-master-2
- kube-master-3

image:
name: mongo
tag: 4.0.3

serverPort: 27017
priorityClassName: system-cluster-critical
replicaCount: 3
serviceName: mgo-cluster

persistence:
Expand Down

0 comments on commit e659dda

Please sign in to comment.