Skip to content

Instantly share code, notes, and snippets.

@thebsdbox
Last active February 13, 2019 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebsdbox/f12b621a9d3943128b6bb16688497cd0 to your computer and use it in GitHub Desktop.
Save thebsdbox/f12b621a9d3943128b6bb16688497cd0 to your computer and use it in GitHub Desktop.
Example deployment map for plunder
{
"deployments": [
{
"name": "Configure host OS for kubernetes nodes",
"parallel": true,
"sessions": 0,
"hosts": [
"192.168.1.3",
"192.168.1.4",
"192.168.1.5",
"192.168.1.6",
"192.168.1.7",
"192.168.1.8",
"192.168.1.9",
"192.168.1.10"
],
"actions": [
{
"name": "Upload Ubuntu Packages",
"type": "upload",
"source": "./ubuntu_pkg.tar.gz",
"destination": "/tmp/ubuntu_pkg.tar.gz"
},
{
"name": "Extract Ubuntu packages",
"type": "command",
"command": "tar -C /tmp -xvzf /tmp/ubuntu_pkg.tar.gz"
},
{
"name": "Install Ubuntu packages",
"type": "command",
"command": "dpkg -i /tmp/socat* /tmp/ethtool* /tmp/ebtables*",
"commandSudo": "root"
},
{
"name": "Upload Docker Packages",
"type": "upload",
"source": "./docker_pkg.tar.gz",
"destination": "/tmp/docker_pkg.tar.gz"
},
{
"name": "Extract Docker packages",
"type": "command",
"command": "tar -C /tmp -xvzf /tmp/docker_pkg.tar.gz"
},
{
"name": "Install Docker packages",
"type": "command",
"command": "dpkg -i /tmp/docker/*",
"commandSudo": "root"
}
]
},
{
"name": "Manage Kubernetes images",
"parallel": false,
"sessions": 0,
"hosts": [
"192.168.1.3",
"192.168.1.4",
"192.168.1.5",
"192.168.1.6",
"192.168.1.7",
"192.168.1.8",
"192.168.1.9",
"192.168.1.10"
],
"actions": [
{
"name": "Push Pause container",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageFile": "~/1.12.4/kubernetes1.12.4/images/pause-3.1.tar.gz",
"imageName": "gcr.io//pause:3.1",
"remoteSudo": true,
"imageRetag": "k8s.gcr.io/pause:3.1",
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push cloud controller",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageFile": "~/1.12.4/kubernetes1.12.4/images/cloud-controller-manager1.12.4.tar.gz",
"imageName": "gcr.io//cloud-controller-manager:v1.12.4",
"remoteSudo": true,
"imageRetag": "k8s.gcr.io/cloud-controller-manager:v1.12.4",
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push e2e test container",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageFile": "~/1.12.4/kubernetes1.12.4/images/e2e-test1.12.4.tar.gz",
"imageName": "gcr.io//e2e-test:v1.12.4",
"remoteSudo": true,
"imageRetag": "k8s.gcr.io/e2e-test:v1.12.4",
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push kube-api server",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageFile": "~/1.12.4/kubernetes1.12.4/images/kube-apiserver1.12.4.tar.gz",
"imageName": "gcr.io//kube-apiserver:v1.12.4",
"remoteSudo": true,
"imageRetag": "k8s.gcr.io/kube-apiserver:v1.12.4",
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push kube controller-manager",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageFile": "~/1.12.4/kubernetes1.12.4/images/kube-controller-manager1.12.4.tar.gz",
"imageName": "gcr.io//kube-controller-manager:v1.12.4",
"remoteSudo": true,
"imageRetag": "k8s.gcr.io/kube-controller-manager:v1.12.4",
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push kube proxy",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageFile": "~/1.12.4/kubernetes1.12.4/images/kube-proxy1.12.4.tar.gz",
"imageName": "gcr.io//kube-proxy:v1.12.4",
"remoteSudo": true,
"imageRetag": "k8s.gcr.io/kube-proxy:v1.12.4",
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push kube scheduler",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageFile": "~/1.12.4/kubernetes1.12.4/images/kube-scheduler1.12.4.tar.gz",
"imageName": "gcr.io//kube-scheduler:v1.12.4",
"remoteSudo": true,
"imageRetag": "k8s.gcr.io/kube-scheduler:v1.12.4",
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push etcd image",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageFile": "~/1.12.4/etcd3.2.24/images/etcd3.2.24.tar.gz",
"imageName": "gcr.io//etcd:v3.2.24",
"remoteSudo": true,
"imageRetag": "k8s.gcr.io/etcd:3.2.24",
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push coredns image",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageFile": "~/1.12.4/coredns1.2.2/images/coredns1.2.2.tar.gz",
"imageName": "gcr.io//coredns:v1.2.2",
"remoteSudo": true,
"imageRetag": "k8s.gcr.io/coredns:1.2.2",
"username": "ubuntu",
"disableSSHSecurity": true
}
}
]
},
{
"name": "Upload the Debian packages",
"parallel": true,
"sessions": 0,
"hosts": [
"192.168.1.3",
"192.168.1.4",
"192.168.1.5",
"192.168.1.6",
"192.168.1.7",
"192.168.1.8",
"192.168.1.9",
"192.168.1.10"
],
"actions": [
{
"name": "Create /tmp/_debs",
"type": "command",
"command": "mkdir /tmp/_debs"
},
{
"name": "Upload cri-tools",
"type": "upload",
"source": "/home/dan/1.12.4/debs/cri-tools_1.12.0-1_amd64.deb",
"destination": "/tmp/_debs/cri-tools_1.12.0-1_amd64.deb"
},
{
"name": "Upload Kubeadm",
"type": "upload",
"source": "/home/dan/1.12.4/debs/kubeadm_1.12.4-1_amd64.deb",
"destination": "/tmp/_debs/kubeadm_1.12.4-1_amd64.deb"
},
{
"name": "Upload Kubectl Packages",
"type": "upload",
"source": "/home/dan/1.12.4/debs/kubectl_1.12.4-1_amd64.deb",
"destination": "/tmp/_debs/kubectl_1.12.4-1_amd64.deb"
},
{
"name": "Upload Kubelet Packages",
"type": "upload",
"source": "/home/dan/1.12.4/debs/kubelet_1.12.4-1_amd64.deb",
"destination": "/tmp/_debs/kubelet_1.12.4-1_amd64.deb"
},
{
"name": "Upload Kubernetes CNI",
"type": "upload",
"source": "/home/dan/1.12.4/debs/kubernetes-cni_0.6.0-1_amd64.deb",
"destination": "/tmp/_debs/kubernetes-cni_0.6.0-1_amd64.deb"
},
{
"name": "Install kubernetes debian packages",
"type": "command",
"command": "dpkg -i /tmp/_debs/*",
"commandSudo": "root"
},
{
"name": "Remove /tmp/_debs",
"type": "command",
"command": "rm -rf /tmp/_debs",
"commandSudo": "root"
}
]
},
{
"name": "Configure ETCd",
"parallel": false,
"sessions": 0,
"hosts": [
"192.168.1.3"
],
"actions": [
{
"name": "Deploying etcd certificates",
"type": "kubeadm/etcd",
"plugin": {
"hostname1": "etcd01",
"hostname2": "etcd02",
"hostname3": "etcd03",
"address1": "192.168.1.3",
"address2": "192.168.1.4",
"address3": "192.168.1.5",
"initCa": true
}
},
{
"name": "Starting first etcd node",
"type": "command",
"command": "kubeadm init phase etcd local --config=/tmp/192.168.1.3/kubeadmcfg.yaml",
"commandSudo": "root"
}
]
},
{
"name": "Configure ETCd node02",
"parallel": false,
"sessions": 0,
"hosts": [
"192.168.1.4"
],
"actions": [
{
"name": "Upload etcd configuration for node02",
"type": "upload",
"source": "/tmp/192.168.1.4.tar.gz",
"destination": "/tmp/192.168.1.4-k8s.tar.gz"
},
{
"name": "Expanding configuration archive",
"type": "command",
"command": "tar -C / -xvzf /tmp/192.168.1.4-k8s.tar.gz",
"commandSudo": "root"
},
{
"name": "Starting second etcd node",
"type": "command",
"command": "kubeadm init phase etcd local --config=/tmp/192.168.1.4/kubeadmcfg.yaml",
"commandSudo": "root"
}
]
},
{
"name": "Configure ETCd node03",
"parallel": false,
"sessions": 0,
"hosts": [
"192.168.1.5"
],
"actions": [
{
"name": "Upload etcd configuration for node02",
"type": "upload",
"source": "/tmp/192.168.1.5.tar.gz",
"destination": "/tmp/192.168.1.5-k8s.tar.gz"
},
{
"name": "Expanding configuration archive",
"type": "command",
"command": "tar -C / -xvzf /tmp/192.168.1.5-k8s.tar.gz",
"commandSudo": "root"
},
{
"name": "Starting second etcd node",
"type": "command",
"command": "kubeadm init phase etcd local --config=/tmp/192.168.1.5/kubeadmcfg.yaml",
"commandSudo": "root"
}
]
},
{
"name": "Deploy first control plane node",
"parallel": false,
"hosts": [
"192.168.1.6"
],
"actions": [
{
"name": "Deploy first control plane node",
"type": "kubeadm/mgmt",
"mgmt": {
"etcd01": "192.168.1.3",
"etcd02": "192.168.1.4",
"etcd03": "192.168.1.5",
"version": "stable",
"unstacked": true,
"lbPort": 6443,
"lbHostname": "192.168.1.6"
}
}
]
},
{
"name": "Reset master node",
"parallel": false,
"sessions": 0,
"hosts": [
"192.168.1.6"
],
"actions": [
{
"name": "Perform a kubeadm reset",
"type": "command",
"command": "kubeadm reset -f",
"commandSudo": "root"
}
]
},
{
"name": "Configure Single Master Node",
"parallel": false,
"sessions": 0,
"hosts": [
"192.168.1.6"
],
"actions": [
{
"name": "Perform a kubeadm init",
"type": "command",
"command": "kubeadm init --kubernetesersion \"v1.12.4\" --pod-network-cidr=172.16.0.0/16",
"commandSudo": "root"
},
{
"name": "Create a kubeconfig folder",
"type": "command",
"command": "mkdir -p $HOME/.kube"
},
{
"name": "Copy the kubeconfig",
"type": "command",
"command": "sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config",
"commandSudo": "root"
},
{
"name": "Ensure config has correct permissions",
"type": "command",
"command": "sudo chown $(id -u):$(id -g) $HOME/.kube/config",
"commandSudo": "root"
},
{
"name": "Generate a join token for workers",
"type": "command",
"command": "kubeadm token create --print-join-command 2>/dev/null",
"commandSaveAsKey": "joinKey"
}
]
},
{
"name": "Deploy Calico",
"parallel": false,
"sessions": 0,
"hosts": [
"192.168.1.3",
"192.168.1.4",
"192.168.1.5",
"192.168.1.6",
"192.168.1.7",
"192.168.1.8",
"192.168.1.9",
"192.168.1.10"
],
"actions": [
{
"name": "Push calico cni image",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageName": "calico/cni:v3.5.1",
"localSudo" :true,
"remoteSudo": true,
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push calico node image",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageName": "calico/node:v3.5.1",
"localSudo" :true,
"remoteSudo": true,
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push calico kube-controllers image",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageName": "calico/kube-controllers:v3.5.1",
"localSudo" :true,
"remoteSudo": true,
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Push calico etcd image",
"type": "docker/image",
"timeout": 0,
"plugin": {
"imageName": "quay.io/coreos/etcd:v3.3.9",
"localSudo" :true,
"remoteSudo": true,
"username": "ubuntu",
"disableSSHSecurity": true
}
},
{
"name": "Upload Calico etcd Manifest",
"type": "upload",
"source": "/home/dan/etcd.yaml",
"destination": "/tmp/etcd.yaml"
},
{
"name": "Import Calico etcd manifset",
"type": "command",
"command": "kubectl apply -f /tmp/etcd.yaml"
},
{
"name": "Upload calico Manifest",
"type": "upload",
"source": "/home/dan/calico.yaml",
"destination": "/tmp/calico.yaml"
},
{
"name": "Import Calico manifset",
"type": "command",
"command": "kubectl apply -f /tmp/calico.yaml"
}
]
},
{
"name": "Join Node(s) to cluster",
"parallel": false,
"sessions": 0,
"hosts": [
"192.168.1.7",
"192.168.1.8"
],
"actions": [
{
"name": "Join Kubernetes Cluster",
"type": "command",
"keyName": "joinKey",
"commandSudo": "root"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment