Skip to content

Commit

Permalink
TT-11901: move health check service into a separate value
Browse files Browse the repository at this point in the history
  • Loading branch information
olamilekan000 committed Dec 24, 2024
1 parent d7a2028 commit 6faae96
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 75 deletions.
18 changes: 8 additions & 10 deletions components/tyk-pump/templates/deployment-pmp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ spec:
livenessProbe:
httpGet:
scheme: "HTTP"
path: /{{ .Values.pump.service.healthEndpointName | default "health" }}
port: {{ .Values.pump.service.healthEndpointPort | default 8083 }}
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.service.healthEndpointName | default "health" }}
port: {{ .Values.pump.service.healthEndpointPort | default 8083 }}
path: /{{ .Values.pump.healthCheckService.path }}
port: {{ .Values.pump.healthCheckService.port }}
{{- toYaml .Values.pump.readinessProbe | nindent 10 }}
{{- end }}

Expand Down Expand Up @@ -356,14 +356,12 @@ spec:
value: "4000"
- name: TYK_PMP_PURGEDELAY
value: "2"
{{- if .Values.pump.service.healthEnabled }}
{{- if .Values.pump.healthCheckService.enabled }}
- name: TYK_PMP_HEALTHCHECKENDPOINTNAME
value: "{{ .Values.pump.service.healthEndpointName }}"
{{- end }}
{{- if .Values.pump.service.healthEnabled}}
value: "{{ .Values.pump.healthCheckService.path }}"
- name: TYK_PMP_HEALTHCHECKENDPOINTPORT
value: "{{ .Values.pump.service.healthEndpointPort }}"
{{- end }}
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
16 changes: 8 additions & 8 deletions components/tyk-pump/templates/service-pump-health.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{- if .Values.pump.service.healthEnabled -}}
{{- if .Values.pump.healthCheckService.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: pump-svc-health-{{ include "tyk-pump.fullname" . }}
{{- if .Values.pump.service.annotations }}
{{ toYaml .Values.pump.service.annotations }}
{{- if .Values.pump.healthCheckService.annotations }}
{{ toYaml .Values.pump.healthCheckService.annotations }}
{{- end }}
labels:
app: pump-svc-{{ include "tyk-pump.fullname" . }}
Expand All @@ -13,13 +13,13 @@ metadata:
heritage: {{ .Release.Service }}
spec:
ports:
- port: {{ .Values.pump.service.healthEndpointPort | default 8083 }}
targetPort: {{ .Values.pump.service.healthEndpointPort | default 8083 }}
- port: {{ .Values.pump.healthCheckService.port }}
targetPort: {{ .Values.pump.healthCheckService.port }}
protocol: TCP
name: {{ default "http" .Values.pump.service.portName | quote }}
type: {{ .Values.pump.service.type }}
name: {{ default "http" .Values.pump.healthCheckService.portName | quote }}
type: {{ .Values.pump.healthCheckService.type }}
{{- if eq .Values.pump.service.type "LoadBalancer" }}
externalTrafficPolicy: {{ .Values.pump.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.pump.healthCheckService.externalTrafficPolicy }}
{{- end }}
selector:
app: pump-{{ include "tyk-pump.fullname" . }}
Expand Down
38 changes: 26 additions & 12 deletions components/tyk-pump/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,6 @@ 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 All @@ -231,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
36 changes: 25 additions & 11 deletions tyk-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -736,17 +736,6 @@ 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 All @@ -760,6 +749,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
36 changes: 25 additions & 11 deletions tyk-data-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -618,17 +618,6 @@ 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 All @@ -642,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
38 changes: 26 additions & 12 deletions tyk-oss/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -659,17 +659,6 @@ 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 All @@ -683,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 @@ -826,7 +840,7 @@ tyk-pump:
# periodSeconds: 10
# timeoutSeconds: 3
# failureThreshold: 3
readinessProbe: {}
readinessProbe: {}

tests:
enabled: true
Expand Down
36 changes: 25 additions & 11 deletions tyk-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -754,17 +754,6 @@ 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 All @@ -778,6 +767,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

0 comments on commit 6faae96

Please sign in to comment.