Skip to content

Commit

Permalink
skipper: enable manual canary deployment
Browse files Browse the repository at this point in the history
requires dict function zalando-incubator/cluster-lifecycle-manager#711

Signed-off-by: Alexander Yastrebov <[email protected]>
  • Loading branch information
AlexanderYastrebov committed Nov 29, 2023
1 parent 7391b34 commit 10b076d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cluster/config-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ skipper_ingress_min_replicas: "2"
{{end}}
skipper_ingress_cpu: "1000m"
skipper_ingress_memory: "1500Mi"

skipper_ingress_canary_internal_version: ""

# When set to true (and dedicated node pool for skipper is also true) the
# daemonset overhead will be subtracted from the cpu settings such
# that skipper will perfectly fit on the node.
Expand Down
6 changes: 6 additions & 0 deletions cluster/manifests/deletions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ post_apply:
kind: ClusterRoleBinding
{{- end }}

{{ if not .Cluster.ConfigItems.skipper_ingress_canary_internal_version }}
- name: skipper-ingress-canary
namespace: kube-system
kind: Deployment
{{ end }}

{{ if eq .Cluster.ConfigItems.skipper_routesrv_enabled "false" }}
- name: skipper-ingress-routesrv
namespace: kube-system
Expand Down
26 changes: 22 additions & 4 deletions cluster/manifests/skipper/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
{{ $internal_version := "v0.18.42-691" }}
{{ $version := index (split $internal_version "-") 0 }}

{{ template "skipper-ingress" dict
"name" "skipper-ingress"
"internal_version" $internal_version
}}

{{ if .ConfigItems.skipper_ingress_canary_internal_version }}
{{ template "skipper-ingress" dict
"name" "skipper-ingress-canary"
"internal_version" .ConfigItems.skipper_ingress_canary_internal_version
"replicas" 1
{{ end }}

{{ define "skipper-ingress" }}
---
{{ $version := index (split .internal_version "-") 0 }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: skipper-ingress
name: "{{ .name }}"
namespace: kube-system
labels:
application: skipper-ingress
version: {{ $version }}
component: ingress
spec:
{{ if index . "replicas" }}
replicas: {{ .replicas }}
{{ end }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
deployment: skipper-ingress
deployment: "{{ .name }}"
template:
metadata:
labels:
deployment: skipper-ingress
deployment: "{{ .name }}"
application: skipper-ingress
version: {{ $version }}
component: ingress
Expand Down Expand Up @@ -397,6 +414,7 @@ spec:
key: dedicated
value: skipper-ingress
{{ end }}
{{ end }}

{{ if ne .ConfigItems.skipper_routesrv_enabled "false" }}
---
Expand Down

0 comments on commit 10b076d

Please sign in to comment.