Created
          April 9, 2025 00:57 
        
      - 
      
- 
        Save frederickding/8ce0ad804904ad9f479367db79f96228 to your computer and use it in GitHub Desktop. 
    etcdctl wrapper for k0s controllers
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/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 $@ | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Use case:
sudo k0s-etcdctl endpoint status --cluster --write-out=table