You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by li...@apache.org on 2023/10/13 02:30:28 UTC
[apisix-helm-chart] branch dev updated: feat: allow deploying additional kubernetes resources (#636)
This is an automated email from the ASF dual-hosted git repository.
lingsamuel pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/apisix-helm-chart.git
The following commit(s) were added to refs/heads/dev by this push:
new e299679 feat: allow deploying additional kubernetes resources (#636)
e299679 is described below
commit e2996794780794f31ea37234907d97cc9074e765
Author: Indrek Juhkam <in...@urgas.eu>
AuthorDate: Fri Oct 13 05:30:23 2023 +0300
feat: allow deploying additional kubernetes resources (#636)
The `extraDeploy` option is something that is available in many helm
charts (expecially bitnami charts). It is useful for deploying extra
resources with the release. E.g. with Apisix you could deploy
ApisixGlobalRule.
This commit adds a very simple version of the extraDeploy.
E.g. Using as a string:
```
extraDeploy:
- |
apiVersion: apisix.apache.org/v2
kind: ApisixGlobalRule
metadata:
name: global
spec:
plugins:
- name: response-rewrite
enable: true
config:
headers:
remove:
- Server
```
can also use it as a map:
```
- apiVersion: apisix.apache.org/v2
kind: ApisixGlobalRule
metadata:
name: global
spec:
plugins:
- name: response-rewrite
enable: true
config:
headers:
remove:
- Server
```
---
charts/apisix/README.md | 1 +
charts/apisix/templates/extra-list.yaml | 8 ++++++++
charts/apisix/values.yaml | 3 +++
3 files changed, 12 insertions(+)
diff --git a/charts/apisix/README.md b/charts/apisix/README.md
index 32cdfe0..61eb3cd 100644
--- a/charts/apisix/README.md
+++ b/charts/apisix/README.md
@@ -171,6 +171,7 @@ The command removes all the Kubernetes components associated with the chart and
| externalEtcd.secretPasswordKey | string | `"etcd-root-password"` | externalEtcd.secretPasswordKey Key inside the secret containing the external etcd password |
| externalEtcd.user | string | `"root"` | if etcd.enabled is false, user for external etcd. Set empty to disable authentication |
| extraContainers | list | `[]` | Additional `containers`, See [Kubernetes containers](https://kubernetes.io/docs/concepts/containers/) for the detail. |
+| extraDeploy | list | `[]` | Additional Kubernetes resources to deploy with the release. |
| extraEnvVars | list | `[]` | extraEnvVars An array to add extra env vars e.g: extraEnvVars: - name: FOO value: "bar" - name: FOO2 valueFrom: secretKeyRef: name: SECRET_NAME key: KEY |
| extraInitContainers | list | `[]` | Additional `initContainers`, See [Kubernetes initContainers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) for the detail. |
| extraVolumeMounts | list | `[]` | Additional `volume`, See [Kubernetes Volumes](https://kubernetes.io/docs/concepts/storage/volumes/) for the detail. |
diff --git a/charts/apisix/templates/extra-list.yaml b/charts/apisix/templates/extra-list.yaml
new file mode 100644
index 0000000..3675406
--- /dev/null
+++ b/charts/apisix/templates/extra-list.yaml
@@ -0,0 +1,8 @@
+{{- range .Values.extraDeploy }}
+---
+{{- if typeIs "string" . }}
+ {{- tpl . $ }}
+{{- else }}
+ {{- tpl (. | toYaml) $ }}
+{{- end }}
+{{- end }}
diff --git a/charts/apisix/values.yaml b/charts/apisix/values.yaml
index 6ee9997..ce90be4 100644
--- a/charts/apisix/values.yaml
+++ b/charts/apisix/values.yaml
@@ -108,6 +108,9 @@ extraEnvVars: []
updateStrategy: {}
# type: RollingUpdate
+# -- Additional Kubernetes resources to deploy with the release.
+extraDeploy: []
+
# -- Additional `volume`, See [Kubernetes Volumes](https://kubernetes.io/docs/concepts/storage/volumes/) for the detail.
extraVolumes: []
# - name: extras