-
-
Save wicadmin/95ca52ceffa8da8922a263475f698352 to your computer and use it in GitHub Desktop.
Revisions
-
tsertkov revised this gist
Jan 18, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,4 +29,4 @@ $ kubectl port-forward "$(kubectl get pods -l run=node-hello -o jsonpath='{.item ## cloud-config.full.1.7.yaml Same as cloud-config.full.yaml but for Kubernetes 1.7 -
tsertkov revised this gist
Jan 18, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,7 @@ It is assumed that `ubuntu` user is already created on the system. kubeadm k8s installation including: - superuser with admin priveleges - dashboard addon - fixes internet in pods ``` $ kubectl proxy -
tsertkov revised this gist
Jan 18, 2018 . 2 changed files with 8 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,14 +34,16 @@ write_files: - path: /etc/systemd/system/kubernetes-pods-enable-forward.service content: | [Unit] Description=Forward k8s pods network DefaultDependencies=false [Service] Type=oneshot RemainAfterExit=yes ExecStart=/sbin/iptables -A FORWARD -d 10.22.0.0/16 -j ACCEPT ExecStart=/sbin/iptables -A FORWARD -s 10.22.0.0/16 -j ACCEPT ExecStop= [Install] WantedBy=sysinit.target - path: /etc/kubernetes/superuser.yaml content: | apiVersion: v1 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,14 +34,16 @@ write_files: - path: /etc/systemd/system/kubernetes-pods-enable-forward.service content: | [Unit] Description=Forward k8s pods network DefaultDependencies=false [Service] Type=oneshot RemainAfterExit=yes ExecStart=/sbin/iptables -A FORWARD -d 10.22.0.0/16 -j ACCEPT ExecStart=/sbin/iptables -A FORWARD -s 10.22.0.0/16 -j ACCEPT ExecStop= [Install] WantedBy=sysinit.target - path: /etc/kubernetes/superuser.yaml content: | apiVersion: v1 -
tsertkov revised this gist
Jan 18, 2018 . 2 changed files with 30 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,6 +31,17 @@ packages: - kubectl - [kubeadm, 1.7.10-00] write_files: - path: /etc/systemd/system/kubernetes-pods-enable-forward.service content: | [Unit] Description=Enable internet for k8s pods After=systemd-sysctl.service [Service] Type=oneshot RemainAfterExit=yes ExecStart=/sbin/iptables -A FORWARD -d 10.22.0.0/16 -j ACCEPT ExecStart=/sbin/iptables -A FORWARD -s 10.22.0.0/16 -j ACCEPT ExecStop= - path: /etc/kubernetes/superuser.yaml content: | apiVersion: v1 @@ -69,12 +80,14 @@ write_files: } } runcmd: - kubeadm init --skip-token-print --skip-preflight-checks --kubernetes-version stable-1.7 - kubectl --kubeconfig /etc/kubernetes/admin.conf taint nodes --all node-role.kubernetes.io/master- - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/superuser.yaml - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.7.1/src/deploy/recommended/kubernetes-dashboard.yaml - systemctl daemon-reload - systemctl enable kubernetes-pods-enable-forward.service - systemctl start kubernetes-pods-enable-forward.service - usermod -a -G docker ubuntu - mkdir /home/ubuntu/.kube - cp /etc/kubernetes/admin.conf /home/ubuntu/.kube/config - chown -R ubuntu:ubuntu /home/ubuntu/.kube This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,6 +31,17 @@ packages: - kubectl - kubeadm write_files: - path: /etc/systemd/system/kubernetes-pods-enable-forward.service content: | [Unit] Description=Enable internet for k8s pods After=systemd-sysctl.service [Service] Type=oneshot RemainAfterExit=yes ExecStart=/sbin/iptables -A FORWARD -d 10.22.0.0/16 -j ACCEPT ExecStart=/sbin/iptables -A FORWARD -s 10.22.0.0/16 -j ACCEPT ExecStop= - path: /etc/kubernetes/superuser.yaml content: | apiVersion: v1 @@ -69,12 +80,14 @@ write_files: } } runcmd: - kubeadm init --skip-token-print - kubectl --kubeconfig /etc/kubernetes/admin.conf taint nodes --all node-role.kubernetes.io/master- - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/superuser.yaml - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml - systemctl daemon-reload - systemctl enable kubernetes-pods-enable-forward.service - systemctl start kubernetes-pods-enable-forward.service - usermod -a -G docker ubuntu - mkdir /home/ubuntu/.kube - cp /etc/kubernetes/admin.conf /home/ubuntu/.kube/config - chown -R ubuntu:ubuntu /home/ubuntu/.kube -
tsertkov revised this gist
Jan 15, 2018 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,7 +50,6 @@ write_files: } runcmd: - systemctl enable --now docker.service - kubeadm init --skip-token-print - kubectl --kubeconfig /etc/kubernetes/admin.conf taint nodes --all node-role.kubernetes.io/master- power_state: -
tsertkov revised this gist
Jan 15, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -71,7 +71,7 @@ write_files: runcmd: - systemctl enable --now docker.service - usermod -a -G docker ubuntu - kubeadm init --skip-token-print --skip-preflight-checks --kubernetes-version stable-1.7 - kubectl --kubeconfig /etc/kubernetes/admin.conf taint nodes --all node-role.kubernetes.io/master- - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/superuser.yaml - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.7.1/src/deploy/recommended/kubernetes-dashboard.yaml -
tsertkov revised this gist
Jan 15, 2018 . 2 changed files with 85 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,12 +26,6 @@ $ kubectl run node-hello --image=gcr.io/google-samples/node-hello:1.0 --port=808 $ kubectl port-forward "$(kubectl get pods -l run=node-hello -o jsonpath='{.items[0].metadata.name}')" 8080:8080 ``` ## cloud-config.full.1.7.yaml Provisions kubernetes stable-1.7 with dashboard and superuser account. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,83 @@ #cloud-config apt: sources: kubernetes: source: "deb http://apt.kubernetes.io/ kubernetes-xenial main" # key from https://packages.cloud.google.com/apt/doc/apt-key.gpg key: | -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFUd6rIBCAD6mhKRHDn3UrCeLDp7U5IE7AhhrOCPpqGF7mfTemZYHf/5Jdjx cOxoSFlK7zwmFr3lVqJ+tJ9L1wd1K6P7RrtaNwCiZyeNPf/Y86AJ5NJwBe0VD0xH TXzPNTqRSByVYtdN94NoltXUYFAAPZYQls0x0nUD1hLMlOlC2HdTPrD1PMCnYq/N uL/Vk8sWrcUt4DIS+0RDQ8tKKe5PSV0+PnmaJvdF5CKawhh0qGTklS2MXTyKFoqj XgYDfY2EodI9ogT/LGr9Lm/+u4OFPvmN9VN6UG+s0DgJjWvpbmuHL/ZIRwMEn/tp uneaLTO7h1dCrXC849PiJ8wSkGzBnuJQUbXnABEBAAG0QEdvb2dsZSBDbG91ZCBQ YWNrYWdlcyBBdXRvbWF0aWMgU2lnbmluZyBLZXkgPGdjLXRlYW1AZ29vZ2xlLmNv bT6JAT4EEwECACgFAlUd6rICGy8FCQWjmoAGCwkIBwMCBhUIAgkKCwQWAgMBAh4B AheAAAoJEDdGwginMXsPcLcIAKi2yNhJMbu4zWQ2tM/rJFovazcY28MF2rDWGOnc 9giHXOH0/BoMBcd8rw0lgjmOosBdM2JT0HWZIxC/Gdt7NSRA0WOlJe04u82/o3OH WDgTdm9MS42noSP0mvNzNALBbQnlZHU0kvt3sV1YsnrxljoIuvxKWLLwren/GVsh FLPwONjw3f9Fan6GWxJyn/dkX3OSUGaduzcygw51vksBQiUZLCD2Tlxyr9NvkZYT qiaWW78L6regvATsLc9L/dQUiSMQZIK6NglmHE+cuSaoK0H4ruNKeTiQUw/EGFaL ecay6Qy/s3Hk7K0QLd+gl0hZ1w1VzIeXLo2BRlqnjOYFX4A= =HVTm -----END PGP PUBLIC KEY BLOCK----- package_upgrade: true packages: - docker.io - kubelet - kubectl - [kubeadm, 1.7.10-00] write_files: - path: /etc/kubernetes/superuser.yaml content: | apiVersion: v1 kind: ServiceAccount metadata: name: superuser namespace: kube-system --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: superuser roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: superuser namespace: kube-system - path: /etc/cni/net.d/10-cni.json content: | { "cniVersion": "0.2.0", "name": "my-kubenet", "type": "bridge", "bridge": "cni0", "isGateway": true, "ipMasq": true, "ipam": { "type": "host-local", "subnet": "10.22.0.0/16", "routes": [ { "dst": "0.0.0.0/0" } ] } } runcmd: - systemctl enable --now docker.service - usermod -a -G docker ubuntu - kubeadm init --skip-token-print --kubernetes-version stable-1.7 - kubectl --kubeconfig /etc/kubernetes/admin.conf taint nodes --all node-role.kubernetes.io/master- - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/superuser.yaml - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.7.1/src/deploy/recommended/kubernetes-dashboard.yaml - mkdir /home/ubuntu/.kube - cp /etc/kubernetes/admin.conf /home/ubuntu/.kube/config - chown -R ubuntu:ubuntu /home/ubuntu/.kube power_state: timeout: 300 mode: reboot -
tsertkov revised this gist
Jan 15, 2018 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,4 +24,14 @@ $ open http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubern // deploy hello-world app and proxy it to http://localhost:8080/ $ kubectl run node-hello --image=gcr.io/google-samples/node-hello:1.0 --port=8080 $ kubectl port-forward "$(kubectl get pods -l run=node-hello -o jsonpath='{.items[0].metadata.name}')" 8080:8080 ``` ## Install specific version of kubernetes Latest stable version of kubernetes is installed by default by kubeadm. To install specific version of kubernetes corresponding version of kubeadm must be installed. ``` // install kubernetes 1.7.12 $ apt-get install kubeadm=1.7.10-00 $ kubeadm init --kubernetes-version stable-1.7 ``` -
tsertkov revised this gist
Jan 15, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,11 +17,11 @@ kubeadm k8s installation including: ``` $ kubectl proxy // copy superuser access token to clipboard (macOS) $ kubectl get secret "$(kubectl get serviceAccount superuser -n kube-system -o jsonpath='{.secrets[0].name}')" -n kube-system -o jsonpath='{.data.token}' | base64 -D | pbcopy $ open http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ // deploy hello-world app and proxy it to http://localhost:8080/ $ kubectl run node-hello --image=gcr.io/google-samples/node-hello:1.0 --port=8080 $ kubectl port-forward "$(kubectl get pods -l run=node-hello -o jsonpath='{.items[0].metadata.name}')" 8080:8080 ``` -
tsertkov revised this gist
Jan 15, 2018 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,6 +16,12 @@ kubeadm k8s installation including: ``` $ kubectl proxy # copy superuser access token to clipboard (macOS) $ kubectl get secret "$(kubectl get serviceAccount superuser -n kube-system -o jsonpath='{.secrets[0].name}')" -n kube-system -o jsonpath='{.data.token}' | base64 -D | pbcopy $ open http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ # deploy hello-world app and proxy it to http://localhost:8080/ $ kubectl run node-hello --image=gcr.io/google-samples/node-hello:1.0 --port=8080 $ kubectl port-forward "$(kubectl get pods -l run=node-hello -o jsonpath='{.items[0].metadata.name}')" 8080:8080 ``` -
tsertkov revised this gist
Jan 14, 2018 . 2 changed files with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,15 @@ # Single-node kubernetes cluster cloud-config Cloud-config files for setting up k8s single-node cluster with kubeadm on Ubuntu 16.04.3 LTS (Xenial Xerus) ## cloud-config.minimal.yaml Minimal installation of k8s with kubeadm. ## cloud-config.full.yaml It is assumed that `ubuntu` user is already created on the system. kubeadm k8s installation including: - superuser with admin priveleges - dashboard addon This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,9 +53,6 @@ runcmd: - usermod -a -G docker ubuntu - kubeadm init --skip-token-print - kubectl --kubeconfig /etc/kubernetes/admin.conf taint nodes --all node-role.kubernetes.io/master- power_state: timeout: 300 mode: reboot -
tsertkov revised this gist
Jan 14, 2018 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,4 +10,10 @@ Minimal installation of k8s with kubeadm. kubeadm k8s installation including: - superuser with admin priveleges - dashboard addon ``` $ kubectl proxy $ kubectl get secret "$(kubectl get serviceAccount superuser -n kube-system -o jsonpath='{.secrets[0].name}')" -n kube-system -o jsonpath='{.data.token}' | base64 -D $ open http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ ``` -
tsertkov revised this gist
Jan 14, 2018 . 3 changed files with 94 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,13 @@ # Single-node kubernetes cluster cloud-config Cloud-config tested on Ubuntu 16.04.3 LTS (Xenial Xerus) running in AWS. It is assumed that `ubuntu` user is already created on the system. ## cloud-config.minimal.yaml Minimal installation of k8s with kubeadm. ## cloud-config.full.yaml kubeadm k8s installation including: - superuser with admin priveleges - dashboard addon This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,83 @@ #cloud-config apt: sources: kubernetes: source: "deb http://apt.kubernetes.io/ kubernetes-xenial main" # key from https://packages.cloud.google.com/apt/doc/apt-key.gpg key: | -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFUd6rIBCAD6mhKRHDn3UrCeLDp7U5IE7AhhrOCPpqGF7mfTemZYHf/5Jdjx cOxoSFlK7zwmFr3lVqJ+tJ9L1wd1K6P7RrtaNwCiZyeNPf/Y86AJ5NJwBe0VD0xH TXzPNTqRSByVYtdN94NoltXUYFAAPZYQls0x0nUD1hLMlOlC2HdTPrD1PMCnYq/N uL/Vk8sWrcUt4DIS+0RDQ8tKKe5PSV0+PnmaJvdF5CKawhh0qGTklS2MXTyKFoqj XgYDfY2EodI9ogT/LGr9Lm/+u4OFPvmN9VN6UG+s0DgJjWvpbmuHL/ZIRwMEn/tp uneaLTO7h1dCrXC849PiJ8wSkGzBnuJQUbXnABEBAAG0QEdvb2dsZSBDbG91ZCBQ YWNrYWdlcyBBdXRvbWF0aWMgU2lnbmluZyBLZXkgPGdjLXRlYW1AZ29vZ2xlLmNv bT6JAT4EEwECACgFAlUd6rICGy8FCQWjmoAGCwkIBwMCBhUIAgkKCwQWAgMBAh4B AheAAAoJEDdGwginMXsPcLcIAKi2yNhJMbu4zWQ2tM/rJFovazcY28MF2rDWGOnc 9giHXOH0/BoMBcd8rw0lgjmOosBdM2JT0HWZIxC/Gdt7NSRA0WOlJe04u82/o3OH WDgTdm9MS42noSP0mvNzNALBbQnlZHU0kvt3sV1YsnrxljoIuvxKWLLwren/GVsh FLPwONjw3f9Fan6GWxJyn/dkX3OSUGaduzcygw51vksBQiUZLCD2Tlxyr9NvkZYT qiaWW78L6regvATsLc9L/dQUiSMQZIK6NglmHE+cuSaoK0H4ruNKeTiQUw/EGFaL ecay6Qy/s3Hk7K0QLd+gl0hZ1w1VzIeXLo2BRlqnjOYFX4A= =HVTm -----END PGP PUBLIC KEY BLOCK----- package_upgrade: true packages: - docker.io - kubelet - kubectl - kubeadm write_files: - path: /etc/kubernetes/superuser.yaml content: | apiVersion: v1 kind: ServiceAccount metadata: name: superuser namespace: kube-system --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: superuser roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: superuser namespace: kube-system - path: /etc/cni/net.d/10-cni.json content: | { "cniVersion": "0.2.0", "name": "my-kubenet", "type": "bridge", "bridge": "cni0", "isGateway": true, "ipMasq": true, "ipam": { "type": "host-local", "subnet": "10.22.0.0/16", "routes": [ { "dst": "0.0.0.0/0" } ] } } runcmd: - systemctl enable --now docker.service - usermod -a -G docker ubuntu - kubeadm init --skip-token-print - kubectl --kubeconfig /etc/kubernetes/admin.conf taint nodes --all node-role.kubernetes.io/master- - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/superuser.yaml - kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml - mkdir /home/ubuntu/.kube - cp /etc/kubernetes/admin.conf /home/ubuntu/.kube/config - chown -R ubuntu:ubuntu /home/ubuntu/.kube power_state: timeout: 300 mode: reboot File renamed without changes. -
tsertkov revised this gist
Jan 14, 2018 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,3 @@ # Single-node kubernetes cluster cloud-config Cloud-config prepared for Ubuntu 16.04.3 LTS (Xenial Xerus) -
tsertkov created this gist
Jan 14, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ # Cloud-config setting up single-node kubernetes cluster on Ubuntu 16.04.3 LTS (Xenial Xerus) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,61 @@ #cloud-config apt: sources: kubernetes: source: "deb http://apt.kubernetes.io/ kubernetes-xenial main" # key from https://packages.cloud.google.com/apt/doc/apt-key.gpg key: | -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFUd6rIBCAD6mhKRHDn3UrCeLDp7U5IE7AhhrOCPpqGF7mfTemZYHf/5Jdjx cOxoSFlK7zwmFr3lVqJ+tJ9L1wd1K6P7RrtaNwCiZyeNPf/Y86AJ5NJwBe0VD0xH TXzPNTqRSByVYtdN94NoltXUYFAAPZYQls0x0nUD1hLMlOlC2HdTPrD1PMCnYq/N uL/Vk8sWrcUt4DIS+0RDQ8tKKe5PSV0+PnmaJvdF5CKawhh0qGTklS2MXTyKFoqj XgYDfY2EodI9ogT/LGr9Lm/+u4OFPvmN9VN6UG+s0DgJjWvpbmuHL/ZIRwMEn/tp uneaLTO7h1dCrXC849PiJ8wSkGzBnuJQUbXnABEBAAG0QEdvb2dsZSBDbG91ZCBQ YWNrYWdlcyBBdXRvbWF0aWMgU2lnbmluZyBLZXkgPGdjLXRlYW1AZ29vZ2xlLmNv bT6JAT4EEwECACgFAlUd6rICGy8FCQWjmoAGCwkIBwMCBhUIAgkKCwQWAgMBAh4B AheAAAoJEDdGwginMXsPcLcIAKi2yNhJMbu4zWQ2tM/rJFovazcY28MF2rDWGOnc 9giHXOH0/BoMBcd8rw0lgjmOosBdM2JT0HWZIxC/Gdt7NSRA0WOlJe04u82/o3OH WDgTdm9MS42noSP0mvNzNALBbQnlZHU0kvt3sV1YsnrxljoIuvxKWLLwren/GVsh FLPwONjw3f9Fan6GWxJyn/dkX3OSUGaduzcygw51vksBQiUZLCD2Tlxyr9NvkZYT qiaWW78L6regvATsLc9L/dQUiSMQZIK6NglmHE+cuSaoK0H4ruNKeTiQUw/EGFaL ecay6Qy/s3Hk7K0QLd+gl0hZ1w1VzIeXLo2BRlqnjOYFX4A= =HVTm -----END PGP PUBLIC KEY BLOCK----- package_upgrade: true packages: - docker.io - kubelet - kubectl - kubeadm write_files: - path: /etc/cni/net.d/10-cni.json content: | { "cniVersion": "0.2.0", "name": "my-kubenet", "type": "bridge", "bridge": "cni0", "isGateway": true, "ipMasq": true, "ipam": { "type": "host-local", "subnet": "10.22.0.0/16", "routes": [ { "dst": "0.0.0.0/0" } ] } } runcmd: - systemctl enable --now docker.service - usermod -a -G docker ubuntu - kubeadm init --skip-token-print - kubectl --kubeconfig /etc/kubernetes/admin.conf taint nodes --all node-role.kubernetes.io/master- - mkdir /home/ubuntu/.kube - cp /etc/kubernetes/admin.conf /home/ubuntu/.kube/config - chown -R ubuntu:ubuntu /home/ubuntu/.kube power_state: timeout: 300 mode: reboot