Skip to content

Commit 4883379

Browse files
authored
feat: add more config for gatewayproxy (#885)
1 parent 9a13ad9 commit 4883379

File tree

3 files changed

+106
-6
lines changed

3 files changed

+106
-6
lines changed

charts/apisix-ingress-controller/README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,19 @@ The same for container level, you need to set:
141141
| deployment.tolerations | list | `[]` | |
142142
| deployment.topologySpreadConstraints | list | `[]` | Topology Spread Constraints for pod assignment spread across your cluster among failure-domains ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods |
143143
| fullnameOverride | string | `""` | |
144-
| gatewayProxy.createDefault | bool | `false` | |
145-
| gatewayProxy.provider.controlPlane.auth.adminKey.value | string | `"edd1c9f034335f136f87ad84b625c8f1"` | |
146-
| gatewayProxy.provider.controlPlane.auth.type | string | `"AdminKey"` | |
147-
| gatewayProxy.provider.controlPlane.endpoints | list | `[]` | |
148-
| gatewayProxy.provider.type | string | `"ControlPlane"` | |
144+
| gatewayProxy.createDefault | bool | `false` | Controls whether to create a default GatewayProxy custom resource. |
145+
| gatewayProxy.provider | object | `{"controlPlane":{"auth":{"adminKey":{"value":"edd1c9f034335f136f87ad84b625c8f1","valueFrom":{}},"type":"AdminKey"},"endpoints":[],"service":{"name":"","port":9180}},"pluginMetadata":{},"plugins":[],"type":"ControlPlane"}` | Configuration for the GatewayProxy provider connection |
146+
| gatewayProxy.provider.controlPlane | object | `{"auth":{"adminKey":{"value":"edd1c9f034335f136f87ad84b625c8f1","valueFrom":{}},"type":"AdminKey"},"endpoints":[],"service":{"name":"","port":9180}}` | ControlPlane provider specific configuration Either `endpoints` or `service` must be specified, but not both. |
147+
| gatewayProxy.provider.controlPlane.auth | object | `{"adminKey":{"value":"edd1c9f034335f136f87ad84b625c8f1","valueFrom":{}},"type":"AdminKey"}` | Authentication configuration for control plane connection |
148+
| gatewayProxy.provider.controlPlane.auth.adminKey | object | `{"value":"edd1c9f034335f136f87ad84b625c8f1","valueFrom":{}}` | AdminKey authentication configuration. Either `value` or `valueFrom` must be specified, but not both. |
149+
| gatewayProxy.provider.controlPlane.auth.adminKey.value | string | `"edd1c9f034335f136f87ad84b625c8f1"` | The admin key value for authentication. |
150+
| gatewayProxy.provider.controlPlane.auth.adminKey.valueFrom | object | `{}` | Reference to admin key stored in a Kubernetes Secret |
151+
| gatewayProxy.provider.controlPlane.auth.type | string | `AdminKey` | Authentication type. Only `AdminKey` is currently supported. |
152+
| gatewayProxy.provider.controlPlane.endpoints | list | `[]` | List of APISIX control plane Admin API endpoints. example: ["http://apisix-admin.default.svc.cluster.local:9180"] |
153+
| gatewayProxy.provider.controlPlane.service | object | `{"name":"","port":9180}` | Alternatively, reference a Kubernetes Service for the APISIX Admin API. |
154+
| gatewayProxy.provider.pluginMetadata | object | `{}` | Global plugin metadata shared by all instances of the same plugin. |
155+
| gatewayProxy.provider.plugins | list | `[]` | List of global plugins to be enabled on the GatewayProxy. |
156+
| gatewayProxy.provider.type | string | `"ControlPlane"` | Specifies the provider type for the GatewayProxy. |
149157
| labelsOverride | object | `{}` | Override default labels assigned to Apache APISIX ingress controller resource |
150158
| nameOverride | string | `""` | Default values for apisix-ingress-controller. This is a YAML-formatted file. Declare variables to be passed into your templates. |
151159
| podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":"90%"}` | See https://kubernetes.io/docs/tasks/run-application/configure-pdb/ for more details |

charts/apisix-ingress-controller/templates/gatewayproxy.yaml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,53 @@ spec:
2424
provider:
2525
type: {{ .Values.gatewayProxy.provider.type }}
2626
controlPlane:
27+
{{- if .Values.gatewayProxy.provider.controlPlane.endpoints }}
28+
endpoints:
29+
{{- toYaml .Values.gatewayProxy.provider.controlPlane.endpoints | nindent 8 }}
30+
{{- else if .Values.gatewayProxy.provider.controlPlane.service.name }}
31+
service:
32+
name: {{ .Values.gatewayProxy.provider.controlPlane.service.name }}
33+
port: {{ .Values.gatewayProxy.provider.controlPlane.service.port }}
34+
{{- else }}
2735
service:
2836
name: {{ .Values.apisix.adminService.name }}
2937
port: {{ .Values.apisix.adminService.port }}
38+
{{- end }}
39+
40+
{{- with .Values.gatewayProxy.provider.controlPlane.tlsVerify }}
41+
tlsVerify: {{ . }}
42+
{{- end }}
43+
3044
{{- with .Values.gatewayProxy.provider.controlPlane.auth }}
3145
auth:
32-
{{- toYaml . | nindent 8 }}
46+
type: {{ .type }}
47+
{{- with .adminKey }}
48+
adminKey:
49+
{{- if .valueFrom }}
50+
valueFrom:
51+
{{- toYaml .valueFrom | nindent 12 }}
52+
{{- else if .value }}
53+
value: {{ .value | quote }}
54+
{{- end }}
55+
{{- end }}
3356
{{- end }}
57+
58+
{{- with .Values.gatewayProxy.publishService }}
59+
publishService: {{ . | quote }}
60+
{{- end }}
61+
62+
{{- with .Values.gatewayProxy.statusAddress }}
63+
statusAddress:
64+
{{- toYaml . | nindent 4 }}
65+
{{- end }}
66+
67+
{{- with .Values.gatewayProxy.plugins }}
68+
plugins:
69+
{{- toYaml . | nindent 4 }}
70+
{{- end }}
71+
72+
{{- with .Values.gatewayProxy.pluginMetadata }}
73+
pluginMetadata:
74+
{{- toYaml . | nindent 4 }}
75+
{{- end }}
3476
{{- end }}

charts/apisix-ingress-controller/values.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,67 @@ config:
9494
ingressClass: apisix
9595
defaultIngressClass: false
9696

97+
# The GatewayProxy resource configures gateway proxy instances including networking,
98+
# provider connection, global plugins, and plugin metadata.
9799
gatewayProxy:
100+
# -- Controls whether to create a default GatewayProxy custom resource.
98101
createDefault: false
102+
103+
# -- Configuration for the GatewayProxy provider connection
99104
provider:
105+
# -- Specifies the provider type for the GatewayProxy.
100106
type: ControlPlane
107+
108+
# -- ControlPlane provider specific configuration
109+
# Either `endpoints` or `service` must be specified, but not both.
101110
controlPlane:
111+
# -- List of APISIX control plane Admin API endpoints.
112+
# example: ["http://apisix-admin.default.svc.cluster.local:9180"]
102113
endpoints: []
114+
115+
# -- Alternatively, reference a Kubernetes Service for the APISIX Admin API.
116+
service:
117+
name: ""
118+
port: 9180
119+
120+
# -- Authentication configuration for control plane connection
103121
auth:
122+
# -- Authentication type. Only `AdminKey` is currently supported.
123+
# @default -- `AdminKey`
104124
type: AdminKey
125+
126+
# -- AdminKey authentication configuration.
127+
# Either `value` or `valueFrom` must be specified, but not both.
105128
adminKey:
129+
# -- The admin key value for authentication.
106130
value: "edd1c9f034335f136f87ad84b625c8f1"
107131

132+
# -- Reference to admin key stored in a Kubernetes Secret
133+
valueFrom: {}
134+
# secretKeyRef:
135+
# name: apisix-admin-secret
136+
# key: admin-key
137+
138+
# -- List of global plugins to be enabled on the GatewayProxy.
139+
plugins: []
140+
# - name: cors
141+
# enabled: true
142+
# config:
143+
# allow_origins: "*"
144+
# allow_methods: "GET,POST,PUT,DELETE"
145+
# - name: ip-restriction
146+
# enabled: false
147+
# config:
148+
# whitelist:
149+
# - 10.0.0.0/8
150+
# - 192.168.0.0/16
151+
152+
# -- Global plugin metadata shared by all instances of the same plugin.
153+
pluginMetadata: {}
154+
# prometheus:
155+
# disable: false
156+
# export_uri: /apisix/prometheus/metrics
157+
108158
apisix:
109159
adminService:
110160
namespace: apisix-ingress

0 commit comments

Comments
 (0)