Skip to content

brandond/k3s-dump-bootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k3s-dump-bootstrap

Decrypts and dumps K3s bootstrap data read from stdin.

Note: <token> parameter should be just the bare passphrase, not a full K10-format token including the cluster CA hash.

Example usage:

  1. go get github.com/brandond/k3s-dump-bootstrap
  2. mysql --host=dbhost --user=root --password=password --silent --skip-column-names k3s -e 'SELECT CONVERT(value USING utf8) FROM kine WHERE deleted=0 AND name LIKE "/bootstrap/%" ORDER BY id DESC LIMIT 1' | k3s-dump-bootstrap --decrypt token
  3. view values on formated output, a file named rawdata.dump contains the raw data
  4. modify the rawdata.dump like PasswdFile entry (base64 -d <value>; base64 -w0 <value>)
  5. encrypt the content cat rawdata.dump |k3s-dump-bootstrap --encrypt token
  6. the output can by write to the database: UPDATE kine set value = CONVERT("<output>" USING utf8) WHERE name = "/bootstrap/xxxxx";
  7. systemctl restart k3s.service to verify

About

k3s-dump-bootstrap

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages