Skip to content

Commit

Permalink
TT-11901: expose Tyk-Pump health check route
Browse files Browse the repository at this point in the history
  • Loading branch information
olamilekan000 committed Dec 12, 2024
1 parent 6a0e67b commit b4a306b
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 2 deletions.
29 changes: 28 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.service.healthEndpointName | default "health" }}
port: {{ .Values.pump.service.healthEndpointPort | default 8083 }}
{{- toYaml .Values.pump.livenessProbe | nindent 10 }}
{{- end }}

{{- if .Values.pump.readinessProbe }}
readinessProbe:
httpGet:
scheme: "HTTP"
path: /{{ .Values.pump.service.healthEndpointName | default "health" }}
port: {{ .Values.pump.service.healthEndpointPort | default 8083 }}
{{- 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,14 @@ spec:
value: "4000"
- name: TYK_PMP_PURGEDELAY
value: "2"
{{- if .Values.pump.service.healthEnabled }}
- name: TYK_PMP_HEALTHCHECKENDPOINTNAME
value: "{{ .Values.pump.service.healthEndpointName }}"
{{- end }}
{{- if .Values.pump.service.healthEnabled}}
- name: TYK_PMP_HEALTHCHECKENDPOINTPORT
value: "{{ .Values.pump.service.healthEndpointPort }}"
{{- end }}

{{- if .Values.pump.extraEnvs }}
{{- include "tyk-pump.tplvalues.render" ( dict "value" .Values.pump.extraEnvs "context" $ ) | nindent 10 }}
Expand Down Expand Up @@ -373,4 +400,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.service.healthEnabled -}}
apiVersion: v1
kind: Service
metadata:
name: pump-svc-health-{{ include "tyk-pump.fullname" . }}
{{- if .Values.pump.service.annotations }}
{{ toYaml .Values.pump.service.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.service.healthEndpointPort | default 8083 }}
targetPort: {{ .Values.pump.service.healthEndpointPort | default 8083 }}
protocol: TCP
name: {{ default "http" .Values.pump.service.portName | quote }}
type: {{ .Values.pump.service.type }}
{{- if eq .Values.pump.service.type "LoadBalancer" }}
externalTrafficPolicy: {{ .Values.pump.service.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}}
25 changes: 25 additions & 0 deletions components/tyk-pump/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,17 @@ pump:
# Tyk Pump svc is disabled by default. Set it to true to enable it.
enabled: false

# healthEnabled enables health check service
healthEnabled: false

# healthEndpointName sets the health check path.
# It defaults to hello if health check is enabled and it is not set.
healthEndpointName: ""

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

# type specifies type of the service.
type: ClusterIP

Expand Down Expand Up @@ -366,3 +377,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: {}
25 changes: 25 additions & 0 deletions tyk-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,17 @@ tyk-pump:
# Tyk Pump svc is disabled by default. Set it to true to enable it.
enabled: false

# healthEnabled enables health check service
healthEnabled: false

# healthEndpointName sets the health check path.
# It defaults to hello if health check is enabled and it is not set.
healthEndpointName: ""

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

# type specifies type of the service.
type: ClusterIP

Expand Down Expand Up @@ -881,6 +892,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
25 changes: 25 additions & 0 deletions tyk-data-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,17 @@ tyk-pump:
# Tyk Pump svc is disabled by default. Set it to true to enable it.
enabled: false

# healthEnabled enables health check service
healthEnabled: false

# healthEndpointName sets the health check path.
# It defaults to hello if health check is enabled and it is not set.
healthEndpointName: ""

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

# type specifies type of the service.
type: ClusterIP

Expand Down Expand Up @@ -772,3 +783,17 @@ 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: {}
25 changes: 25 additions & 0 deletions tyk-oss/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,17 @@ tyk-pump:
# Tyk Pump svc is disabled by default. Set it to true to enable it.
enabled: false

# healthEnabled enables health check service
healthEnabled: false

# healthEndpointName sets the health check path.
# It defaults to hello if health check is enabled and it is not set.
healthEndpointName: ""

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

# type specifies type of the service.
type: ClusterIP

Expand Down Expand Up @@ -802,3 +813,17 @@ 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: {}
25 changes: 25 additions & 0 deletions tyk-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,17 @@ tyk-pump:
# Tyk Pump svc is disabled by default. Set it to true to enable it.
enabled: false

# healthEnabled enables health check service
healthEnabled: false

# healthEndpointName sets the health check path.
# It defaults to hello if health check is enabled and it is not set.
healthEndpointName: ""

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

# type specifies type of the service.
type: ClusterIP

Expand Down Expand Up @@ -899,6 +910,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

0 comments on commit b4a306b

Please sign in to comment.