# _helpers.tpl
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "cloudserver.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "cloudserver.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create a default fully qualified name for the cloudserver data app.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "cloudserver.localdata.fullname" -}}
{{- if .Values.localdata.fullnameOverride -}}
{{- .Values.localdata.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- printf "%s-localdata" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s-localdata" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "cloudserver.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account to use for the api component
*/}}
{{- define "cloudserver.serviceAccountName.api" -}}
{{- if .Values.serviceAccounts.api.create -}}
    {{ default (include "cloudserver.fullname" .) .Values.serviceAccounts.api.name }}
{{- else -}}
    {{ default "default" .Values.serviceAccounts.api.name }}
{{- end -}}
{{- end -}}

{{/*
Create the name of the service account to use for the localdata component
*/}}
{{- define "cloudserver.serviceAccountName.localdata" -}}
{{- if .Values.serviceAccounts.localdata.create -}}
    {{ default (include "cloudserver.localdata.fullname" .) .Values.serviceAccounts.localdata.name }}
{{- else -}}
    {{ default "default" .Values.serviceAccounts.localdata.name }}
{{- end -}}
{{- end -}}

{{/*
Create a default fully qualified mongodb-replicaset name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "cloudserver.mongodb-replicaset.fullname" -}}
{{- $name := default "mongodb-replicaset" (index .Values "mongodb-replicaset" "nameOverride") -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the MongoDB URL. If MongoDB is installed as part of this chart, use k8s service discovery,
else use user-provided URL.
*/}}
{{- define "mongodb-replicaset.url" -}}
{{- if (index .Values "mongodb-replicaset" "enabled") -}}
{{- $count := (int (index .Values "mongodb-replicaset" "replicas")) -}}
{{- $release := .Release.Name -}}
{{- range $v := until $count }}{{ $release }}-mongodb-replicaset-{{ $v }}.{{ $release }}-mongodb-replicaset:27017{{ if ne $v (sub $count 1) }},{{- end -}}{{- end -}}
{{- else -}}
{{- index .Values "mongodb-replicaset" "url" -}}
{{- end -}}
{{- end -}}

