diff --git a/charts/gateway/README.md b/charts/gateway/README.md index d297d5d..fea8a46 100644 --- a/charts/gateway/README.md +++ b/charts/gateway/README.md @@ -147,7 +147,7 @@ The command removes all the Kubernetes components associated with the chart and | deployment.certs.certsSecret | string | `""` | secret name used for decoupled mode | | deployment.certs.mTLSCACert | string | `""` | mTLS CA cert filename in mTLSCACertSecret | | deployment.certs.mTLSCACertSecret | string | `""` | trusted_ca_cert name in certsSecret | -| deployment.fallback_cp | object | `{}` | use cloud storage as the fallback control plane, should be consistent with the same configuration in control plane side. | +| deployment.fallback_cp | object | `{}` | use cloud storage as the fallback control plane | | discovery.enabled | bool | `false` | Enable or disable API7 Gateway integration service discovery | | discovery.registry | object | `{}` | Registry is the same to the one in APISIX [config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L281), and refer to such file for more setting details. also refer to [this documentation for integration service discovery](https://apisix.apache.org/docs/apisix/discovery) | | dns.resolvers[0] | string | `"127.0.0.1"` | | diff --git a/charts/gateway/templates/_pod.tpl b/charts/gateway/templates/_pod.tpl index 7f600eb..cb23087 100644 --- a/charts/gateway/templates/_pod.tpl +++ b/charts/gateway/templates/_pod.tpl @@ -138,6 +138,9 @@ spec: {{- end }} {{- end }} {{- end }} + {{- if and .Values.deployment.fallback_cp.mode (eq .Values.deployment.fallback_cp.mode "write") }} + {{- /* Disable probes when fallback_cp mode is set to write */ -}} + {{- else }} {{- if .Values.gateway.readinessProbe }} readinessProbe: {{- toYaml .Values.gateway.readinessProbe | nindent 8 }} @@ -155,6 +158,7 @@ spec: livenessProbe: {{- toYaml .Values.gateway.livenessProbe | nindent 8 }} {{- end }} + {{- end }} lifecycle: preStop: exec: diff --git a/charts/gateway/templates/configmap.yaml b/charts/gateway/templates/configmap.yaml index a17a207..e6db6b3 100644 --- a/charts/gateway/templates/configmap.yaml +++ b/charts/gateway/templates/configmap.yaml @@ -186,7 +186,11 @@ data: {{- toYaml .Values.apisix.stream.luaSharedDict | nindent 10 }} {{- end }} http: + {{- if and (.Values.deployment.fallback_cp) (eq .Values.deployment.fallback_cp.mode "write") }} + enable_access_log: false + {{- else }} enable_access_log: {{ .Values.logs.enableAccessLog }} + {{- end }} {{- if .Values.logs.enableAccessLog }} access_log: "{{ .Values.logs.accessLog }}" access_log_format: >- @@ -262,12 +266,14 @@ data: {{- end }} deployment: - {{- if .Values.deployment.fallback_cp }} - role: data_plane - role_data_plane: - config_provider: yaml + {{- if and (.Values.deployment.fallback_cp) }} fallback_cp: {{- toYaml .Values.deployment.fallback_cp | nindent 8 }} + {{- end }} + {{- if and (.Values.deployment.fallback_cp) (ne .Values.deployment.fallback_cp.mode "write") }} + role: data_plane + role_data_plane: + config_provider: json {{- else }} role: traditional role_traditional: diff --git a/charts/gateway/values.yaml b/charts/gateway/values.yaml index 8fb04b2..ccd3e77 100644 --- a/charts/gateway/values.yaml +++ b/charts/gateway/values.yaml @@ -236,20 +236,26 @@ rbac: create: false deployment: - # -- use cloud storage as the fallback control plane, - # should be consistent with the same configuration in control plane side. + # -- use cloud storage as the fallback control plane fallback_cp: {} + # # Allowed values: `write`, `read`, default `read` + # mode: "write" + # # how often (in seconds) to sync data to cloud storage, only used when mode is `write` + # interval: 10 + # # aws s3 configuration, when access key or secret key are not set, will use the IAM role attached to the pod # aws_s3: # access_key: "access" # secret_key: "secret" # region: "ap-south-1" # resource_bucket: "to-push-resource-data" # config_bucket: "to-push-config-data" + # # azure blob storage configuration, when account key is not set, will use the Managed Identity attached to the pod # azure_blob: # account_name: "$YOUR_ACCOUNT_NAME" # account_key: "$YOUR_ACCOUNT_KEY" # resource_container: yaml # config_container: config + # # optional, when not set, will use the default endpoint: "https://$YOUR_ACCOUNT_NAME.blob.core.windows.net" # endpoint: "$YOUR_AZURE_BLOB_ENDPOINT" # -- certs used for certificates in decoupled mode