Skip to content

Instantly share code, notes, and snippets.

@frederickding
Created April 9, 2025 00:57
Show Gist options
  • Save frederickding/8ce0ad804904ad9f479367db79f96228 to your computer and use it in GitHub Desktop.
Save frederickding/8ce0ad804904ad9f479367db79f96228 to your computer and use it in GitHub Desktop.
etcdctl wrapper for k0s controllers
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "Please run as root."
exit 2
fi
PKI_DIR=/var/lib/k0s/pki/etcd
export ETCDCTL_CACERT=$PKI_DIR/ca.crt
export ETCDCTL_CERT=$PKI_DIR/peer.crt
export ETCDCTL_KEY=$PKI_DIR/peer.key
exec /usr/local/bin/etcdctl $@
@frederickding
Copy link
Author

Use case: sudo k0s-etcdctl endpoint status --cluster --write-out=table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment