WKS and Footloose

  1. Pick a distro of your choice:

    1. centos7 (At the moment of writing, centos7 is more mature)

    2. ubuntu1804

    export DISTRO=centos7
  2. Pick a backend of your choice:

    1. docker (not real VMs, but can be used on Mac)

    2. ignite (requires Ignite to be installed, and KVM functioning)

    export BACKEND=docker
  3. Install footloose:

    GO111MODULE=on go install github.com/weaveworks/footloose
  4. Start two machines using footloose:

    $ footloose create -c ${DISTRO}/${BACKEND}/singlemaster.yaml
    INFO[0000] Image: quay.io/footloose/centos7 present locally
    INFO[0000] Creating machine: cluster-node0 ...
    INFO[0001] Creating machine: cluster-node1 ...

    You should now see the Container Machines running with docker ps or ignite ps (depending on your backend):

    $ docker ps
    CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS              PORTS                                          NAMES
    ab4f4b75f63d        quay.io/wksctl/vm-centos7 "/sbin/init"        5 seconds ago         Up 4 seconds>22/tcp,>6443/tcp   cluster-node1
    0ce280129e79        quay.io/wksctl/vm-centos7 "/sbin/init"        6 seconds ago         Up 5 seconds>6443/tcp,>22/tcp   cluster-node0


    $ ignite ps
    3fbe4611682b3e16	weaveworks/ignite-centos:latest	weaveworks/ignite-kernel:4.19.47	4.0 GB	2	1024.0 MB	10m ago	Up 10m>30443/tcp,>30080/tcp,>22/tcp,>6443/tcp	centos-singlemaster-node1
    b4fdde36eb122804	weaveworks/ignite-centos:latest	weaveworks/ignite-kernel:4.19.47	4.0 GB	2	1024.0 MB	10m ago	Up 10m>22/tcp,>6443/tcp,>30443/tcp,>30080/tcp	centos-singlemaster-node0

    In case you would like to ssh into a machine e.g. node0, run:

    footloose ssh -c ${DISTRO}/${BACKEND}/singlemaster.yaml root@node0

    as the default user name is root for both backends.

  5. Run wksctl apply:

    wksctl apply \
     --machines=machines.yaml \
     --cluster=cluster.yaml \
  6. Run wksctl kubeconfig to be able to connect to the cluster:

    $ wksctl kubeconfig --cluster=cluster.yaml
    To use kubectl with the example cluster, enter:
    export KUBECONFIG=$HOME/.wks/weavek8sops/example/kubeconfig
    $ export KUBECONFIG=/home/lucas/.wks/weavek8sops/example/kubeconfig
    $ kubectl get nodes
    NAME               STATUS   ROLES    AGE   VERSION
    b4fdde36eb122804   Ready    master   77s   v1.14.1
    $ kubectl get pods --all-namespaces
    NAMESPACE     NAME                              READY   STATUS    RESTARTS   AGE
    kube-system   coredns-86c58d9df4-26gv9          1/1     Running   0          55s
    kube-system   coredns-86c58d9df4-mb4h9          1/1     Running   0          55s
    kube-system   etcd-13e2dc14bf30                 1/1     Running   0          6s
    kube-system   kube-apiserver-13e2dc14bf30       1/1     Running   0          8s
    kube-system   kube-proxy-l2fv7                  1/1     Running   0          55s
    kube-system   kube-scheduler-13e2dc14bf30       1/1     Running   0          9s
    kube-system   weave-net-n7lqb                   2/2     Running   0          55s
    system        wks-controller-654d7cfb7c-47f9g   1/1     Running   0          54s


Follow the above steps, but pass the multi-master manifests:

footloose create -c ${DISTRO}/${BACKEND}/multimaster.yaml
$ wksctl apply \
    --machines=machines-multimaster.yaml \
    --cluster=cluster.yaml \