Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TT-11901: expose Tyk-Pump health check route #370

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion components/tyk-pump/templates/deployment-pmp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@ spec:
securityContext:
{{- toYaml .Values.pump.containerSecurityContext | nindent 12 }}
{{- end }}

{{- if .Values.pump.livenessProbe }}
livenessProbe:
httpGet:
scheme: "HTTP"
path: /{{ .Values.pump.healthCheckService.path }}
port: {{ .Values.pump.healthCheckService.port }}
{{- toYaml .Values.pump.livenessProbe | nindent 10 }}
{{- end }}

{{- if .Values.pump.readinessProbe }}
readinessProbe:
httpGet:
scheme: "HTTP"
path: /{{ .Values.pump.healthCheckService.path }}
port: {{ .Values.pump.healthCheckService.port }}
{{- toYaml .Values.pump.readinessProbe | nindent 10 }}
{{- end }}

env:
# Legacy support for Redis Cluster driver. Driver dropped in v3.0.0.
- name: REDIGOCLUSTER_SHARDCOUNT
Expand Down Expand Up @@ -337,6 +356,12 @@ spec:
value: "4000"
- name: TYK_PMP_PURGEDELAY
value: "2"
{{- if .Values.pump.healthCheckService.enabled }}
- name: TYK_PMP_HEALTHCHECKENDPOINTNAME
value: "{{ .Values.pump.healthCheckService.path }}"
- name: TYK_PMP_HEALTHCHECKENDPOINTPORT
value: "{{ .Values.pump.healthCheckService.port }}"
{{- end }}

