Skip to content

Commit

Permalink
argo rollout add active metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mqxter committed Sep 12, 2024
1 parent d4b8add commit 280963b
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
{{- toYaml .Values.hp.labels | nindent 4 }}
spec:
revisionHistoryLimit: {{ .Values.revisionHistoryLimit | default 2 }}
{{- if .Values.argoRollouts }}
{{- if .Values.argoRollouts.enabled }}
replicas: 0
{{- else if not .Values.web.autoscaling.enabled }}
replicas: {{ .Values.hp.replicaCount }}
Expand Down
2 changes: 1 addition & 1 deletion common/unified-chart/templates/high-priority/hp-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- include "keda.annotations" . | nindent 4 }}
spec:
scaleTargetRef:
{{- if .Values.argoRollouts }}
{{- if .Values.argoRollouts.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Rollout
name: {{ include "hp.name" . }}
Expand Down
5 changes: 5 additions & 0 deletions common/unified-chart/templates/high-priority/hp-pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ spec:
selector:
matchLabels:
{{- include "hp.selector.labels" . | nindent 6 }}
{{- if .Values.argoRollouts.enabled }}
{{- with .Values.argoRollouts.activeMetadata }}
{{- toYaml .labels | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
6 changes: 5 additions & 1 deletion common/unified-chart/templates/high-priority/hp-rollout.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.hp.enabled }}
{{- if .Values.argoRollouts }}
{{- if .Values.argoRollouts.enabled }}
---
apiVersion: argoproj.io/v1alpha1
kind: Rollout
Expand All @@ -16,6 +16,10 @@ spec:
{{- include "hp.selector.labels" . | nindent 6 }}
strategy:
blueGreen:
{{- with .Values.argoRollouts.activeMetadata }}
activeMetadata:
{{- toYaml . | nindent 8 }}
{{- end }}
activeService: {{ include "hp.name" . }}
autoPromotionEnabled: true
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
{{- include "hp.labels" $top | nindent 4 }}
spec:
scaleTargetRef:
{{- if $values.argoRollouts }}
{{- if $values.argoRollouts.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Rollout
name: {{ include "hp.name" $top }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $values := .Values -}}
{{- if $values.hp.enabled }}
{{- if $values.argoRollouts }}
{{- if $values.argoRollouts.enabled }}
---
apiVersion: v1
kind: Service
Expand Down
2 changes: 1 addition & 1 deletion common/unified-chart/templates/web/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
{{- include "web.labels" . | nindent 4 }}
spec:
revisionHistoryLimit: {{ .Values.revisionHistoryLimit | default 2 }}
{{- if .Values.argoRollouts }}
{{- if .Values.argoRollouts.enabled }}
replicas: 0
{{- else if not .Values.web.autoscaling.enabled }}
replicas: {{ .Values.web.replicaCount }}
Expand Down
2 changes: 1 addition & 1 deletion common/unified-chart/templates/web/web-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
{{- end }}
spec:
scaleTargetRef:
{{- if .Values.argoRollouts }}
{{- if .Values.argoRollouts.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Rollout
name: {{ include "web.name" . }}
Expand Down
5 changes: 5 additions & 0 deletions common/unified-chart/templates/web/web-pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ spec:
selector:
matchLabels:
{{- include "web.selector.labels" . | nindent 6 }}
{{- if .Values.argoRollouts.enabled }}
{{- with .Values.argoRollouts.activeMetadata }}
{{- toYaml .labels | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
6 changes: 5 additions & 1 deletion common/unified-chart/templates/web/web-rollout.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.web.enabled -}}
{{- if .Values.argoRollouts }}
{{- if .Values.argoRollouts.enabled }}
---
apiVersion: argoproj.io/v1alpha1
kind: Rollout
Expand All @@ -16,6 +16,10 @@ spec:
{{- include "web.selector.labels" . | nindent 6 }}
strategy:
blueGreen:
{{- with .Values.argoRollouts.activeMetadata }}
activeMetadata:
{{- toYaml . | nindent 8 }}
{{- end }}
activeService: {{ include "web.name" . }}
autoPromotionEnabled: true
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion common/unified-chart/templates/web/web-scaled-object.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
{{- include "web.labels" $top | nindent 4 }}
spec:
scaleTargetRef:
{{- if $values.argoRollouts }}
{{- if $values.argoRollouts.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Rollout
name: {{ include "web.name" $top }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{- include "worker.labels" . | nindent 4 }}
spec:
{{- if .Values.argoRollouts }}
{{- if .Values.argoRollouts.enabled }}
replicas: 0
{{- else if not .Values.web.autoscaling.enabled }}
replicas: {{ .Values.worker.replicaCount }}
Expand Down
2 changes: 1 addition & 1 deletion common/unified-chart/templates/worker/worker-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
{{- end }}
spec:
scaleTargetRef:
{{- if .Values.argoRollouts }}
{{- if .Values.argoRollouts.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Rollout
name: {{ include "worker.name" . }}
Expand Down
6 changes: 5 additions & 1 deletion common/unified-chart/templates/worker/worker-rollout.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.worker.enabled }}
{{- if .Values.argoRollouts }}
{{- if .Values.argoRollouts.enabled }}
---
apiVersion: argoproj.io/v1alpha1
kind: Rollout
Expand All @@ -16,6 +16,10 @@ spec:
{{- include "worker.selector.labels" . | nindent 6 }}
strategy:
blueGreen:
{{- with .Values.argoRollouts.activeMetadata }}
activeMetadata:
{{- toYaml . | nindent 8 }}
{{- end }}
activeService: {{ include "worker.name" . }}
autoPromotionEnabled: true
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
{{- include "worker.labels" $top | nindent 4 }}
spec:
scaleTargetRef:
{{- if $values.argoRollouts }}
{{- if $values.argoRollouts.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Rollout
name: {{ include "worker.name" $top }}
Expand Down
6 changes: 5 additions & 1 deletion common/unified-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
# CAUTION this will change name of all manifests
nameSuffix: v2

argoRollouts: true
argoRollouts:
enabled: true
activeMetadata:
labels:
role: active

image:
repository:
Expand Down

0 comments on commit 280963b

Please sign in to comment.