From e522a1e9660e59ee662bc55094c935933fe9c331 Mon Sep 17 00:00:00 2001 From: Tit Petric Date: Thu, 6 Jun 2024 10:12:35 +0200 Subject: [PATCH 1/2] rebase and resolve conflict --- components/tyk-gateway/templates/_helpers.tpl | 9 +++++++++ .../tyk-gateway/templates/deployment-gw-repset.yaml | 4 ++-- components/tyk-gateway/values.yaml | 5 +++++ tyk-data-plane/values.yaml | 5 +++++ tyk-oss/values.yaml | 5 +++++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/components/tyk-gateway/templates/_helpers.tpl b/components/tyk-gateway/templates/_helpers.tpl index 17491770..76174e2a 100644 --- a/components/tyk-gateway/templates/_helpers.tpl +++ b/components/tyk-gateway/templates/_helpers.tpl @@ -52,6 +52,15 @@ Create chart name and version as used by the chart label. {{- printf "%s" .Values.gateway.image.tag | replace "v" "" -}} {{- end -}} + +{{- define "tyk-gateway.probe-on-control-port" -}} +{{- if or .Values.gateway.control.useForProbes (eq .Values.gateway.image.tag "latest") -}} +true +{{- else -}} +{{- or (semverCompare ">= 3.2.0" (include "tyk-gateway.gateway-version" . )) (semverCompare ">=3.0.4 < 3.1.0" (include "tyk-gateway.gateway-version" .)) -}} +{{- end -}} +{{- end -}} + {{- define "tyk-gateway.redis_url" -}} {{- if .Values.global.redis.addrs -}} {{ join "," .Values.global.redis.addrs }} diff --git a/components/tyk-gateway/templates/deployment-gw-repset.yaml b/components/tyk-gateway/templates/deployment-gw-repset.yaml index 4cc9a3d1..22dc788c 100644 --- a/components/tyk-gateway/templates/deployment-gw-repset.yaml +++ b/components/tyk-gateway/templates/deployment-gw-repset.yaml @@ -414,7 +414,7 @@ spec: httpGet: scheme: "HTTP{{ if .Values.global.tls.gateway }}S{{ end }}" path: /hello - {{- if and .Values.gateway.control.enabled (or (semverCompare ">= 3.2.0" (include "tyk-gateway.gateway-version" . )) (semverCompare ">=3.0.4 < 3.1.0" (include "tyk-gateway.gateway-version" .))) }} + {{- if and .Values.gateway.control.enabled (include "tyk-gateway.probe-on-control-port" .) }} port: {{ .Values.gateway.control.containerPort }} {{- else }} port: {{ .Values.gateway.containerPort }} @@ -427,7 +427,7 @@ spec: httpGet: scheme: "HTTP{{ if .Values.global.tls.gateway }}S{{ end }}" path: /hello - {{- if and .Values.gateway.control.enabled (or (semverCompare ">= 3.2.0" (include "tyk-gateway.gateway-version" . )) (semverCompare ">=3.0.4 < 3.1.0" (include "tyk-gateway.gateway-version" .))) }} + {{- if and .Values.gateway.control.enabled (include "tyk-gateway.probe-on-control-port" .) }} port: {{ .Values.gateway.control.containerPort }} {{- else }} port: {{ .Values.gateway.containerPort }} diff --git a/components/tyk-gateway/values.yaml b/components/tyk-gateway/values.yaml index 27938fe3..3cd6727e 100644 --- a/components/tyk-gateway/values.yaml +++ b/components/tyk-gateway/values.yaml @@ -328,6 +328,11 @@ gateway: # - chart-example-different-domain-possible.local tls: [] + # The health endpoint is exposed on the control port or the service port, depending on image tag. + # Set to true to override to having the health endpoint on the control port. + # Useful if the tag is not semVer compatible. + useForProbes: false + # Creates an ingress object in k8s. Will require an ingress-controller and # annotation to that ingress controller. ingress: diff --git a/tyk-data-plane/values.yaml b/tyk-data-plane/values.yaml index f33edc53..da68430e 100644 --- a/tyk-data-plane/values.yaml +++ b/tyk-data-plane/values.yaml @@ -322,6 +322,11 @@ tyk-gateway: # - chart-example-different-domain-possible.local tls: [] + # The health endpoint is exposed on the control port or the service port, depending on image tag. + # Set to true to override to having the health endpoint on the control port. + # Useful if the tag is not semVer compatible. + useForProbes: false + # Creates an ingress object in k8s. Will require an ingress-controller and # annotation to that ingress controller. ingress: diff --git a/tyk-oss/values.yaml b/tyk-oss/values.yaml index 7af889d2..1b2303a0 100644 --- a/tyk-oss/values.yaml +++ b/tyk-oss/values.yaml @@ -305,6 +305,11 @@ tyk-gateway: # - chart-example-different-domain-possible.local tls: [] + # The health endpoint is exposed on the control port or the service port, depending on image tag. + # Set to true to override to having the health endpoint on the control port. + # Useful if the tag is not semVer compatible. + useForProbes: false + # Creates an ingress object in k8s. Will require an ingress-controller and # annotation to that ingress controller. ingress: From 465ff144b0cac315639dad5bd1332143f155239a Mon Sep 17 00:00:00 2001 From: olalekan odukoya Date: Thu, 6 Jun 2024 15:24:58 +0100 Subject: [PATCH 2/2] add useForProbes value to component charts --- tyk-control-plane/values.yaml | 5 +++++ tyk-stack/values.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tyk-control-plane/values.yaml b/tyk-control-plane/values.yaml index 7965a95a..2c4ce0df 100644 --- a/tyk-control-plane/values.yaml +++ b/tyk-control-plane/values.yaml @@ -379,6 +379,11 @@ tyk-gateway: # annotations for control port service annotations: {} + # The health endpoint is exposed on the control port or the service port, depending on image tag. + # Set to true to override to having the health endpoint on the control port. + # Useful if the tag is not semVer compatible. + useForProbes: false + # Creates an ingress object in k8s. Will require an ingress-controller and # annotation to that ingress controller. ingress: diff --git a/tyk-stack/values.yaml b/tyk-stack/values.yaml index 88679085..4019bc34 100644 --- a/tyk-stack/values.yaml +++ b/tyk-stack/values.yaml @@ -388,6 +388,11 @@ tyk-gateway: # annotations for control port service annotations: {} + # The health endpoint is exposed on the control port or the service port, depending on image tag. + # Set to true to override to having the health endpoint on the control port. + # Useful if the tag is not semVer compatible. + useForProbes: false + # Creates an ingress object in k8s. Will require an ingress-controller and # annotation to that ingress controller. ingress: