Skip to content

Commit 7ec4c17

Browse files
AlexanderYastrebovponimas
authored andcommitted
skipper-ingress: explicit healthcheck routes
Skipper provides two flags to control kubernetes healthcheck routes: `-kubernetes-healthcheck` (true by default) that enables automatic healthcheck routes and `-reverse-source-predicate` to select source predicate type. Currently when routesrv is enabled (default state) it adds automatic healthcheck routes and appends default filters to all routes including healthcheck routes. This change disables automatic healthcheck routes and instead explicitly defines them in skipper pods to avoid adding default filters to them and enable further modification. When routesrv is disabled though skipper will add default filters to explicitly-defined healthcheck routes like it happens currently. In this case default filters should be configured to not hinder healthchecks. Signed-off-by: Alexander Yastrebov <[email protected]>
1 parent 1b46789 commit 7ec4c17

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

cluster/manifests/skipper/deployment.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ spec:
171171
{{ else }}
172172
- "-kubernetes"
173173
- "-kubernetes-in-cluster"
174+
- "-kubernetes-healthcheck=false" # see -inline-routes
174175
- "-kubernetes-path-mode=path-prefix"
175176
- "-kubernetes-backend-traffic-algorithm={{ .Cluster.ConfigItems.skipper_ingress_backend_traffic_algorithm }}"
176177
- "-kubernetes-default-lb-algorithm={{ .Cluster.ConfigItems.skipper_ingress_default_lb_algorithm }}"
@@ -190,7 +191,6 @@ spec:
190191
- '-kubernetes-annotation-filters-append={{ .Cluster.ConfigItems.skipper_kubernetes_annotation_filters_append }}'
191192
- '-kubernetes-east-west-range-annotation-predicates={{ .Cluster.ConfigItems.skipper_kubernetes_east_west_range_annotation_predicates }}'
192193
- '-kubernetes-east-west-range-annotation-filters-append={{ .Cluster.ConfigItems.skipper_kubernetes_east_west_range_annotation_filters_append }}'
193-
- "-reverse-source-predicate"
194194
{{ end }}
195195
- "-proxy-preserve-host"
196196
- "-compress-encodings={{ .Cluster.ConfigItems.skipper_compress_encodings }}"
@@ -323,9 +323,21 @@ spec:
323323
- "-forwarded-headers=X-Forwarded-For,X-Forwarded-Proto=https,X-Forwarded-Port=443"
324324
- '-forwarded-headers-exclude-cidrs={{ .cluster_internal_cidrs | join "," }}'
325325
{{ end }}
326-
{{ if .Cluster.ConfigItems.skipper_ingress_inline_routes }}
327-
- "-inline-routes={{ .Cluster.ConfigItems.skipper_ingress_inline_routes }}"
328-
{{ end }}
326+
- "-inline-routes"
327+
- |
328+
kube__healthz_down: Path("/kube-system/healthz")
329+
&& Shutdown()
330+
&& SourceFromLast("10.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12", "127.0.0.1/8", "fd00::/8", "::1/128")
331+
-> disableAccessLog()
332+
-> status(503)
333+
-> <shunt>;
334+
kube__healthz_up: Path("/kube-system/healthz")
335+
&& SourceFromLast("10.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12", "127.0.0.1/8", "fd00::/8", "::1/128")
336+
-> disableAccessLog()
337+
-> status(200)
338+
-> <shunt>;
339+
{{ .Cluster.ConfigItems.skipper_ingress_inline_routes }};
340+
329341
{{ if .Cluster.ConfigItems.skipper_ingress_health_check_options }}
330342
- "-passive-health-check={{ .Cluster.ConfigItems.skipper_ingress_health_check_options }}"
331343
{{ end }}
@@ -548,6 +560,7 @@ spec:
548560
- "-enable-profile"
549561
- "-kubernetes"
550562
- "-kubernetes-in-cluster"
563+
- "-kubernetes-healthcheck=false" # see -inline-routes of skipper pods
551564
- "-kubernetes-path-mode=path-prefix"
552565
- "-kubernetes-backend-traffic-algorithm={{ .Cluster.ConfigItems.skipper_ingress_backend_traffic_algorithm }}"
553566
- "-kubernetes-default-lb-algorithm={{ .Cluster.ConfigItems.skipper_ingress_default_lb_algorithm }}"
@@ -564,7 +577,6 @@ spec:
564577
- '-kubernetes-annotation-filters-append={{ .Cluster.ConfigItems.skipper_kubernetes_annotation_filters_append }}'
565578
- '-kubernetes-east-west-range-annotation-predicates={{ .Cluster.ConfigItems.skipper_kubernetes_east_west_range_annotation_predicates }}'
566579
- '-kubernetes-east-west-range-annotation-filters-append={{ .Cluster.ConfigItems.skipper_kubernetes_east_west_range_annotation_filters_append }}'
567-
- "-reverse-source-predicate"
568580
- "-default-filters-dir=/etc/config/default-filters"
569581
- '-default-filters-prepend={{ .Cluster.ConfigItems.skipper_default_filters }}'
570582
- '-default-filters-append={{ .Cluster.ConfigItems.skipper_default_filters_authentication }}'

0 commit comments

Comments
 (0)