You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "jagedn (via GitHub)" <gi...@apache.org> on 2023/07/10 14:13:00 UTC
[GitHub] [apisix-docker] jagedn opened a new issue, #482: feat: if apisix.yaml file exists dont initialize it
jagedn opened a new issue, #482:
URL: https://github.com/apache/apisix-docker/issues/482
currently `apisix.yaml` file is initialized at startup in `docker-entrypoint.sh`
In case I would like to provide a configuration at startup time, and avoid to change it later, this is overwrite for the .sh
It would be great if the .sh check before if the file exists and don't overwrite in this case
--
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-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] nfrankel commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "nfrankel (via GitHub)" <gi...@apache.org>.
nfrankel commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1653557822
@jagedn I don't see the `docker-entrypoint.sh` you're mentioning.
Are you using the official [Apache APISIX Docker image](https://hub.docker.com/r/apache/apisix)?
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] moonming commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "moonming (via GitHub)" <gi...@apache.org>.
moonming commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1630064207
@kayx23 what do you think?
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] kamly commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "kamly (via GitHub)" <gi...@apache.org>.
kamly commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1655011662
> Currently this entrypoint overwrite our apisix.yaml so "my suggestion" is so simple as check if the file exists to avoid overwriting it
agree
i hope
```bash
#!/usr/bin/env bash
set -eo pipefail
PREFIX=${APISIX_PREFIX:=/usr/local/apisix}
if [[ "$1" == "docker-start" ]]; then
if [ "$APISIX_STAND_ALONE" = "true" ]; then
cat > ${PREFIX}/conf/config.yaml << _EOC_
deployment:
role: data_plane
role_data_plane:
config_provider: yaml
_EOC_
if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then
cat > ${PREFIX}/conf/apisix.yaml << _EOC_
routes:
-
#END
_EOC_
fi
/usr/bin/apisix init
else
/usr/bin/apisix init
/usr/bin/apisix init_etcd
fi
exec /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'
fi
exec "$@"
```
or remove overwrite `apisix.yaml`
```bash
#!/usr/bin/env bash
set -eo pipefail
PREFIX=${APISIX_PREFIX:=/usr/local/apisix}
if [[ "$1" == "docker-start" ]]; then
if [ "$APISIX_STAND_ALONE" = "true" ]; then
cat > ${PREFIX}/conf/config.yaml << _EOC_
deployment:
role: data_plane
role_data_plane:
config_provider: yaml
_EOC_
/usr/bin/apisix init
else
/usr/bin/apisix init
/usr/bin/apisix init_etcd
fi
exec /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'
fi
exec "$@"
```
@jagedn @nfrankel @shreemaan-abhishek
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] kamly commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "kamly (via GitHub)" <gi...@apache.org>.
kamly commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1653626805
> As far as I understand, the Dockefile uses `docker-entrypoint.sh` to manage standalone configuration.
Also a solution, replace the original `docker-entrypoint.sh`
But I prefer docker-entrypoint.sh to support this feature (avoid apisix.yaml coverage)
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] shreemaan-abhishek commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1655097345
@kamly I agree with you. @jagedn WDYT?
kamly, please go ahead and raise a PR, jagedn can review once the PR is ready.
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] shreemaan-abhishek commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1655070462
@jagedn, @kamly, now I understand the issue. Would you like to contribute to this fix?
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] kamly commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "kamly (via GitHub)" <gi...@apache.org>.
kamly commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1655078544
Which fix would be better?
I prefer remove overwrite `apisix.yaml`
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] kamly commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "kamly (via GitHub)" <gi...@apache.org>.
kamly commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1653533055
I have the same problem!!
example:
apisix.yaml
```
routes:
-
uri: /hello
upstream:
nodes:
"127.0.0.1:1980": 1
type: roundrobin
#END
```
docker-compoase.yaml
```
services:
apisix:
restart: always
image: "${IMAGE_APISIX}"
container_name: apisix
volumes:
- ./etc/apisix/apisix.yaml:/usr/local/apisix/conf/apisix.yaml
environment:
- TZ=Asia/Shanghai
- APISIX_STAND_ALONE=true
ports:
- "9180:9180/tcp"
- "9080:9080/tcp"
- "9091:9091/tcp"
- "9443:9443/tcp"
```
stand-alone deployment, with related routes configuration, want to overwrite apisix.yaml by mounting
run it , apisix.yaml will be overwritten
@shreemaan-abhishek
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] jagedn commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "jagedn (via GitHub)" <gi...@apache.org>.
jagedn commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1648794693
Hi sorry for the late response, I was offline prev week
So, the issue is not so related with kubernetes but with the dockerfile when standalone is enabled at docker-entrypoint.sh
docker-entrypoint.sh creates 2 default files at startup: config.yaml and apisix.yaml
What I would like from this sh is not to overwrite these files if they are present (at least not overwrite apisix.yaml). To do it I think is enough to check if file exists, something as:
```
if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then
cat > ${PREFIX}/conf/apisix.yaml << _EOC_
routes:
-
#END
_EOC_
fi
```
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] monkeyDluffy6017 closed issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 closed issue #482: feat: if apisix.yaml file exists dont initialize it
URL: https://github.com/apache/apisix-docker/issues/482
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] jagedn commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "jagedn (via GitHub)" <gi...@apache.org>.
jagedn commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1630193453
Let me add a little context
I'm deploying apisix in an small k8s cluster and don't want to use etcd so I deploying it as standalone. I would like to mount a config map wit routes but the .sh overwrite it so after every deployment I need to run a copy
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] github-actions[bot] commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1694625302
This issue has been marked as stale due to 30 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] jagedn commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "jagedn (via GitHub)" <gi...@apache.org>.
jagedn commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1653722391
yes, agree, or if required at least to have a minimal `docker-entrypoint.sh` starting required process and nothing more
To summarize the issue:
Imagine we want to run apisix in standalone mode and don't want to apply the configuration once started (as the documentation suggest running `docker exec -i apache-apisix sh -c 'cat > /usr/local/apisix/conf/apisix.yaml <<_EOC_`) because we want to provide the apisix.yaml in the deployment (via docker run, docker-compose, kubernetes or whatever)
Currently this entrypoint overwrite our apisix.yaml so "my suggestion" is so simple as check if the file exists to avoid overwriting it
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] moonming commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "moonming (via GitHub)" <gi...@apache.org>.
moonming commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1630060332
@Sn0rt please take a look
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] shreemaan-abhishek commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1649129909
> What I would like from this sh is not to overwrite these files
Why?
> In case I would like to provide a configuration at startup time
How?
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] jagedn commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "jagedn (via GitHub)" <gi...@apache.org>.
jagedn commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1653569890
> @jagedn I don't see the `docker-entrypoint.sh` you're mentioning.
>
> Are you using the official [Apache APISIX Docker image](https://hub.docker.com/r/apache/apisix)?
For example at https://github.com/apache/apisix-docker/blob/master/debian/docker-entrypoint.sh
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] shreemaan-abhishek commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1634403628
> In case I would like to provide a configuration at startup time
@jagedn, how do you intend to do that?
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] nfrankel commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "nfrankel (via GitHub)" <gi...@apache.org>.
nfrankel commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1653581695
As far as I understand, the Dockefile uses `docker-entrypoint.sh` to manage standalone configuration.
1. Are you using standalone?
2. If not, is it feasible to override `ENTRYPOINT` to just launch Apache APISIX, with etcd?
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-docker] nfrankel commented on issue #482: feat: if apisix.yaml file exists dont initialize it
Posted by "nfrankel (via GitHub)" <gi...@apache.org>.
nfrankel commented on issue #482:
URL: https://github.com/apache/apisix-docker/issues/482#issuecomment-1653639942
I think the `docker-entrypoint.sh` was a wrong idea. The Docker image shouldn't play havoc with the provided configuration files. Standalone is a matter of user configuration.
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org