Running k8s-master and k8s-worker on the same machine


#1

Is it possible to run the k8s master and worker on the same machine? I’m using MAAS as a coordinator for my physical machine and it seems a bit overkill to need 10 machines to be able to run a fairly redundant k8s setup using juju deploy charmed-kubernetes.

More specifically, can this be done with using Calico as the CNI plugin? All of my attempts to get this up and running have failed and I would really like to use juju to control my k8s deployment since I’m also using it for my ceph deployment.

Thanks in advance!


#2

I’ve managed to make this work (although not painlessly) by running the kubernetes-master as an lxd container on the worker machine.
One thing to keep in mind when doing this is that a new lxd profile needs to be created in order for the calico-node container to run. The problem is raised here: Bug #1831249 “[docker] Unable to run kubernetes-master with cali...” : Bugs : Calico Charm and a solution is discussed here: LXD profile updates permitted by charms specification

What I had to do was to download the kubernetes-worker charm files (zip) from the charm store and add an lxd-profile.yaml file found here: https://raw.githubusercontent.com/conjure-up/spells/master/charmed-kubernetes/steps/00_process-providertype/lxd-profile.yaml


#3

Thanks for reporting that you’ve managed to figure this out.


#4

@mrdmn Thanks for posting. When Charmed Kubernetes 1.16 comes out (planned for next week), this pain will go away, as the 1.16 charms embed the appropriate lxd profiles, which are then applied by Juju automatically. If you want to try this today you can used the bundle from the edge channel.


#5

Great news! Thank you. Is there an option to specify the channel in the bundle.yaml file or do I just need to use juju deploy ./my-bundle.yaml --channel=edge to test it out?


#6

You can do juju deploy charmed-kubernetes --channel edge, or if you want to modify the edge bundle, you can download it first (from https://api.jujucharms.com/charmstore/v5/bundle/charmed-kubernetes/archive/bundle.yaml?channel=edge), modify it locally, and then juju deploy ./my-bundle.yaml.