how to configure kubernetes on localhost

  • installing kubernetes on localhost using LXD container as kubernetes node

– with conjure-up
– with manual installation

  • install conjure-up
sudo apt remove lxd
sudo snap install lxd
sudo snap install conjure-up --classic

storage should be ‘dir’ during ‘lxd init’ since kubernetes-core which is kubernetes on lxd in case of local installation only
works on dir storage type these days.

remove lxd and reinstall lxd with snap since snap installed from apt causes error when deploying local kubernetes, aka. kubernetes-core on lxd.

  • install kubernetes
swapon --show
sudo swapoff -a
sudo lxd init
conjure-up kubernetes

turn off all swap on all node.
kublet does now work properly when swap is used on kubernetes node. to permantly disable swap, comment out a swap partition/file line of /etc/fstab.

conjure-up does not support IPv6 yet, so choose none/false for IPv6 when you execute ‘lxd init’.

selections during kubernetes installation
Canonical Distribution of Kubernetes
JFrog Artifactory

how to role back or de-conjure-up if you encounter error
conjure-down [kubernetes]
juju models
juju destroy-model <model-name>
juju controllers
juju destroy-controller <controller-name>

if you cannot destroy model or controller, try to ‘juju kill-controller’ or ‘juju unregister’.

  • how to reconfigure LXD networking
lxc network set lxdbr0 ipv6.nat false
lxc network set lxdbr0 ipv6.address none
lxc network delete lxdbr0
lxc network create lxdbr0 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false
lxc network edit lxdbr0
lxc network show lxdbr0

  • how to generate a new config file
kubectl --kubeconfig=~/.kube/config.conjure-up


endless waiting of kubernetes’ master and worker nodes when using conjure-up

Leave a Reply

Your email address will not be published. Required fields are marked *