diff --git a/charts/app-mendix/Chart.yaml b/charts/app-mendix/Chart.yaml index 63104e8..1afd20e 100644 --- a/charts/app-mendix/Chart.yaml +++ b/charts/app-mendix/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: app-mendix -version: 2.3.0 +version: 3.0.0 description: Mendix Application Chart. icon: https://cinaq.github.io/helm-charts/icons/mendix-logo.png maintainers: diff --git a/charts/app-mendix/templates/autoscale.yaml b/charts/app-mendix/templates/autoscale.yaml index 17e6101..7ec6c04 100644 --- a/charts/app-mendix/templates/autoscale.yaml +++ b/charts/app-mendix/templates/autoscale.yaml @@ -9,8 +9,8 @@ metadata: spec: scaleTargetRef: apiVersion: apps/v1 - kind: Deployment - name: {{ template "app-mendix.fullname" . }}-slave + kind: StatefulSet + name: {{ template "app-mendix.fullname" . }} minReplicas: {{ .Values.autoscale.minSlaveReplicas }} maxReplicas: {{ .Values.autoscale.maxSlaveReplicas }} targetCPUUtilizationPercentage: {{ .Values.autoscale.targetCPUUtilizationPercentage }} diff --git a/charts/app-mendix/templates/deployment-slave.yaml b/charts/app-mendix/templates/deployment-slave.yaml deleted file mode 100644 index 7162949..0000000 --- a/charts/app-mendix/templates/deployment-slave.yaml +++ /dev/null @@ -1,145 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "app-mendix.fullname" . }}-slave - labels: - {{- include "app-mendix.labels" . | nindent 4 }} -spec: -{{- if .Values.autoscale.enabled }} - replicas: {{ .Values.autoscale.minSlaveReplicas }} -{{- else if (eq (int .Values.replicaCount) 0)}} - replicas: 0 -{{- else }} - replicas: {{ (sub (int .Values.replicaCount) 1) }} -{{- end }} - selector: - matchLabels: - {{- include "app-mendix.selectorLabels" . | nindent 6 }} - {{- if .Values.strategy.enabled }} - strategy: - type: {{ .Values.strategy.type }} - {{- if eq "RollingUpdate" .Values.strategy.type }} - rollingUpdate: - maxSurge: {{ .Values.strategy.rollingUpdate.maxSurge }} - maxUnavailable: {{ .Values.strategy.rollingUpdate.maxUnavailable }} - {{- end }} - {{- end }} - template: - metadata: - labels: - {{- include "app-mendix.labels" . | nindent 8 }} - {{- with .Values.annotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - containerPort: {{ .Values.service.internalPort }} - name: app - {{- if .Values.metrics.enabled }} - - containerPort: {{ add (int .Values.service.internalPort) 2 }} - name: metrics - - containerPort: 9273 - name: metrics-mendix - {{- end }} - env: - - name: NON_MENDIX_PUBLIC_CLOUD - value: "true" - - name: CF_INSTANCE_INDEX - value: "1" - - name: MXRUNTIME_Metrics_Registries - value: '[{"type": "prometheus", "settings": {"step": "5m"}}]' - - name: RUNTIME_LOGIN_METRICS_ENABLED - value: {{ .Values.metrics.runtimeLoginMetricsEnabled | quote }} - - name: TRENDS_FORWARDER_URL - value: {{ .Values.metrics.trendsForwarderUrl | quote }} - {{- if .Values.licenseId }} - - name: LICENSE_ID - value: {{ .Values.licenseId }} - {{- end }} - {{- if .Values.licenseKey }} - - name: LICENSE_KEY - value: {{ .Values.licenseKey }} - {{- end }} - {{- range .Values.env }} - - name: {{ .name | quote}} - value: {{ .value | quote}} - {{- end }} - {{- if .Values.secretName }} - envFrom: - - secretRef: - name: {{ .Values.secretName }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: - {{- if eq "httpGet" .Values.readinessProbe.type }} - httpGet: - path: {{ .Values.readinessProbe.httpGet.path }} - port: {{ .Values.readinessProbe.httpGet.port }} - {{- else if eq "exec" .Values.readinessProbe.type }} - exec: - command: - {{- range .Values.readinessProbe.exec.command }} - - {{ . }} - {{- end }} - {{- else if eq "tcpSocket" .Values.readinessProbe.type }} - tcpSocket: - port: {{ .Values.readinessProbe.tcpSocket.port }} - {{- end }} - initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} - failureThreshold: {{ .Values.readinessProbe.failureThreshold }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.readinessProbe.successThreshold }} - {{- end }} - {{- if .Values.livenessProbe.enabled }} - livenessProbe: - {{- if eq "httpGet" .Values.livenessProbe.type }} - httpGet: - path: {{ .Values.livenessProbe.httpGet.path }} - port: {{ .Values.livenessProbe.httpGet.port }} - {{- else if eq "exec" .Values.livenessProbe.type }} - exec: - command: - {{- range .Values.livenessProbe.exec.command }} - - {{ . }} - {{- end }} - {{- else if eq "tcpSocket" .Values.livenessProbe.type }} - tcpSocket: - port: {{ .Values.livenessProbe.tcpSocket.port }} - {{- end }} - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - failureThreshold: {{ .Values.livenessProbe.failureThreshold }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - {{- end }} - {{- if .Values.lifecycle.prestop.enabled }} - lifecycle: - preStop: - exec: - command: [{{ .Values.lifecycle.prestop.command }}] - {{- end }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/charts/app-mendix/templates/deployment-leader.yaml b/charts/app-mendix/templates/statefulset.yaml similarity index 94% rename from charts/app-mendix/templates/deployment-leader.yaml rename to charts/app-mendix/templates/statefulset.yaml index 50f676c..ff9fd56 100644 --- a/charts/app-mendix/templates/deployment-leader.yaml +++ b/charts/app-mendix/templates/statefulset.yaml @@ -1,21 +1,19 @@ --- apiVersion: apps/v1 -kind: Deployment +kind: StatefulSet metadata: - name: {{ template "app-mendix.fullname" . }}-leader + name: {{ template "app-mendix.fullname" . }} labels: {{- include "app-mendix.labels" . | nindent 4 }} spec: -{{- if (ge (int .Values.replicaCount) 1) }} - replicas: 1 -{{- else }} - replicas: 0 -{{- end }} + replicas: {{ default 1 .Values.replicaCount }} selector: matchLabels: {{- include "app-mendix.selectorLabels" . | nindent 6 }} - strategy: - type: Recreate + updateStrategy: + type: RollingUpdate + serviceName: {{ template "app-mendix.fullname" . }} + minReadySeconds: 10 template: metadata: labels: @@ -41,8 +39,6 @@ spec: env: - name: NON_MENDIX_PUBLIC_CLOUD value: "true" - - name: CF_INSTANCE_INDEX - value: "0" - name: MXRUNTIME_Metrics_Registries value: '[{"type": "prometheus", "settings": {"step": "5m"}}]' - name: RUNTIME_LOGIN_METRICS_ENABLED diff --git a/charts/app-mendix/values.yaml b/charts/app-mendix/values.yaml index fa8ab35..f919c9e 100644 --- a/charts/app-mendix/values.yaml +++ b/charts/app-mendix/values.yaml @@ -1,7 +1,4 @@ -# initial replica, if: -# less than 1 => no leader or slaves -# equal 1 => 1 leader no slaves -# larger than 1 => 1 leader, rest slaves +# replicaCount: 2 | 1 leader, 1 slave replicaCount: 1 image: @@ -98,13 +95,6 @@ autoscale: maxSlaveReplicas: 3 targetCPUUtilizationPercentage: 70 -strategy: - enabled: false - type: RollingUpdate - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - readinessProbe: enabled: true type: httpGet