{{/*
Create a default fully qualified redis-ha name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "cloudserver.redis-ha.fullname" -}}
{{- $name := default "redis-ha" (index .Values "redis-ha" "nameOverride") -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the Redis-HA URL. If Redis-HA is installed as part of this chart, use k8s service discovery,
else use user-provided URL.
*/}}
{{- define "redis-ha.url" -}}
{{- if (index .Values "redis-ha" "enabled") -}}
{{- $count := (int (index .Values "redis-ha" "replicas")) -}}
{{- $release := .Release.Name -}}
{{- range $v := until $count }}{{ $release }}-redis-ha-server-{{ $v }}.{{ $release }}-redis-ha:26379{{ if ne $v (sub $count 1) }},{{- end -}}{{- end -}}
{{- else -}}
{{- index .Values "redis-ha" "url" -}}
{{- end -}}
{{- end -}}
 # api-certificate.yaml
{{- if .Values.api.proxy.caCert -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "cloudserver.fullname" . }}-cacert
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: api
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
type: Opaque
data:
{{ (.Files.Glob "ca.crt").AsSecrets | indent 2 }}
{{- end -}}
 # api-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "cloudserver.fullname" . }}
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: api
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
data:
  locationConfig.json: |
    {{ toJson .Values.api.locationConstraints }}
 # api-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "cloudserver.fullname" . }}
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: api
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
{{- if not .Values.api.autoscaling.enabled }}
  replicas: {{ .Values.api.replicaCount }}
{{- end }}
  selector:
    matchLabels:
      app: {{ template "cloudserver.name" . }}
      component: api
      release: {{ .Release.Name }}
  template:
    metadata:
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/api-configmap.yaml") . | sha256sum }}
      labels:
        app: {{ template "cloudserver.name" . }}
        component: api
        release: {{ .Release.Name }}
    spec:
      serviceAccountName: {{ template "cloudserver.serviceAccountName.api" . }}
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          terminationMessagePolicy: FallbackToLogsOnError
          ports:
            - name: http
              containerPort: 8000
          env:
            - name: REMOTE_MANAGEMENT_DISABLE
              value: "1"
            {{- range $key, $value := .Values.env }}
            - name: {{ $key | upper | replace "." "_" }}
              value: {{ $value | quote }}
            {{- end }}
            - name: S3METADATA
              value: "mongodb"
            - name: MONGODB_HOSTS
              value: "{{ template "mongodb-replicaset.url" . }}"
            - name: MONGODB_RS
              value: "{{ default "rs0" (index .Values "mongodb-replicaset" "replicaSet") }}"
            - name: S3_LOCATION_FILE
              value: "/etc/config/locationConfig.json"
            - name: DATA_HOST
              value: {{ template "cloudserver.localdata.fullname" . }}
            - name: REDIS_HOST
              value: "{{- printf "%s-%s" .Release.Name "redis-ha" | trunc 63 | trimSuffix "-" -}}"
            - name: REDIS_PORT
              value: "6379"
            - name: REDIS_SENTINELS
              value: "{{ template "redis-ha.url" . }}"
            - name: REDIS_HA_NAME
              value: "{{ index .Values "redis-ha" "redis" "masterGroupName" }}"
            - name: LOG_LEVEL
              value: {{ .Values.api.logLevel }}
            - name: ENDPOINT
              value: "{{ template "cloudserver.fullname" . }},{{ .Values.api.endpoint }}"
            - name: HEALTHCHECKS_ALLOWFROM
              value: "0.0.0.0/0"
            {{- if .Values.api.proxy.http }}
            - name: http_proxy
              value: "{{ .Values.api.proxy.http }}"
            - name: HTTP_PROXY
              value: "{{ .Values.api.proxy.http }}"
            - name: https_proxy
              value: "{{- if .Values.api.proxy.https }}{{ .Values.api.proxy.https }}{{- else }}{{ .Values.api.proxy.http }}{{- end }}"
            - name: HTTPS_PROXY
              value: "{{- if .Values.api.proxy.https }}{{ .Values.api.proxy.https }}{{- else }}{{ .Values.api.proxy.http }}{{- end }}"
            {{- else if .Values.api.proxy.https }}
            - name: https_proxy
              value: "{{ .Values.api.proxy.https }}"
            - name: HTTPS_PROXY
              value: "{{ .Values.api.proxy.https }}"
            {{- end }}
            {{- if .Values.api.proxy.caCert }}
            - name: NODE_EXTRA_CA_CERTS
              value: "/ssl/ca.crt"
            {{- end }}
            {{- if .Values.api.proxy.no_proxy }}
            - name: no_proxy
              value: "{{ .Values.api.proxy.no_proxy }}"
            - name: NO_PROXY
              value: "{{ .Values.api.proxy.no_proxy }}"
            {{- end }}
            - name: SCALITY_ACCESS_KEY_ID
              valueFrom:
                secretKeyRef:
                  name: {{ template "cloudserver.fullname" . }}
                  key: accessKey
            - name: SCALITY_SECRET_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  name: {{ template "cloudserver.fullname" . }}
                  key: secretKey
          args: ['npm', 'run', 'start_s3server']
          livenessProbe:
            httpGet:
              path: /_/healthcheck
              port: http
            initialDelaySeconds: 60
          volumeMounts:
            - name: location-config
              mountPath: /etc/config
            {{- if .Values.api.proxy.caCert }}
            - name: proxy-cert
              mountPath: "/ssl"
              readOnly: true
            {{- end }}
          resources:
{{ toYaml .Values.api.resources | indent 12 }}
    {{- with .Values.api.nodeSelector }}
      nodeSelector:
{{ toYaml . | indent 8 }}
    {{- end }}
{{- if .Values.api.affinity }}
      affinity:
{{ toYaml .Values.api.affinity | indent 8 }}
    {{- end }}
    {{- with .Values.api.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
    {{- end }}
      volumes:
        - name: location-config
          configMap:
            name: {{ template "cloudserver.fullname" . }}
        {{- if .Values.api.proxy.caCert }}
        - name: proxy-cert
          secret:
            secretName: {{ template "cloudserver.fullname" . }}-cacert
        {{- end }}
 # api-hpa.yaml
{{- if .Values.api.autoscaling.enabled -}}
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: {{ template "cloudserver.fullname" . }}
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: api
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: {{ template "cloudserver.fullname" . }}
{{ toYaml .Values.api.autoscaling.config | indent 2 }}
{{- end -}}
 # api-ingress.yaml
{{- if .Values.api.ingress.enabled -}}
{{- $fullName := include "cloudserver.fullname" . -}}
{{- $servicePort := .Values.api.service.port -}}
{{- $ingressPath := .Values.api.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: {{ $fullName }}
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: api
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
{{- with .Values.api.ingress.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.api.ingress.tls }}
  tls:
  {{- range .Values.api.ingress.tls }}
    - hosts:
      {{- range .hosts }}
        - {{ . }}
      {{- end }}
      secretName: {{ .secretName }}
  {{- end }}
{{- end }}
  rules:
  {{- range .Values.api.ingress.hosts }}
    - host: {{ . }}
      http:
        paths:
          - path: {{ $ingressPath }}
            backend:
              serviceName: {{ $fullName }}
              servicePort: http
  {{- end }}
{{- end }}
 # api-secrets.yaml
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "cloudserver.fullname" . }}
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: api
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
type: Opaque
data:
  accessKey: {{ .Values.api.credentials.accessKey | b64enc }}
  secretKey: {{ .Values.api.credentials.secretKey | b64enc }}
 # api-service.yaml
apiVersion: v1
kind: Service
metadata:
  {{- if .Values.api.service.annotations }}
  annotations:
{{ toYaml .Values.api.service.annotations | indent 4 }}
  {{- end }}
  name: {{ template "cloudserver.fullname" . }}
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: api
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
spec:
  type: {{ .Values.api.service.type }}
  ports:
    - port: {{ .Values.api.service.port }}
      targetPort: http
      protocol: TCP
      name: http
  selector:
    app: {{ template "cloudserver.name" . }}
    component: api
    release: {{ .Release.Name }}
 # api-serviceaccount.yaml
{{- if .Values.serviceAccounts.localdata.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: api
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  name: {{ template "cloudserver.serviceAccountName.api" . }}
{{- end }}
 # localdata-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "cloudserver.localdata.fullname" . }}
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: localdata
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
spec:
  replicas: {{ .Values.localdata.replicaCount }}
  selector:
    matchLabels:
      app: {{ template "cloudserver.name" . }}
      component: localdata
      release: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app: {{ template "cloudserver.name" . }}
        component: localdata
        release: {{ .Release.Name }}
    spec:
      serviceAccountName: {{ template "cloudserver.serviceAccountName.localdata" . }}
      initContainers:
        - name: {{ .Chart.Name }}-localdata-init
          image: busybox
          command: ['sh', '-x', '-c', 'if ! test -d /data/3511; then for i in `seq 1 3511`; do mkdir -p /data/$i; done; fi']
          volumeMounts:
            - name: persistent-storage
              mountPath: /data
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - name: localdata
              containerPort: 9991
          args: ['npm', 'run', 'start_dataserver']
          volumeMounts:
            - name: persistent-storage
              mountPath: /data
          env:
            - name: S3DATAPATH
              value: /data
            - name: LISTEN_ADDR
              value: "0.0.0.0"
            - name: HEALTHCHECKS_ALLOWFROM
              value: "0.0.0.0/0"
          livenessProbe:
            tcpSocket:
              port: localdata
            initialDelaySeconds: 5
          readinessProbe:
            tcpSocket:
              port: localdata
            initialDelaySeconds: 5
          resources:
{{ toYaml .Values.localdata.resources | indent 12 }}
    {{- if .Values.localdata.nodeSelector }}
      nodeSelector:
{{ toYaml .Values.localdata.nodeSelector | indent 8 }}
    {{- end }}
      volumes:
        - name: persistent-storage
      {{- if .Values.localdata.persistentVolume.enabled }}
          persistentVolumeClaim:
            claimName: {{ if .Values.localdata.persistentVolume.existingClaim }}{{ .Values.localdata.persistentVolume.existingClaim }}{{- else }}{{ template "cloudserver.localdata.fullname" . }}{{- end }}
      {{- else }}
          emptyDir: {}
      {{- end }}
 # localdata-pvc.yaml
{{- if .Values.localdata.persistentVolume.enabled -}}
{{- if not .Values.localdata.persistentVolume.existingClaim -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ template "cloudserver.localdata.fullname" . }}
  annotations:
    "helm.sh/resource-policy": keep
  {{- if .Values.localdata.persistentVolume.annotations }}
{{ toYaml .Values.localdata.persistentVolume.annotations | indent 4 }}
  {{- end }}
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: localdata
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
spec:
  accessModes:
{{- range .Values.localdata.persistentVolume.accessModes }}
    - {{ . | quote }}
{{- end }}
  resources:
    requests:
      storage: {{ .Values.localdata.persistentVolume.size | quote }}
{{- if .Values.localdata.persistentVolume.storageClass }}
{{- if (eq "-" .Values.localdata.persistentVolume.storageClass) }}
  storageClassName: ""
{{- else }}
  storageClassName: "{{ .Values.localdata.persistentVolume.storageClass }}"
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
 # localdata-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ template "cloudserver.localdata.fullname" . }}
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: localdata
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
spec:
  type: ClusterIP
  ports:
    - name: localdata
      port: 9991
      protocol: TCP
      targetPort: localdata
  selector:
    app: {{ template "cloudserver.name" . }}
    component: localdata
    release: {{ .Release.Name }}
 # localdata-serviceaccount.yaml
{{- if .Values.serviceAccounts.localdata.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    app: {{ template "cloudserver.name" . }}
    chart: {{ template "cloudserver.chart" . }}
    component: localdata
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  name: {{ template "cloudserver.serviceAccountName.localdata" . }}
{{- end }}
 # test-cloudserver.yaml
apiVersion: v1
kind: Pod
metadata:
  name: {{ template "cloudserver.fullname" . }}-test
  annotations:
    "helm.sh/hook": test-success
spec:
  containers:
  - name: {{ template "cloudserver.fullname" . }}-test
    imagePullPolicy: IfNotPresent
    image: "docker.io/mesosphere/aws-cli:1.14.5"
    command:
      - sh
      - -c
      - aws s3 --endpoint-url=http://{{ include "cloudserver.fullname" . }} --region=us-east-1 ls
    env:
      - name: AWS_ACCESS_KEY_ID
        valueFrom:
          secretKeyRef:
            name: {{ template "cloudserver.fullname" . }}
            key: accessKey
      - name: AWS_SECRET_ACCESS_KEY
        valueFrom:
          secretKeyRef:
            name: {{ template "cloudserver.fullname" . }}
            key: secretKey
  restartPolicy: Never

# ------------------------------------------------------------------------------
# Cloudserver:
# ------------------------------------------------------------------------------

## Define serviceAccount names to create or use. Defaults to component's fully
## qualified name.
##
serviceAccounts:
  api:
    create: true
    name: ""
  localdata:
    create: true
    name: ""

## Cloudserver image configuration
##
image:
  repository: zenko/cloudserver
  tag: 8.1.5
  pullPolicy: IfNotPresent

## Configuration for the cloudserver api component
##
api:
  replicaCount: 1

  ## Configure cloudserver 'location constraints' (cloud backends)
  ##
  locationConstraints:
    us-east-1:
      type: file
      objectId: us-east-1
      legacyAwsBehavior: true
      details: {}

  ## Specify cloudserver credentials
  ##
  credentials:
    accessKey: my-access-key
    secretKey: my-secret-key

  ## Specify log level (info, debug or trace)
  ##
  logLevel: info

  ## Specify additional environmental variables for the Deployment
  ##
  env: {}

  ## Set the following values appropriately when deploying behind a proxy
  ##
  proxy:
    ## HTTP proxy endpoint
    ##
    http: ""

    ## HTTPS proxy endpoint
    https: ""

    ## If true, add a CA certificate to the trusted certs. Helm will look
    ## for a file named 'ca.crt' at the root path of this chart
    caCert: false

    ## Specify any exceptions to proxification
    ##
    no_proxy: ""

  service:
    type: ClusterIP
    port: 80
    annotations: {}
      # prometheus.io/scrape: "true"
      # prometheus.io/port: "8000"
      # prometheus.io/path: "/_/monitoring/metrics"

  ## Comma-separated string of allowed virtual hosts for external access.
  ## This should match the ingress hosts
  ##
  endpoint: cloudserver.local

  ingress:
    enabled: false
    annotations: {}
      # kubernetes.io/ingress.class: nginx
      # kubernetes.io/tls-acme: "true"
    path: /
    # This must match 'endpoint', unless your client supports different
    # hostnames.
    hosts: []
      # - cloudserver.local
    tls: []
    #  - secretName: cloudserver-example-tls
    #    hosts:
    #      - cloudserver-example.local

  resources: {}
  #  limits:
  #    cpu: 100m
  #    memory: 128Mi
  #  requests:
  #    cpu: 100m
  #    memory: 128Mi

  ## Node labels for pod assignment
  ## ref: https://kubernetes.io/docs/user-guide/node-selection/
  ##
  nodeSelector: {}

  ## Tolerations for pod assignment
  ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
  ##
  tolerations: []

  ## Affinity for pod assignment
  ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
  ##
  affinity: {}

  ## Configure an horizontal pod autoscaler
  ##
  autoscaling:
    enabled: false
    config:
      minReplicas: 1
      maxReplicas: 16
      ## Note: when setting this, a `resources.request.cpu` is required. You
      ## likely want to set it to `1` or some lower value.
      ##
      targetCPUUtilizationPercentage: 80

## Configuration for the cloudserver localdata component
##
localdata:
  replicaCount: 1

  persistentVolume:
    enabled: true
    accessModes:
      - ReadWriteOnce
    annotations: {}
    existingClaim: ""
    size: 1Gi

  resources: {}
  #  limits:
  #    cpu: 100m
  #    memory: 128Mi
  #  requests:
  #    cpu: 100m
  #    memory: 128Mi

# ------------------------------------------------------------------------------
# MongoDB:
# ------------------------------------------------------------------------------

mongodb-replicaset:
  enabled: true
  replicas: 1
  replicaSetName: rs0
  securityContext:
    runAsUser: 1000
    fsGroup: 1000
    runAsNonRoot: true

# ------------------------------------------------------------------------------
# Redis:
# ------------------------------------------------------------------------------

redis-ha:
  enabled: true
  replicas: 1
  redis:
    masterGroupName: cloudserver
  affinity: []
