Closed jocafi closed 1 day ago
Hi @jocafi,
Several things to consider about your use case:
ETCDCTL_API
is used along with the command etcdctl
( e.g ETCDCTL_API=2 etcdctl ...
), but in your case you are using curl
.ETCD_ENABLE_V2=true
(or alternatively the --enable-v2
flag).As mentioned, by adding ETCD_ENABLE_V2=true
to the etcd container you should be able to use the /v2
API:
~ $ curl http://etcd1:2379/v2/keys
{"action":"get","node":{"dir":true}}
Many thanks @migruiz4 for the detailed explanation.
I replaced "ETCDCTL_API=2" by "ETCD_ENABLE_V2=true" and it worked. Now I do not get the error "404 page not found".
Please update the documentation at https://hub.docker.com/r/bitnami/etcd
My error comes from the information there. There is not mention about "ETCD_ENABLE_V2" and "ETCDCTL_API" seems no to work.
Feel free to close this ticket. Thanks again!
Name and Version
docker.io/bitnami/etcd:3.5.13
What architecture are you using?
amd64
What steps will reproduce the bug?
To reproduce the error, deploy the docker containers below on any swarm environment:
First, create the network:
docker network create --driver overlay net-postgres
Enter into the 'curl' container. For example:
Show the version:
Try some v2 commands described at https://etcd.io/docs/v2.3/api/ Example:
Here is also another example of how to reproduce the error: https://github.com/zalando/spilo/issues/995
What is the expected behavior?
When using the option ETCDCTL_API=2, the etcd server should be compatible with the v2 API as described at https://hub.docker.com/r/bitnami/etcd and https://etcd.io/docs/v2.3/api/
What do you see instead?
I get HTTP-Status 404: 404 page not found