Skip to content

Instantly share code, notes, and snippets.

@mbukatov
Last active October 12, 2017 15:57
Show Gist options
  • Select an option

  • Save mbukatov/65ea436e16ec2dc6dce6ebc9e17f0208 to your computer and use it in GitHub Desktop.

Select an option

Save mbukatov/65ea436e16ec2dc6dce6ebc9e17f0208 to your computer and use it in GitHub Desktop.

Using etcd directly.

Without authentication

etcdctl --endpoints http://${HOSTNAME}:2379 ls /

Enabling password based authentication

etcdctl --endpoints http://${HOSTNAME}:2379 user add root:eJAGqhLpxVfYEaYTGvZkeGzdkshYFb
etcdctl --endpoints http://${HOSTNAME}:2379 auth enable
etcdctl --endpoints http://${HOSTNAME}:2379 --username root:eJAGqhLpxVfYEaYTGvZkeGzdkshYFb role remove guest
etcdctl --endpoints http://${HOSTNAME}:2379 --username root:eJAGqhLpxVfYEaYTGvZkeGzdkshYFb ls /

With tls based auth

Using etcdctl:

etcdctl --ca-file /etc/pki/tls/certs/ca-usmqe.crt --cert-file /etc/pki/tls/certs/etcd.crt --key-file /etc/pki/tls/private/etcd.key --endpoints https://${HOSTNAME}:2379 ls /

Using curl:

curl --cacert /etc/pki/tls/certs/ca-usmqe.crt --cert /etc/pki/tls/certs/etcd.crt --key /etc/pki/tls/private/etcd.key https://mbukatov-usm1-server.example.com:2379/v2/keys/
curl --cacert /etc/pki/tls/certs/ca-usmqe.crt --cert /etc/pki/tls/certs/etcd.crt --key /etc/pki/tls/private/etcd.key https://10.37.169.90:2379/v2/keys/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment