sbrouet opened a new issue, #454: URL: https://github.com/apache/apisix-helm-chart/issues/454
Hello Team, I spent some time trying to have standalone mode working on Kubernetes. I used information from the official Helm Chart FAQ here: https://github.com/apache/apisix-helm-chart/blob/master/docs/en/latest/FAQ.md#how-to-install-apache-apisix-running-in-standalone-mode I found out several issues, and also would like to propose some remarks and changes. I'll explain all of them here, please feel free to comment. If adequate we can create separate issues and close this one. ### Issue 1: sample Kubernetes files out of date #### Issue 1.1 : to be removed: sample with alpine based Docker image Alpine docker image have been removed from apisix-docker repository (see https://github.com/apache/apisix-docker and https://github.com/apache/apisix-docker/pull/395) -> Recommendation: remove sample with alpine docker image #### Issue 1.2 : sample with centos based Docker image not working, but OK with debian When using exact sample file, the Apisix gateway pod does start, but the routes configuration file (apisix.yaml) is not present while it is supposely mounted by the deployment in `/apisix-config/` directory ``` # From inside pod: ~ # find / -name apisix.yaml ~ # ls -l /apisix-config/ ls: /apisix-config/: No such file or directory ``` The `apisix.yaml` file located in `/usr/local/apisix/conf/` contains default file with empty routes list, instead of being replaced by symbolic link from /apisix-config/apisix.yaml. When running exact same file and just changing the docker image to a debian one, it worked perfectly: ``` image: "apache/apisix:3.1.0-debian" ``` Thank you @AlinsRan for you advice. -> Recommendation: change centos example to debian ### Issue 2: possible fix in entrypoint.sh In entrypoint.sh for debian, at line 43 the path to configuration directory is hardcoded to `/usr/local/apisix` See https://github.com/apache/apisix-docker/blob/master/debian/docker-entrypoint.sh#L43 ``` exec /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;' ``` But configuration directory can be configured with variable PREFIX which is declared at begining of script and used for some commands, for initializing configuration ``` PREFIX=${APISIX_PREFIX:=/usr/local/apisix} [...] cat > ${PREFIX}/conf/config.yaml << _EOC_ [...] cat > ${PREFIX}/conf/apisix.yaml << _EOC_ ``` -> It seems to me that variable should be used also in exec command show above, which would look like: ``` exec /usr/local/openresty/bin/openresty -p ${PREFIX} -g 'daemon off;' ``` If change is needed, must be done in all `docker-entrypoint.sh` files in Git repository. ### Issue 3: add recommendation for Linux distribution to be used Samples in FAQ for standalone mode propose different distributions. Official Helm Chart uses debian based docker image -> Suggestion: clarify in FAQ what should be recommended distribution. Seems logical to me it should be same one as Helm Charts. Also if any specifics are required they should be clear. ### Issue 4: remark about not same user (root VS apisix) used depending on Linux distribution I noticed that for some Docker images, the `root` user is used, such as centos. For others the `apisix` user is used, such as for debian. This could lead to different behavior since user rights are different, so something that would work in centos Docker image would fail in debian one. -> Suggestion: use applicative `apisix` in all Docker images Probably this issue should be created in apache/apisix-docker repository, but I wanted to mention it here for people who have same issues as I had. Let me know if I should move it. ### Issue 5: confusing volume name in sample Kubernetes sample files It seems to me the volume name `apisix-admin` is confusing. In fact it contains the gateway routes configuration. It could be mistaken with something related to the Apisix admin API. See samples at https://github.com/apache/apisix-helm-chart/blob/master/docs/en/latest/FAQ.md#how-to-install-apache-apisix-running-in-standalone-mode ``` volumes: [...] - configMap: name: apisix.yaml name: **apisix-admin** ``` -> Suggestion: rename it, avoid `admin`. Naming proposals: `apisix-routes` or `apisix-routes-config` or `apisix-routes-config-yaml` Hope this helps ! Thank you all Team for your good work ! Sébastien -- 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: notifications-unsubscr...@apisix.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org