You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by zh...@apache.org on 2022/01/27 11:56:52 UTC

[apisix-helm-chart] branch master updated: feat(apisix): customized config.yaml (#223)

This is an automated email from the ASF dual-hosted git repository.

zhangjintao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-helm-chart.git


The following commit(s) were added to refs/heads/master by this push:
     new 21c4c5e  feat(apisix): customized config.yaml (#223)
21c4c5e is described below

commit 21c4c5e2ea287f4971b6f7d7402d1185924672c4
Author: Gallardot <tt...@163.com>
AuthorDate: Thu Jan 27 19:56:43 2022 +0800

    feat(apisix): customized config.yaml (#223)
---
 charts/apisix/README.md                | 2 ++
 charts/apisix/templates/configmap.yaml | 8 ++++++++
 charts/apisix/values.yaml              | 3 +++
 3 files changed, 13 insertions(+)

diff --git a/charts/apisix/README.md b/charts/apisix/README.md
index 8c9d56b..847c472 100644
--- a/charts/apisix/README.md
+++ b/charts/apisix/README.md
@@ -62,6 +62,8 @@ The following tables lists the configurable parameters of the apisix chart and t
 |------------------------------------------|-----------------------------------------------------|---------------------------------------------------------|
 | `apisix.enabled`                         | Enable or disable Apache APISIX itself              | `true`                                                  |
 | `apisix.enableIPv6`                      | Enable nginx IPv6 resolver                          | `true`                                                  |
+| `apisix.enableCustomizedConfig`          | Enable full customized `config.yaml`                | `false`                                                  |
+| `apisix.customizedConfig`                | If `apisix.enableCustomizedConfig` is true, full customized `config.yaml`. Please note that other settings about APISIX config will be ignored  | `{}`                                                 |
 | `apisix.image.repository`                | Apache APISIX image repository                      | `apache/apisix`                                         |
 | `apisix.image.tag`                       | Apache APISIX image tag                             | `{TAG_NAME}` (the latest Apache APISIX image tag)       |
 | `apisix.image.pullPolicy`                | Apache APISIX image pull policy                     | `IfNotPresent`                                          |
diff --git a/charts/apisix/templates/configmap.yaml b/charts/apisix/templates/configmap.yaml
index 445ebe3..e954513 100644
--- a/charts/apisix/templates/configmap.yaml
+++ b/charts/apisix/templates/configmap.yaml
@@ -21,6 +21,13 @@ metadata:
   name: {{ include "apisix.fullname" . }}
   namespace: {{ .Release.Namespace }}
 data:
+{{- if .Values.apisix.enableCustomizedConfig }}
+  config.yaml: |-
+    {{- range $key, $value := .Values.apisix.customizedConfig }}
+    {{ $key }}:
+      {{- include "apisix.tplvalues.render" (dict "value" $value "context" $) | nindent 6 }}
+    {{- end }}
+{{- else }}
   config.yaml: |-
     #
     # Licensed to the Apache Software Foundation (ASF) under one or more
@@ -264,3 +271,4 @@ data:
     {{- end }}
     {{- end }}
 {{- end }}
+{{- end }}
diff --git a/charts/apisix/values.yaml b/charts/apisix/values.yaml
index b47a5fb..799ec9c 100644
--- a/charts/apisix/values.yaml
+++ b/charts/apisix/values.yaml
@@ -49,6 +49,9 @@ apisix:
       - key: ""
         path: ""
 
+  enableCustomizedConfig: false
+  customizedConfig: {}
+
   image:
     repository: apache/apisix
     pullPolicy: IfNotPresent