The Docker service can be started in antMan via the Services page, accessible on the sidebar
From here you can start the Docker service. Check the 'Autostart' checkbox to have Docker start when the Antsle is rebooted.
Docker can be run at the Antsle's command line. Simply connect to the antsleOS via ssh and test docker by running dockers 'hello-world' image
docker run hello-world
This will download and run the 'hello-world' image in a container. It will print some text and exit.
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
Here's a guide on how to run an example service:
First, create (at least) two antlets out of the "Ubuntu 16.04 Kubernetes - KVM" template, and make sure hostnames are unique.
For our example, we're going to use Calico pod network, when running kubeadm init, you must run it like this: (use your network number)
sudo kubeadm init --pod-network-cidr=192.168.0.0/16
Then proceed with the output instructions and join the node as normal.
Next, you need to create the pod network, as we prepared it to use Calico, we run:
kubectl apply -f https://docs.projectcalico.org/v2.6/getting-started/kubernetes/installation/hosted/kubeadm/1.6/calico.yaml
Note: We have tested our changes with the Calico pod network, but it should work with other pod networks. Bare in mind that you must run some special flags for each when doing a kubeadm init. You can find the list of supported pod networks and their special flags here: https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#pod-network
Now you should be able to run your services with type "NodePort", here's an example:
kubectl run hello-world --replicas=2 --labels="run=load-balancer-example" --image=gcr.io/google-samples/node-hello:1.0 --port=8080
kubectl expose deployment hello-world --type=NodePort --name=example-service
Then look for the node port:
kubectl describe services example-service
Look for the NodePort line, it should look like:
NodePort: <unset> 30588/TCP
The service should be accessible on this port, in our exmaple it would be:
You need to use the IP address, for some reason using "localhost" won't work.
To call it from outside the antlet:
You should see an output like this:
"Hello Kubernetes!" is the output of our example service.