From 5bfe7326a1af37e1c08ceccd1802199083d92019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8C=E1=85=A1=E1=86=BC=E1=84=8C=E1=85=AE=E1=86=AB?= =?UTF-8?q?=E1=84=8B=E1=85=A7=E1=86=BC=28Junyeong=20Jang=29/Core=E1=84=91?= =?UTF-8?q?=E1=85=B3=E1=86=AF=E1=84=85=E1=85=A2=E1=86=BA=E1=84=91=E1=85=A9?= =?UTF-8?q?=E1=86=B7=E1=84=80=E1=85=A2=E1=84=87=E1=85=A1=E1=86=AF=E1=84=90?= =?UTF-8?q?=E1=85=B5=E1=86=B7/11ST?= Date: Wed, 3 Jan 2024 22:59:33 +0900 Subject: [PATCH] feat: support readinessProbe for apisix pod (#545) --- charts/apisix/README.md | 1 + charts/apisix/templates/deployment.yaml | 8 +------- charts/apisix/values.yaml | 12 +++++++++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/charts/apisix/README.md b/charts/apisix/README.md index 36482ae7..dabc2341 100644 --- a/charts/apisix/README.md +++ b/charts/apisix/README.md @@ -191,6 +191,7 @@ The command removes all the Kubernetes components associated with the chart and | podSecurityContext | object | `{}` | Set the securityContext for Apache APISIX pods | | priorityClassName | string | `""` | Set [priorityClassName](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority) for Apache APISIX pods | | rbac.create | bool | `false` | | +| readinessProbe | object | `{"failureThreshold":6,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"tcpSocket":{"port":9080},"timeoutSeconds":1}` | Set the readinessProbe for Apache APISIX pods | | replicaCount | int | `1` | if useDaemonSet is true or autoscaling.enabled is true, replicaCount not become effective | | resources | object | `{}` | Set pod resource requests & limits | | securityContext | object | `{}` | Set the securityContext for Apache APISIX container | diff --git a/charts/apisix/templates/deployment.yaml b/charts/apisix/templates/deployment.yaml index 2a92928c..74271fb6 100644 --- a/charts/apisix/templates/deployment.yaml +++ b/charts/apisix/templates/deployment.yaml @@ -153,13 +153,7 @@ spec: {{- if ne .Values.apisix.deployment.role "control_plane" }} readinessProbe: - failureThreshold: 6 - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - tcpSocket: - port: {{ .Values.service.http.containerPort }} - timeoutSeconds: 1 + {{- toYaml .Values.readinessProbe | nindent 12 }} {{- end }} lifecycle: preStop: diff --git a/charts/apisix/values.yaml b/charts/apisix/values.yaml index 4debf80f..94119703 100644 --- a/charts/apisix/values.yaml +++ b/charts/apisix/values.yaml @@ -52,6 +52,16 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 +# -- Set the readinessProbe for Apache APISIX pods +readinessProbe: + failureThreshold: 6 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: &apisixServiceHttpContainerPort 9080 + timeoutSeconds: 1 + # -- See https://kubernetes.io/docs/tasks/run-application/configure-pdb/ for more details podDisruptionBudget: # -- Enable or disable podDisruptionBudget @@ -173,7 +183,7 @@ service: http: enabled: true servicePort: 80 - containerPort: 9080 + containerPort: *apisixServiceHttpContainerPort # -- Support multiple http ports, See [Configuration](https://github.com/apache/apisix/blob/0bc65ea9acd726f79f80ae0abd8f50b7eb172e3d/conf/config-default.yaml#L24) additionalContainerPorts: [] # - port: 9081