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