Skip to content

Commit b26c0fb

Browse files
authored
feat: support configure readiness and liveness probe for gateway (#186)
Signed-off-by: Nic <[email protected]>
1 parent cc3af78 commit b26c0fb

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

charts/gateway/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type: application
1414
# This is the chart version. This version number should be incremented each time you make changes
1515
# to the chart and its templates, including the app version.
1616
# Versions are expected to follow Semantic Versioning (https://semver.org/)
17-
version: 0.2.17
17+
version: 0.2.18
1818

1919
# This is the version number of the application being deployed. This version number should be
2020
# incremented each time you make changes to the application. Versions are not expected to

charts/gateway/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ The command removes all the Kubernetes components associated with the chart and
175175
| gateway.ingress | object | `{"annotations":{},"enabled":false,"hosts":[{"host":"apisix.local","paths":[]}],"tls":[]}` | Using ingress access API7 Gateway service |
176176
| gateway.ingress.annotations | object | `{}` | Ingress annotations |
177177
| gateway.labelsOverride | object | `{}` | Override default labels assigned to API7 Gateway gateway resources |
178+
| gateway.livenessProbe | object | `{}` | kubernetes liveness probe. |
179+
| gateway.readinessProbe | object | `{}` | kubernetes readiness probe, we will provide a probe based on tcpSocket to gateway's HTTP port by default. |
178180
| gateway.stream | object | `{"enabled":false,"only":false,"tcp":[],"udp":[]}` | API7 Gateway service settings for stream. L4 proxy (TCP/UDP) |
179181
| gateway.tls | object | `{"additionalContainerPorts":[],"certCAFilename":"","containerPort":9443,"enabled":true,"existingCASecret":"","http2":{"enabled":true},"servicePort":443,"sslProtocols":"TLSv1.2 TLSv1.3"}` | API7 Gateway service settings for tls |
180182
| gateway.tls.additionalContainerPorts | list | `[]` | Support multiple https ports, See [Configuration](https://github.com/apache/apisix/blob/0bc65ea9acd726f79f80ae0abd8f50b7eb172e3d/conf/config-default.yaml#L99) |

charts/gateway/templates/_pod.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ spec:
117117
{{- end }}
118118
{{- end }}
119119
{{- end }}
120+
{{- if .Values.gateway.readinessProbe }}
121+
readinessProbe:
122+
{{- toYaml .Values.gateway.readinessProbe | nindent 8 }}
123+
{{- else }}
120124
readinessProbe:
121125
failureThreshold: 6
122126
initialDelaySeconds: 10
@@ -125,6 +129,11 @@ spec:
125129
tcpSocket:
126130
port: {{ .Values.gateway.http.containerPort }}
127131
timeoutSeconds: 1
132+
{{- end }}
133+
{{- if .Values.gateway.livenessProbe }}
134+
livenessProbe:
135+
{{- toYaml .Values.gateway.livenessProbe | nindent 8 }}
136+
{{- end }}
128137
lifecycle:
129138
preStop:
130139
exec:

charts/gateway/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ gateway:
240240
# annotations:
241241
# service.beta.kubernetes.io/aws-load-balancer-type: nlb
242242
externalIPs: []
243+
# -- kubernetes readiness probe, we will provide a probe based on tcpSocket to gateway's HTTP port by default.
244+
readinessProbe: {}
245+
# -- kubernetes liveness probe.
246+
livenessProbe: {}
243247
# -- API7 Gateway service settings for http
244248
http:
245249
enabled: true

0 commit comments

Comments
 (0)