Skip to content

Commit

Permalink
Add a flag for canary-only skipper-ingress deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Zavodskikh <[email protected]>
  • Loading branch information
Roman Zavodskikh committed Mar 4, 2024
1 parent 67d9128 commit 0a30063
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion cluster/manifests/deletions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion cluster/manifests/skipper/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
{{/* 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

"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
Expand Down
2 changes: 2 additions & 0 deletions cluster/manifests/skipper/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{{ $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:
Expand Down Expand Up @@ -71,3 +72,4 @@ spec:
value: {{ .Cluster.ConfigItems.skipper_ingress_hpa_scale_up_max_perc }}
selectPolicy: Max
stabilizationWindowSeconds: 0
{{ end }}

0 comments on commit 0a30063

Please sign in to comment.