-
Notifications
You must be signed in to change notification settings - Fork 20
SwarmKit setup and Demos
In this Notes i'am going to show how to setup swarmkit and deploy a simple image on swarmkit
Pre-req are vagrant and docker installed on your machine
git clone https://github.com/debianmaster/openshift-playground.git
cd openshift-playground
./up.sh # This command should spin up 3 vms
./copykeys.sh # This should copy your ssh keys to the running centos images
# On each server
ssh [email protected]
ssh [email protected]
ssh [email protected]
sudo su
yum erase -y docker-1.9.1-40.el7.centos.x86_64
yum erase -y docker-common-1.9.1-40.el7.centos.x86_64
yum erase -y docker-selinux-1.9.1-40.el7.centos.x86_64
curl -sSL https://experimental.docker.com/ | sh
git clone https://github.com/docker/swarmkit.git
docker run -it -v `pwd`/swarmkit:/go/src/github.com/docker/swarmkit golang:1.6 /bin/bash
root@9678dhje7bbc:/go# cd /go/src/github.com/docker/swarmkit/
root@9678dhje7bbc:/go/src/github.com/docker/swarmkit# make binaries
root@9678dhje7bbc:/go/src/github.com/docker/swarmkit# exit
scp -r `pwd`/swarmkit/bin [email protected]:/tmp/bin
scp -r `pwd`/swarmkit/bin [email protected]:/tmp/bin
scp -r `pwd`/swarmkit/bin [email protected]:/tmp/bin
cd master1
vagrant ssh
cd /tmp/bin
./swarmd -d /tmp/master1 --listen-control-api /tmp/master1/swarm.sock --listen-remote-api 192.168.11.10:4242 --hostname master1 ## Manager creation
cd node11
vagrant ssh
cd /tmp/bin
./swarmd -d /tmp/node1 --listen-control-api /tmp/node1/swarm.sock --listen-remote-api 192.168.11.11:4242 --hostname node1 --join-addr 192.168.11.10:4242 #node
cd node2
vagrant ssh
cd /tmp/bin
./swarmd -d /tmp/node2 --listen-control-api /tmp/node2/swarm.sock --listen-remote-api 192.168.11.12:4242 --hostname node2 --join-addr 192.168.11.10:4242 #node
cd master1
vagrant ssh
cd /tmp/bin
export SWARM_SOCKET=/tmp/master1/swarm.sock
./swarmctl service create --name welcome --image veermuchandi/welcome
./swarmctl task ls ## see list of tasks
./swarmctl node ls ## see list of hosts joined
worker -- node --- can be promoted to manager manager -- master -- raft algo -- no centralized db task -- pod (may not be 100% true) service -- service
Swarmkit ~ API server + Etcd + Deployment Controller (in k8s)
Mutual TLS -- rotated certs -- min 30 1st master will create certs
replicas rolling updates scheduling evac, pause, unpause secure auth
spec -- no file spec yet loadbalancing -- not clear yet --- Built-in Virtual-IP based internal and ingress load-balancing using IPVS upgrades -- how to stop missng logs -- no way to see
Swarmctl --> Swarmd --> DockerEngine Swarmctl/swarm is embedded inside docker client in 1.12
on master (master.example.com)
--> docker swarm init
on node --> docker swarm join master.example.com:4777