This repository contains the code of the cluster agent service used in MicroK8s.
The microk8s cluster agent requires Go. Install Go with:
sudo snap install go --classic
Run all tests with:
make go.fmt go.lint go.test go.vet go.staticcheck
make cluster-agent
./cluster-agent --help
cd cluster-agent
sudo snap download microk8s --basename=microk8s
sudo unsquashfs ./microk8s.snap
sudo chown -R 1000: squashfs-root
sudo sed 's,$SNAP/bin/cluster-agent,go run '"$PWD"',' -i squashfs-root/run-cluster-agent-with-args
# development iteration
sudo snap restart microk8s.daemon-cluster-agent
export [email protected]
ssh $HOST '
sudo snap download microk8s --basename=microk8s
sudo unsquashfs microk8s.snap
sudo chown -R 1000: squashfs-root
sudo snap try ./squashfs-root
'
# development iteration
go build .
ssh $HOST 'sudo snap stop microk8s.daemon-cluster-agent'
scp ./microk8s-cluster-agent $HOST:squashfs-root/bin/cluster-agent
ssh $HOST 'sudo snap start microk8s.daemon-cluster-agent'