Skip to content

Instantly share code, notes, and snippets.

@frederickding
Created February 9, 2025 23:01
Show Gist options
  • Save frederickding/8233c62ec79326279daa1fb7c91bff91 to your computer and use it in GitHub Desktop.
Save frederickding/8233c62ec79326279daa1fb7c91bff91 to your computer and use it in GitHub Desktop.
etcdctl wrapper for rke2 nodes
#!/bin/bash
export CRI_CONFIG_FILE=/var/lib/rancher/rke2/agent/etc/crictl.yaml
/var/lib/rancher/rke2/bin/crictl "$@"
#!/bin/bash
export CRI_CONFIG_FILE=/var/lib/rancher/rke2/agent/etc/crictl.yaml
etcdcontainer=$(/var/lib/rancher/rke2/bin/crictl ps --label io.kubernetes.container.name=etcd --quiet)
/var/lib/rancher/rke2/bin/crictl exec $etcdcontainer etcdctl --cert /var/lib/rancher/rke2/server/tls/etcd/server-client.crt --key /var/lib/rancher/rke2/server/tls/etcd/server-client.key --cacert /var/lib/rancher/rke2/server/tls/etcd/server-ca.crt "$@"
@frederickding
Copy link
Author

Use case: sudo 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