Skip to content

Commit

Permalink
Wrapper for etcdctl/etcd v3 query.
Browse files Browse the repository at this point in the history
  • Loading branch information
gengwg committed Jan 24, 2023
1 parent 35be979 commit a623e33
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions etcd/etcdctl-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# Wrapper for etcdctl/etcd v3 query.
# Usage Example:
# ./etcdctl-wrapper.sh endpoint status --cluster
# ./etcdctl-wrapper.sh -w members list

ETCD_CERT_FILE="/var/lib/kubernetes/etcd.pem"
ETCD_KEY_FILE="/var/lib/kubernetes/etcd.key"
ETCD_TRUSTED_CA_FILE="/etc/pki/ca-trust/tls-ca-bundle.pem"
# List all endpoints
ETCDRUN_ENDPOINTS="https://kubectrlplane101.example.com:2379,https://kubectrlplane102.example.com:2379,https://kubectrlplane103.example.com:2379"
sudo ETCDCTL_API=3 etcdctl --cert=$ETCD_CERT_FILE --cacert=$ETCD_TRUSTED_CA_FILE --key=$ETCD_KEY_FILE --endpoints=$ETCDRUN_ENDPOINTS $*

0 comments on commit a623e33

Please sign in to comment.