Skip to content

Commit

Permalink
Merge pull request #4940 from zalando-incubator/routesrv-three-state-…
Browse files Browse the repository at this point in the history
…config

ingress/routesrv: Makes skipper_routesrv_enabled a three state switch
  • Loading branch information
AlexanderYastrebov authored Jan 27, 2022
2 parents a388880 + d4f18a1 commit d9b3847
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions cluster/config-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ skipper_redis_write_timeout: "25ms"

skipper_cluster_ratelimit_max_group_shards: 1

#
# skipper routesrv settings
#
# skipper_routesrv_enabled is a three state switch:
# - "false" - routesrv deployment is removed, skipper uses own k8s dataclient
# - "pre" - routesrv is deployed, skipper uses own k8s dataclient
# - "exec" - routesrv is deployed, skipper uses routesrv
{{if eq .Cluster.Environment "production"}}
skipper_routesrv_enabled: "false"
skipper_routesrv_replicas: 3
Expand Down
2 changes: 1 addition & 1 deletion cluster/manifests/deletions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ post_apply:
kind: ClusterRoleBinding
{{- end }}

{{ if ne .Cluster.ConfigItems.skipper_routesrv_enabled "true" }}
{{ if eq .Cluster.ConfigItems.skipper_routesrv_enabled "false" }}
- name: skipper-ingress-routesrv
namespace: kube-system
kind: Deployment
Expand Down
12 changes: 6 additions & 6 deletions cluster/manifests/skipper/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
args:
- "run.sh"
- "skipper"
{{ if eq .ConfigItems.skipper_routesrv_enabled "true" }}
{{ if eq .ConfigItems.skipper_routesrv_enabled "exec" }}
- "-routes-urls=http://skipper-ingress-routesrv.kube-system.svc.cluster.local/routes"
- "-normalize-host"
{{ else }}
Expand All @@ -103,11 +103,11 @@ spec:
- "-address=:9999"
- "-wait-first-route-load"
- "-wait-for-healthcheck-interval={{ .Cluster.ConfigItems.skipper_wait_for_healthcheck_interval }}"
{{ if and (ne .ConfigItems.skipper_routesrv_enabled "true") (eq .ConfigItems.enable_skipper_eastwest "true")}}
{{ if and (ne .ConfigItems.skipper_routesrv_enabled "exec") (eq .ConfigItems.enable_skipper_eastwest "true")}}
- "-enable-kubernetes-east-west"
- "-kubernetes-east-west-domain=.ingress.cluster.local"
{{ end }}
{{ if and (ne .ConfigItems.skipper_routesrv_enabled "true") (eq .ConfigItems.enable_skipper_eastwest_range "true")}}
{{ if and (ne .ConfigItems.skipper_routesrv_enabled "exec") (eq .ConfigItems.enable_skipper_eastwest_range "true")}}
- "-kubernetes-east-west-range-domains=ingress.cluster.local"
- "-kubernetes-east-west-range-predicates=ClientIP(\"10.2.0.0/16\", \"{{ .Values.vpc_ipv4_cidr }}\")"
{{ end }}
Expand Down Expand Up @@ -135,7 +135,7 @@ spec:
- "-api-usage-monitoring-client-keys=https://identity.zalando.com/managed-id,sub"
- "-api-usage-monitoring-default-client-tracking-pattern=services[.].*"
{{ end }}
{{ if and (ne .ConfigItems.skipper_routesrv_enabled "true") (eq .ConfigItems.enable_apimonitoring "true")}}
{{ if and (ne .ConfigItems.skipper_routesrv_enabled "exec") (eq .ConfigItems.enable_apimonitoring "true")}}
- "-default-filters-dir=/etc/config/default-filters"
{{ end }}
- "-max-audit-body=0"
Expand Down Expand Up @@ -275,7 +275,7 @@ spec:
- name: routes
mountPath: /etc/routes
{{ end }}
{{ if and (ne .ConfigItems.skipper_routesrv_enabled "true") (eq .ConfigItems.enable_apimonitoring "true")}}
{{ if and (ne .ConfigItems.skipper_routesrv_enabled "exec") (eq .ConfigItems.enable_apimonitoring "true")}}
- name: filters
mountPath: /etc/config/default-filters
{{ end }}
Expand All @@ -295,7 +295,7 @@ spec:
configMap:
name: sandbox-tokeninfo-bridge-conf
{{ end }}
{{ if and (ne .ConfigItems.skipper_routesrv_enabled "true") (eq .ConfigItems.enable_apimonitoring "true") }}
{{ if and (ne .ConfigItems.skipper_routesrv_enabled "exec") (eq .ConfigItems.enable_apimonitoring "true") }}
- name: filters
configMap:
name: skipper-default-filters
Expand Down
2 changes: 1 addition & 1 deletion cluster/manifests/skipper/routesrv-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if ne .ConfigItems.skipper_routesrv_enabled "true" }}
{{ if ne .ConfigItems.skipper_routesrv_enabled "false" }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down

0 comments on commit d9b3847

Please sign in to comment.