{{- if .Values.pump.extraEnvs }}
{{- include "tyk-pump.tplvalues.render" ( dict "value" .Values.pump.extraEnvs "context" $ ) | nindent 10 }}
Expand Down Expand Up @@ -373,4 +398,4 @@ spec:
secret:
secretName: {{ .secretName }}
{{- end }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions components/tyk-pump/templates/service-pump-health.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.pump.healthCheckService.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: pump-svc-health-{{ include "tyk-pump.fullname" . }}
{{- if .Values.pump.healthCheckService.annotations }}
{{ toYaml .Values.pump.healthCheckService.annotations }}
{{- end }}
labels:
app: pump-svc-{{ include "tyk-pump.fullname" . }}
chart: {{ include "tyk-pump.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
ports:
- port: {{ .Values.pump.healthCheckService.port }}
targetPort: {{ .Values.pump.healthCheckService.port }}
protocol: TCP
name: {{ default "http" .Values.pump.healthCheckService.portName | quote }}
type: {{ .Values.pump.healthCheckService.type }}
{{- if eq .Values.pump.service.type "LoadBalancer" }}
externalTrafficPolicy: {{ .Values.pump.healthCheckService.externalTrafficPolicy }}
{{- end }}
selector:
app: pump-{{ include "tyk-pump.fullname" . }}
release: {{ .Release.Name }}
{{- end}}
2 changes: 1 addition & 1 deletion components/tyk-pump/templates/service-pump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ spec:
selector:
app: pump-{{ include "tyk-pump.fullname" . }}
release: {{ .Release.Name }}
{{- end}}
{{- end}}
41 changes: 40 additions & 1 deletion components/tyk-pump/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,32 @@ pump:
annotations: {}

# The name for the service port
portName: ""
portName: ""

healthCheckService:
# type specifies type of the service.
type: ClusterIP

# Tyk Pump health service is disabled by default.
# Set it to true to enable it.
enabled: false

# path sets the health check path.
path: ""

# port sets the health check port.
# It defaults to 8083 if health check is enabled and it is not set.
port: 8083

# The name for the health check service port
portName: ""

# annotations specifies annotations to be added Tyk Pump service.
annotations: {}

# externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or
# cluster-wide endpoints, while using LoadBalancer type of service.
externalTrafficPolicy: Local

# containerPort represents the port where Tyk Pump serve the metrics, for instance metrics for Prometheus.
# The default port is 9090.
Expand Down Expand Up @@ -366,3 +391,17 @@ pump:
# serviceAccountName field indicates the name of the Service Account that is going to be used by the Pods.
# If a service account is to be used for Tyk Pump, it should be manually created
serviceAccountName: ""

# livenessProbe:
# initialDelaySeconds: 10
# periodSeconds: 2
# timeoutSeconds: 3
# failureThreshold: 2
livenessProbe: {}

# readinessProbe:
# initialDelaySeconds: 10
# periodSeconds: 10
# timeoutSeconds: 3
# failureThreshold: 3
readinessProbe: {}
39 changes: 39 additions & 0 deletions tyk-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,31 @@ tyk-pump:
# annotations specifies annotations to be added Tyk Pump service.
annotations: {}

healthCheckService:
# type specifies type of the service.
type: ClusterIP

# Tyk Pump health service is disabled by default.
# Set it to true to enable it.
enabled: false

# path sets the health check path.
path: ""

# port sets the health check port.
# It defaults to 8083 if health check is enabled and it is not set.
port: 8083

# The name for the health check service port
portName: ""

# annotations specifies annotations to be added Tyk Pump service.
annotations: {}

# externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or
# cluster-wide endpoints, while using LoadBalancer type of service.
externalTrafficPolicy: Local

# containerPort represents the port where Tyk Pump serve the metrics, for instance metrics for Prometheus.
# The default port is 9090.
containerPort: 9090
Expand Down Expand Up @@ -882,6 +907,20 @@ tyk-pump:
# readOnly: true
extraVolumeMounts: []

# livenessProbe:
# initialDelaySeconds: 10
# periodSeconds: 2
# timeoutSeconds: 3
# failureThreshold: 2
livenessProbe: {}

# readinessProbe:
# initialDelaySeconds: 10
# periodSeconds: 10
# timeoutSeconds: 3
# failureThreshold: 3
readinessProbe: {}

tyk-bootstrap:
fullnameOverride: ""
nameOverride: ""
Expand Down
40 changes: 40 additions & 0 deletions tyk-data-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,31 @@ tyk-pump:
# annotations specifies annotations to be added Tyk Pump service.
annotations: {}

healthCheckService:
# type specifies type of the service.
type: ClusterIP

# Tyk Pump health service is disabled by default.
# Set it to true to enable it.
enabled: false

# path sets the health check path.
path: ""

# port sets the health check port.
# It defaults to 8083 if health check is enabled and it is not set.
port: 8083

# The name for the health check service port
portName: ""

# annotations specifies annotations to be added Tyk Pump service.
annotations: {}

# externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or
# cluster-wide endpoints, while using LoadBalancer type of service.
externalTrafficPolicy: Local

# containerPort represents the port where Tyk Pump serve the metrics, for instance metrics for Prometheus.
# The default port is 9090.
containerPort: 9090
Expand Down Expand Up @@ -772,6 +797,21 @@ tyk-pump:
# mountPath: /etc/ssl/certs/ca-certs.crt
# readOnly: true
extraVolumeMounts: []

# livenessProbe:
# initialDelaySeconds: 10
# periodSeconds: 2
# timeoutSeconds: 3
# failureThreshold: 2
livenessProbe: {}

# readinessProbe:
# initialDelaySeconds: 10
# periodSeconds: 10
# timeoutSeconds: 3
# failureThreshold: 3
readinessProbe: {}

tests:
enabled: true
resources: {}
Expand Down
40 changes: 40 additions & 0 deletions tyk-oss/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,31 @@ tyk-pump:
# annotations specifies annotations to be added Tyk Pump service.
annotations: {}

healthCheckService:
# type specifies type of the service.
type: ClusterIP

# Tyk Pump health service is disabled by default.
# Set it to true to enable it.
enabled: false

# path sets the health check path.
path: ""

# port sets the health check port.
# It defaults to 8083 if health check is enabled and it is not set.
port: 8083

# The name for the health check service port
portName: ""

# annotations specifies annotations to be added Tyk Pump service.
annotations: {}

# externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or
# cluster-wide endpoints, while using LoadBalancer type of service.
externalTrafficPolicy: Local

# containerPort represents the port where Tyk Pump serve the metrics, for instance metrics for Prometheus.
# The default port is 9090.
containerPort: 9090
Expand Down Expand Up @@ -802,6 +827,21 @@ tyk-pump:
# mountPath: /etc/ssl/certs/ca-certs.crt
# readOnly: true
extraVolumeMounts: []

# livenessProbe:
# initialDelaySeconds: 10
# periodSeconds: 2
# timeoutSeconds: 3
# failureThreshold: 2
livenessProbe: {}

# readinessProbe:
# initialDelaySeconds: 10
# periodSeconds: 10
# timeoutSeconds: 3
# failureThreshold: 3
readinessProbe: {}

tests:
enabled: true
resources: {}
Expand Down
39 changes: 39 additions & 0 deletions tyk-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,31 @@ tyk-pump:
# annotations specifies annotations to be added Tyk Pump service.
annotations: {}

healthCheckService:
# type specifies type of the service.
type: ClusterIP

# Tyk Pump health service is disabled by default.
# Set it to true to enable it.
enabled: true

# path sets the health check path.
path: "hello"

# port sets the health check port.
# It defaults to 8083 if health check is enabled and it is not set.
port: 8083

# The name for the health check service port
portName: ""

# annotations specifies annotations to be added Tyk Pump service.
annotations: {}

# externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or
# cluster-wide endpoints, while using LoadBalancer type of service.
externalTrafficPolicy: Local

# containerPort represents the port where Tyk Pump serve the metrics, for instance metrics for Prometheus.
# The default port is 9090.
containerPort: 9090
Expand Down Expand Up @@ -900,6 +925,20 @@ tyk-pump:
# readOnly: true
extraVolumeMounts: []

# livenessProbe:
# initialDelaySeconds: 10
# periodSeconds: 2
# timeoutSeconds: 3
# failureThreshold: 2
livenessProbe: {}

# readinessProbe:
# initialDelaySeconds: 10
# periodSeconds: 10
# timeoutSeconds: 3
# failureThreshold: 3
readinessProbe: {}

tyk-bootstrap:
fullnameOverride: ""
nameOverride: ""
Expand Down
Loading