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
Graylog
Helm
JFrog Artifactory
Prometheus
Rancher
localhost


how to role back or de-conjure-up if you encounter error
conjure-down [kubernetes]
or
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

reference
https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/
https://developers.redhat.com/blog/2014/05/15/practical-introduction-to-docker-containers/
https://rhelblog.redhat.com/2015/07/29/architecting-containers-part-1-user-space-vs-kernel-space/
https://rhelblog.redhat.com/2015/09/17/architecting-containers-part-2-why-the-user-space-matters-2/

https://kubernetes.io/docs/concepts/
https://kubernetes.io/docs/tutorials/kubernetes-basics/
https://docs.conjure-up.io/stable/en/walkthrough
https://kubernetes.io/docs/getting-started-guides/ubuntu/local/
https://itnext.io/tutorial-part-1-kubernetes-up-and-running-on-lxc-lxd-b760c79cd53f
https://itnext.io/tutorial-part-2-kubernetes-up-and-running-on-lxc-lxd-6d60e98f22df
https://www.howtoforge.com/tutorial/how-to-install-kubernetes-on-ubuntu/

endless waiting of kubernetes’ master and worker nodes when using conjure-up
https://github.com/conjure-up/conjure-up/issues/1377

Leave a Reply

Your email address will not be published.