diff --git a/components/tyk-pump/templates/deployment-pmp.yaml b/components/tyk-pump/templates/deployment-pmp.yaml index e585962b..59b55bd6 100644 --- a/components/tyk-pump/templates/deployment-pmp.yaml +++ b/components/tyk-pump/templates/deployment-pmp.yaml @@ -59,6 +59,21 @@ spec: securityContext: {{- toYaml .Values.pump.containerSecurityContext | nindent 12 }} {{- end }} + + {{- if .Values.pump.healthCheckService.enabled }} + livenessProbe: + httpGet: + scheme: "HTTP" + path: /{{ .Values.pump.healthCheckService.path }} + port: {{ .Values.pump.healthCheckService.port }} + + readinessProbe: + httpGet: + scheme: "HTTP" + path: /{{ .Values.pump.healthCheckService.path }} + port: {{ .Values.pump.healthCheckService.port }} + {{- end }} + env: # Legacy support for Redis Cluster driver. Driver dropped in v3.0.0. - name: REDIGOCLUSTER_SHARDCOUNT @@ -337,6 +352,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 }} @@ -373,4 +394,4 @@ spec: secret: secretName: {{ .secretName }} {{- end }} - {{- end }} + {{- end }} diff --git a/components/tyk-pump/templates/service-pump-health.yaml b/components/tyk-pump/templates/service-pump-health.yaml new file mode 100644 index 00000000..52b2464f --- /dev/null +++ b/components/tyk-pump/templates/service-pump-health.yaml @@ -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}} diff --git a/components/tyk-pump/templates/service-pump.yaml b/components/tyk-pump/templates/service-pump.yaml index 2a543a2d..8c58f802 100644 --- a/components/tyk-pump/templates/service-pump.yaml +++ b/components/tyk-pump/templates/service-pump.yaml @@ -24,4 +24,4 @@ spec: selector: app: pump-{{ include "tyk-pump.fullname" . }} release: {{ .Release.Name }} -{{- end}} \ No newline at end of file +{{- end}} diff --git a/components/tyk-pump/values.yaml b/components/tyk-pump/values.yaml index 775667c9..8582be33 100644 --- a/components/tyk-pump/values.yaml +++ b/components/tyk-pump/values.yaml @@ -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: "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. @@ -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: {} diff --git a/tyk-control-plane/values.yaml b/tyk-control-plane/values.yaml index f4c712c9..7dafd3b9 100644 --- a/tyk-control-plane/values.yaml +++ b/tyk-control-plane/values.yaml @@ -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: "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 @@ -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: "" diff --git a/tyk-data-plane/values.yaml b/tyk-data-plane/values.yaml index 181b6b22..3ce31bbe 100644 --- a/tyk-data-plane/values.yaml +++ b/tyk-data-plane/values.yaml @@ -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: "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 @@ -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: {} diff --git a/tyk-oss/values.yaml b/tyk-oss/values.yaml index 3af0372a..c66a2e51 100644 --- a/tyk-oss/values.yaml +++ b/tyk-oss/values.yaml @@ -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: "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 @@ -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: {} diff --git a/tyk-stack/values.yaml b/tyk-stack/values.yaml index 9c129e62..0644187d 100644 --- a/tyk-stack/values.yaml +++ b/tyk-stack/values.yaml @@ -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: false + + # 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 @@ -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: ""