apisix-helm-chart icon indicating copy to clipboard operation
apisix-helm-chart copied to clipboard

docs: add "how to configure features in the config-default.yaml"

Open juzhiyuan opened this issue 3 years ago • 8 comments

Background

When we use the apache/apisix-ingress-controller project by HelmChart, we could use the --set xxx=xxx command to inject user-defined configurations to the apache/apisix project's config.yaml file according to this template file[1], but the document[2] misses this part. Some users don't know about this case, so the issue[3] occurred.

How to resolve this case?

  1. Add a new guide to explain the relationship between apache/apisix-helm-chart, apache/apisix and apache/apisix-ingress-controller, and add a diagram or content to present the working mechanism, e.g., why and how --set could inject user-defined configurations to config.yaml.
  2. In the apache/apisix-ingress-controller or apache/apisix-helm-chart's documents, add a FAQ/guide to explain how to configure features in the config-default.yaml file.

Related Links

  1. https://github.com/apache/apisix/issues/7448

[1] https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/templates/configmap.yaml#L31 [2] https://apisix.apache.org/docs/helm-chart/apisix-ingress-controller/ [3] https://the-asf.slack.com/archives/CUC5MN17A/p1657549138916759

juzhiyuan avatar Jul 13 '22 02:07 juzhiyuan

When we use the apache/apisix-ingress-controller project by HelmChart, we could use the --set xxx=xxx command to inject user-defined configurations to the apache/apisix project's config.yaml file according to this template file[1], but the document[2] misses this part. Some users don't know about this case, so the issue[3] occurred.

This description is wrong.

For the Apache APISIX Ingress project, it is a control plane component that does not modify any configuration files of APISIX (neither config.yaml nor config-default.yaml will modify)

All modifications related to the APISIX configuration file are done in the charts/apisix Helm chart

tao12345666333 avatar Jul 13 '22 02:07 tao12345666333

@tao12345666333 Could you please check this[1]? We indeed could inject configurations when using Helm.

Is this flow correct? Helm --set=xxx -> apisix's values[2] -> config.yaml[3]

[1] https://the-asf.slack.com/archives/CUC5MN17A/p1657630350382909?thread_ts=1657549138.916759&cid=CUC5MN17A [2] https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml#L244 [3] https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/templates/configmap.yaml#L31

juzhiyuan avatar Jul 13 '22 02:07 juzhiyuan

helm --set is equivalent to modifying the values file of charts/apisix.

Then the relevant configuration will be mounted into the APISIX Pod, as well as APISIX's own configuration file.

tao12345666333 avatar Jul 13 '22 03:07 tao12345666333

Yes 👍 The thing is, in the apache/apisix-ingress-controller's tutorials and documents, we mainly mention that we could use the following command to install apisix:

helm repo add apisix https://charts.apiseven.com
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
kubectl create ns ingress-apisix

helm install apisix apisix/apisix \
  --set gateway.type=LoadBalancer \
  --set ingress-controller.enabled=true \
  --namespace ingress-apisix \
  --set ingress-controller.config.apisix.serviceNamespace=ingress-apisix
kubectl get service --namespace ingress-apisix

But we don't mention how to update configurations in the config-default.yaml file, so I propose to add some descriptions to make it more straightforward for users. 🙏

juzhiyuan avatar Jul 13 '22 05:07 juzhiyuan

I think it's a very common and fundamental behavior that anyone using Helm basically knows/understands.

There is a document on APISIX Ingress using *-plugin-runner in our documentation. https://github.com/apache/apisix-ingress-controller/blob/master/docs/en/latest/tutorials/how-to-use-go-plugin-runner-in-apisix-ingress.md#install- apisix-ingress

The documentation exists because its configuration is specific and not easy to understand.

So in my opinion, this can be described in one sentence, and it's not even worth describing.

Of course, the above is only my personal opinion, and we also very welcome any contribution, if there is a contribution to this content, we will also accept it

tao12345666333 avatar Jul 13 '22 06:07 tao12345666333

I think it's a very common and fundamental behavior that anyone using Helm basically knows/understands.

In fact, users (the above slack thread) still miss this fundamental behavior. I know the --set xxx command, but I didn't know I could pass attributes from config-default.yaml.

juzhiyuan avatar Jul 13 '22 08:07 juzhiyuan

you can see this document https://github.com/apache/apisix-helm-chart/tree/master/charts/apisix#custom-plugin-parameters

"custom plugin parameters"

tao12345666333 avatar Jul 13 '22 09:07 tao12345666333

For the Slack question, our user wants to configure the opentelemetry with the apache/apisix-ingress-controller by helm. I have to say this attribute is deep. 😂😂

In the documentation, it's pluginAttrs, but in the config-default.yaml file it's plugin_attr. I'm not clear about the reasons for using different naming styles, but we could mention them more clearly. 😊

image

juzhiyuan avatar Jul 14 '22 02:07 juzhiyuan