diff --git a/components/tyk-pump/templates/deployment-pmp.yaml b/components/tyk-pump/templates/deployment-pmp.yaml index e585962b..e8e3c3d8 100644 --- a/components/tyk-pump/templates/deployment-pmp.yaml +++ b/components/tyk-pump/templates/deployment-pmp.yaml @@ -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 @@ -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 }} @@ -373,4 +400,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..eac42f21 --- /dev/null +++ b/components/tyk-pump/templates/service-pump-health.yaml @@ -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}} 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..a616de67 100644 --- a/components/tyk-pump/values.yaml +++ b/components/tyk-pump/values.yaml @@ -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 @@ -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: {} diff --git a/tyk-control-plane/values.yaml b/tyk-control-plane/values.yaml index dbfaa081..b94af641 100644 --- a/tyk-control-plane/values.yaml +++ b/tyk-control-plane/values.yaml @@ -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 @@ -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: "" diff --git a/tyk-data-plane/values.yaml b/tyk-data-plane/values.yaml index 6904f1a2..5d9ea533 100644 --- a/tyk-data-plane/values.yaml +++ b/tyk-data-plane/values.yaml @@ -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 @@ -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: {} diff --git a/tyk-oss/values.yaml b/tyk-oss/values.yaml index 64633251..e5d48cfc 100644 --- a/tyk-oss/values.yaml +++ b/tyk-oss/values.yaml @@ -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 @@ -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: {} diff --git a/tyk-stack/values.yaml b/tyk-stack/values.yaml index 6ac234ff..b4457f42 100644 --- a/tyk-stack/values.yaml +++ b/tyk-stack/values.yaml @@ -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 @@ -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: ""