From 5ec2ad2ed64a294bc11b5f8797f3fc996332bac4 Mon Sep 17 00:00:00 2001 From: Roman Zavodskikh Date: Mon, 4 Mar 2024 17:10:51 +0100 Subject: [PATCH] Add a flag for canary-only skipper-ingress deployment Signed-off-by: Roman Zavodskikh --- cluster/manifests/deletions.yaml | 11 ++++++++++- cluster/manifests/skipper/deployment.yaml | 4 +++- cluster/manifests/skipper/hpa.yaml | 4 +++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/cluster/manifests/deletions.yaml b/cluster/manifests/deletions.yaml index 8b3b41a946..7a07a05704 100644 --- a/cluster/manifests/deletions.yaml +++ b/cluster/manifests/deletions.yaml @@ -59,7 +59,16 @@ post_apply: kind: ClusterRoleBinding {{- end }} -{{ if ne .Cluster.ConfigItems.skipper_ingress_canary_enabled "true" }} +{{ if eq .Cluster.ConfigItems.skipper_ingress_canary_enabled "exclusive" }} +- name: skipper-ingress + namespace: kube-system + kind: Deployment +- name: skipper-ingress + namespace: kube-system + kind: HorizontalPodAutoscaler +{{ end }} + +{{ if and (ne .Cluster.ConfigItems.skipper_ingress_canary_enabled "true") (ne .Cluster.ConfigItems.skipper_ingress_canary_enabled "exclusive") }} - name: skipper-ingress-canary namespace: kube-system kind: Deployment diff --git a/cluster/manifests/skipper/deployment.yaml b/cluster/manifests/skipper/deployment.yaml index 2fffe51788..28a5fbbc1e 100644 --- a/cluster/manifests/skipper/deployment.yaml +++ b/cluster/manifests/skipper/deployment.yaml @@ -4,6 +4,7 @@ {{/* Optional canary arguments separated by "[cf724afc]" to allow whitespaces, e.g. "-foo=has a whitespace[cf724afc]-baz=qux" */}} {{ $canary_args := "" }} +{{ if (ne .Cluster.ConfigItems.skipper_ingress_canary_enabled "exclusive") }} {{ template "skipper-ingress" dict "name" "skipper-ingress" "internal_version" $internal_version @@ -11,8 +12,9 @@ "Cluster" .Cluster "Values" .Values }} +{{ end }} -{{ if eq .Cluster.ConfigItems.skipper_ingress_canary_enabled "true" }} +{{ if or (eq .Cluster.ConfigItems.skipper_ingress_canary_enabled "true") (eq .Cluster.ConfigItems.skipper_ingress_canary_enabled "exclusive") }} {{ template "skipper-ingress" dict "name" "skipper-ingress-canary" "internal_version" $canary_internal_version diff --git a/cluster/manifests/skipper/hpa.yaml b/cluster/manifests/skipper/hpa.yaml index 5a393701e9..1e63cd647c 100644 --- a/cluster/manifests/skipper/hpa.yaml +++ b/cluster/manifests/skipper/hpa.yaml @@ -1,11 +1,12 @@ {{ $min_replicas := .Cluster.ConfigItems.skipper_ingress_min_replicas }} {{ if and - (eq .Cluster.ConfigItems.skipper_ingress_canary_enabled "true") + (or (eq .Cluster.ConfigItems.skipper_ingress_canary_enabled "true") (eq .Cluster.ConfigItems.skipper_ingress_canary_enabled "exclusive")) (ne .Cluster.ConfigItems.skipper_ingress_min_replicas "0") (ne .Cluster.ConfigItems.skipper_ingress_min_replicas "1") }} {{ $min_replicas = sumQuantities .Cluster.ConfigItems.skipper_ingress_min_replicas "-1" }} {{ end }} +{{ if ne .Cluster.ConfigItems.skipper_ingress_canary_enabled "exclusive" }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: @@ -71,3 +72,4 @@ spec: value: {{ .Cluster.ConfigItems.skipper_ingress_hpa_scale_up_max_perc }} selectPolicy: Max stabilizationWindowSeconds: 0 +{{ end }}