Skip to content

Latest commit

 

History

History
126 lines (87 loc) · 3.14 KB

USAGE.md

File metadata and controls

126 lines (87 loc) · 3.14 KB

🍔 kopsrox usage

documentation is a WIP 🚧

🌀 image

✅ create

  • downloads the cloud image from the url defined in kopsrox.ini
  • installs qemu-guest-agent into the image via virt-customise
  • imports the disk into proxmox storage using a sudo qm command
  • creates cloudinit drive with cloudinit data per config
  • converts the vm into a template

update

  • an alias for create

⚠️ destroy

  • deletes any existing image template

info

  • prints info about image/template vm eg storage, id, creation time and source cloud image file
  • size
  • creation time
  • is it stored on shared storage

🌀 cluster

✅ create

  • creates and updates a cluster - use this to setup a fresh cluster
  • if an existing working master is found it runs the same steps as kopsrox cluster update
  • clones the image to the '-m1' server and configures networking via cloudinit
  • exports kubeconfig and node token

update

  • checks the state of the cluster vs what is configured in kopsrox.ini
  • updates the cluster ( eg adding / deleting nodes ) as required

info

  • shows a list of ids, hostnames and ips the host they are running on
  • shows kubectl get nodes

⚠️ destroy

  • destroys the cluster ( NO WARNING! )
  • deletes workers then masters in safe order

🌀 k3s

k3stoken

  • exports the clusters k3s token

kubeconfig

  • export the cluster kubeconfig to a file
  • file is patched to have correct VIP IP vs 127.0.0.1

check-config

  • runs k3s check-config and displays the output

kubectl

  • provides a quick and basic way to run some kubectl commands for example:

./kopsrox.py k3s kubectl get events -A

🌀 etcd

✅ snapshot

./kopsrox.py etcd snapshot

Takes a backup of etcd

./kopsrox.py etcd list

Should show the new backup

list

./kopsrox.py etcd list

  • lists snapshots taken in s3 storage based on cluster name

restore

restores a cluster from a previously taken s3 snapshot

usage:

./kopsrox.py etcd restore $imagename

  • downsizes the cluster to 1 node then resizes back to the scale set in kopsrox.ini

restore-latest

  • restores the cluster from the latest snapshot in the configured s3 storage

prune

  • deletes old snapshots per the retention policy set on the bucket

🌀 node

⚠️ destroy [hostname]

  • destroys the passed vm hostname ( NO WARNING )

✅ utility

  • creates a spare "utility" node -u1

terminal [hostname]

  • connects you to the passed vm's serial console via qm terminal

ssh [hostname]

  • connect via ssh to a kopsrox cluster vm
  • uses configured cloudinit user as username
  • requires working ssh key configured in config

reboot [hostname]

  • reboots the host

k3s-uninstall [hostname]

  • uninstalls k3s using the usual script
  • for experimenting with k3s reinstall

🌀 kubevip

reinstall

  • reinstalls kubevip