Gallardot opened a new issue #221:
URL: https://github.com/apache/apisix-helm-chart/issues/221


   APISIX provides a very rich set of configuration items. When we need to 
customize the configuration, we need to add configuration items to the 
[values.yaml](https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml)
 and then modify the code in the 
[templates](https://github.com/apache/apisix-helm-chart/tree/master/charts/apisix/templates).
 This is a tedious job for the maintenance of Helm Charts. In particular, some 
configuration items do not need to be associated with other resources, but we 
do need to modify them in actual production scenarios.
   
   By reviewing the APISIX code, we can see that APISIX reads 
`config-default.yaml` first and `config.yaml` later. The contents of the two 
files will eventually be merged. Therefore, I propose to mount the 
`config-default.yaml` file from the Docker image to the container via configMap.
   
   Eventually, we can form a pattern that looks something like this
   
   
[values.yaml](https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml)
 
   
   ```
   apisix:
       conf-default.yaml : |-
         ... the content is copied from conf-default.yaml  ...
         apisix:
           # node_listen: 9080               # APISIX listening port
           node_listen:                      # This style support multiple ports
           - 9080.
           
   ```
   
   
[configmap.yaml](https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/templates/configmap.yaml)
   
   ```
   apiVersion: v1
   kind: ConfigMap
   metadata:
   name: conf-default
   data:
   conf-default.yaml: |-
   # render apisix.conf-default.yaml
   ```
   
   [apisix 
deployment](https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/templates/deployment.yaml)
   
   ```
   volumeMounts:
       - mountPath: /usr/local/apisix/conf/config.yaml
          name: apisix-config
          subPath: config.yaml
       - mountPath: /usr/local/apisix/conf/config-default.yaml
          name: apisix-config
          subPath: config-default.yaml
   ```
   
   
   Please feel free to give your suggestions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to