diff --git a/charts/modjo-microservice/templates/preview.ingress.yaml b/charts/modjo-microservice/templates/preview.ingress.yaml index a44812b..b89d0fb 100644 --- a/charts/modjo-microservice/templates/preview.ingress.yaml +++ b/charts/modjo-microservice/templates/preview.ingress.yaml @@ -1,4 +1,4 @@ -{{- if and (eq .Values.kind "Rollout") (eq .Values.rollout.strategy.type "BlueGreen") .Values.preview.ingress.enabled -}} +{{- if and .Values.rollout.enabled (eq .Values.rollout.strategy.type "BlueGreen") .Values.preview.ingress.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/modjo-microservice/templates/preview.service.yaml b/charts/modjo-microservice/templates/preview.service.yaml index 4e7c049..de318c0 100644 --- a/charts/modjo-microservice/templates/preview.service.yaml +++ b/charts/modjo-microservice/templates/preview.service.yaml @@ -1,4 +1,4 @@ -{{- if and (eq .Values.kind "Rollout") .Values.exposed .Values.service.enabled (eq .Values.rollout.strategy.type "BlueGreen") -}} +{{- if and .Values.rollout.enabled .Values.exposed .Values.service.enabled (eq .Values.rollout.strategy.type "BlueGreen") -}} apiVersion: v1 kind: Service metadata: diff --git a/charts/modjo-microservice/templates/rollout-deployment.yaml b/charts/modjo-microservice/templates/rollout-deployment.yaml index f4a4eee..e66341d 100644 --- a/charts/modjo-microservice/templates/rollout-deployment.yaml +++ b/charts/modjo-microservice/templates/rollout-deployment.yaml @@ -1,5 +1,5 @@ -apiVersion: {{ eq .Values.kind "Rollout" | ternary "argoproj.io/v1alpha1" "apps/v1" }} -kind: {{ .Values.kind }} +apiVersion: {{ .Values.rollout.enabled | ternary "argoproj.io/v1alpha1" "apps/v1" }} +kind: {{ .Values.rollout.enabled | ternary "Rollout" "Deployment" }} metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} @@ -17,7 +17,7 @@ spec: selector: matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }} strategy: - {{- if eq .Values.kind "Rollout" }} + {{- if .Values.rollout.enabled }} {{- if eq .Values.rollout.strategy.type "BlueGreen" }} blueGreen: activeService: {{ default (include "common.names.fullname" .) .Values.rollout.strategy.blueGreen.activeService | quote }} diff --git a/charts/modjo-microservice/values.yaml b/charts/modjo-microservice/values.yaml index 97c9a06..8de517f 100644 --- a/charts/modjo-microservice/values.yaml +++ b/charts/modjo-microservice/values.yaml @@ -1,7 +1,6 @@ fullnameOverride: "" nameOverride: "" -kind: Rollout exposed: true image: @@ -104,6 +103,7 @@ deployment: strategy: {} rollout: + enabled: false strategy: type: "BlueGreen" blueGreen: