Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZENKO-782 ft: add replication factor to cloud server #229

Merged
merged 1 commit into from
Jul 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions charts/cloudserver/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ Create the default mongodb replicaset hosts string
{{- $release := .Release.Name -}}
{{- range $v := until $count }}{{ $release }}-mongodb-replicaset-{{ $v }}.{{ $release }}-mongodb-replicaset:27017{{ if ne $v (sub $count 1) }},{{- end -}}{{- end -}}
{{- end -}}

{{/*
Increases the number of cloudserver replicas by the replicaFactor value
*/}}
{{- define "cloudserver.replicaFactor" -}}
{{- $factor := mul .Values.replicaFactor .Values.replicaCount -}}
{{- printf "%d" $factor }}
{{- end -}}

2 changes: 1 addition & 1 deletion charts/cloudserver/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
replicas: {{ template "cloudserver.replicaFactor" . }}
selector:
matchLabels:
app: {{ template "cloudserver.name" . }}
Expand Down
11 changes: 6 additions & 5 deletions charts/cloudserver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ mongodb:
replicaSet: rs0
replicas: 3

# When Orbit is enabled, there will be an additional fully stateless replica
# added which serves as the "manager" for reporting metrics. For example,
# with a "replicaCount: 2" and Orbit management enabled, there would be a
# total of 3 pods deployed (2 worker replicas + 1 manager).
replicaCount: 2
# Replication factor will deploy n * replicaCount for deployments that need
# not only HA but high performance and throughput. When Orbit is enabled, there
# will be an additional stateless single manager pod deployed which serves as the
# "manager" for reporting metrics. This manager pod currently cannot scale replicas.
replicaCount: 3
replicaFactor: 1

image:
repository: zenko/cloudserver
Expand Down
2 changes: 2 additions & 0 deletions charts/zenko/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ ingress:
# - zenko.example.com

cloudserver:
replicaCount: *nodeCount
replicaFactor: 10
mongodb:
replicas: *nodeCount
orbit:
Expand Down