Last active
June 18, 2020 01:48
-
-
Save adamcharnock/f504527bb110f978b7a45af4077fe031 to your computer and use it in GitHub Desktop.
Revisions
-
adamcharnock revised this gist
Nov 24, 2017 . 1 changed file with 8 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 @@ -266,6 +266,14 @@ helm init --client-only helm install --name registry --namespace registry incubator/docker-registry --set persistentVolume.enabled=true,persistentVolume.storageClass=nfs ``` On the node, edit ``/etc/docker/daemon.json`` to add: ``` "insecure-registries" : ["registry.developerapp.net"] ``` Note: This assumes you setup CoreDns to resolve ``registry.developerapp.net`` to a CNAME for the registry service created above. # Backup Assuming you have an nfs drive you can mount for backing up to: -
adamcharnock revised this gist
Nov 22, 2017 . 1 changed file with 39 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 @@ -264,4 +264,43 @@ helm init --client-only ``` helm install --name registry --namespace registry incubator/docker-registry --set persistentVolume.enabled=true,persistentVolume.storageClass=nfs ``` # Backup Assuming you have an nfs drive you can mount for backing up to: ``` apt-get install rsnapshot sudo apt-get install postfix # Need for cron to tell you of errors ``` Add backup drive to ``/etc/fstab``: ``` server:path /backup nfs rsize=65536,wsize=65536,timeo=30,intr,nfsvers=4 ``` Edit ```/etc/rsnapshot.conf```. In particular: ``` snapshot_root /backup/rsnapshot/ ... retain daily 6 retain weekly 12 ... backup /home/ localhost/ backup /etc/ localhost/ backup /usr/local/ localhost/ backup /data/ localhost/ backup /root/ localhost/ backup /var/lib/etcd/ localhost/ ``` Update crontab (``crontab -e``): ``` [email protected] 00 03 * * * /usr/bin/rsnapshot daily 00 06 * * 6 /usr/bin/rsnapshot weekly ``` -
adamcharnock revised this gist
Nov 17, 2017 . 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 @@ -263,5 +263,5 @@ helm init --client-only ## Setup docker registry ``` helm install --name registry --namespace registry incubator/docker-registry --set persistentVolume.enabled=true,persistentVolume.storageClass=nfs ``` -
adamcharnock revised this gist
Nov 17, 2017 . 1 changed file with 6 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 @@ -258,4 +258,10 @@ Copy the created config to your local machine and load into tunnelblick. ``` export HELM_HOST=tiller-deploy.kube-system.svc.cluster.local:44134 # Probably put in .bashrc or some such helm init --client-only ``` ## Setup docker registry ``` helm install --name registry --namespace registry incubator/docker-registry --set persistentVolume.enabled=true ``` -
adamcharnock revised this gist
Nov 17, 2017 . 1 changed file with 8 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 @@ -251,4 +251,11 @@ kubectl -n $NAMESPACE exec -it $POD_NAME cat /etc/openvpn/certs/pki/$KEY_NAME.ov ./makeClientKey.sh joebloggs ``` Copy the created config to your local machine and load into tunnelblick. ## Setup your local machine ``` export HELM_HOST=tiller-deploy.kube-system.svc.cluster.local:44134 # Probably put in .bashrc or some such helm init --client-only ``` -
adamcharnock revised this gist
Nov 16, 2017 . 1 changed file with 19 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 @@ -65,6 +65,25 @@ iptables -P FORWARD ACCEPT kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml ``` This is only a single-admin cluster, so give the dashboard admin rights: ``` apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: kubernetes-dashboard labels: k8s-app: kubernetes-dashboard roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: kubernetes-dashboard namespace: kube-system ``` ## Helm ``` -
adamcharnock revised this gist
Nov 16, 2017 . 1 changed file with 27 additions and 6 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 @@ -53,6 +53,12 @@ First, comment out the definition of ``KUBELET_NETWORK_ARGS`` in ``/etc/systemd/ kubeadm init --pod-network-cidr=10.244.0.0/16 --node-name=node1 ``` Flannel [seems to drop](https://github.com/coreos/flannel/issues/603) forwarded traffic, so fix it: ``` iptables -P FORWARD ACCEPT ``` ## Install the dashboard ``` @@ -202,13 +208,28 @@ spec: ... ``` Create ``makeClientKey.sh``: ``` #!/bin/bash -e if [ $# -ne 1 ] then echo "Usage: $0 <CLIENT_KEY_NAME>" exit fi KEY_NAME=$1 NAMESPACE=$(kubectl get pods --all-namespaces -l type=openvpn -o jsonpath='{.items[0].metadata.namespace}') POD_NAME=$(kubectl get pods -n $NAMESPACE -l type=openvpn -o jsonpath='{.items[0].metadata.name}') SERVICE_NAME=$(kubectl get svc -n $NAMESPACE -l type=openvpn -o jsonpath='{.items[0].metadata.name}') SERVICE_IP=79.137.68.39 # CUSTOMISE kubectl -n $NAMESPACE exec -it $POD_NAME /etc/openvpn/setup/newClientCert.sh $KEY_NAME $SERVICE_IP kubectl -n $NAMESPACE exec -it $POD_NAME cat /etc/openvpn/certs/pki/$KEY_NAME.ovpn > $KEY_NAME.ovpn ``` ``` ./makeClientKey.sh joebloggs ``` TBA: https://github.com/kubernetes/charts/tree/master/stable/openvpn -
adamcharnock revised this gist
Nov 16, 2017 . 1 changed file with 24 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 @@ -178,7 +178,31 @@ parameters: ``` helm install stable/openvpn --name vpn --namespace vpn helm upgrade --set service.type=NodePort vpn stable/openvpn ``` Now: ``` kubectl -nvpn edit svc vpn-openvpn ``` Update spec to look like this: ``` spec: ... type: NodePort ports: - name: openvpn nodePort: 30443 port: 443 protocol: TCP targetPort: 443 ... ``` ``` POD_NAME=$(kubectl get pods --namespace vpn -l type=openvpn -o jsonpath='{ .items[0].metadata.name }') SERVICE_NAME=$(kubectl get svc --namespace vpn -l type=openvpn -o jsonpath='{ .items[0].metadata.name }') SERVICE_IP=$(kubectl get svc --namespace vpn $SERVICE_NAME -o go-template='{{ range $k, $v := (index .status.loadBalancer.ingress 0)}}{{ $v }}{{end}}') -
adamcharnock revised this gist
Nov 16, 2017 . 1 changed file with 10 additions and 3 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 @@ -78,11 +78,18 @@ Note that the last line gives helm admin priviliges. This means that anyone who Follow these instructions, dont forget the auth: https://github.com/kubernetes-incubator/external-storage/tree/master/nfs Use the following storage class: ``` kind: StorageClass apiVersion: storage.k8s.io/v1beta1 metadata: name: nfs annotations: storageclass.kubernetes.io/is-default-class: "true" provisioner: developerapp.com/nfs parameters: mountOptions: "vers=4.1" ``` ## Gluster (requires 3 storage nodes, and therefore 3 disks!) -
adamcharnock revised this gist
Nov 16, 2017 . 1 changed file with 7 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 @@ -78,6 +78,13 @@ Note that the last line gives helm admin priviliges. This means that anyone who Follow these instructions, dont forget the auth: https://github.com/kubernetes-incubator/external-storage/tree/master/nfs Make the new storage class the default: ``` kubectl patch sc nfs -p '{"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class": "true"}}}' kubectl get sc ``` ## Gluster (requires 3 storage nodes, and therefore 3 disks!) Reference: https://github.com/gluster/gluster-kubernetes -
adamcharnock revised this gist
Nov 16, 2017 . 1 changed file with 5 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 @@ -74,7 +74,11 @@ kubectl create clusterrolebinding ks-default --clusterrole=cluster-admin --servi Note that the last line gives helm admin priviliges. This means that anyone who has helm access will have admin access to the cluster. Fine for a personal cluster, but do something more robust otherwise ## NFS Storage Provisioner Follow these instructions, dont forget the auth: https://github.com/kubernetes-incubator/external-storage/tree/master/nfs ## Gluster (requires 3 storage nodes, and therefore 3 disks!) Reference: https://github.com/gluster/gluster-kubernetes -
adamcharnock revised this gist
Nov 16, 2017 . 1 changed file with 9 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 @@ -128,6 +128,15 @@ kubectl create namespace gluster ./gk-deploy --deploy-gluster --namespace gluster --object-capacity 2Ti ``` If this hangs when creating nodes, you probably need to enter the gluster node ([reference](http://blog.lwolf.org/post/how-i-deployed-glusterfs-cluster-to-kubernetes/)): ``` ps lax kill -9 1234 # PID of pvcreate command rm /run/lock/lvm/P_orphans # Remove the lock pvcreate --metadatasize=128M --dataalignment=256K /dev/md4 ``` As per: https://github.com/gluster/gluster-kubernetes/blob/master/docs/examples/hello_world/README.md Create ``defaultstorageclass.yaml``: -
adamcharnock revised this gist
Nov 16, 2017 . 1 changed file with 2 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 @@ -105,7 +105,7 @@ Create ``topology.json`` as follows: "node1" ], "storage": [ "79.137.68.39" ] }, "zone": 1 @@ -124,6 +124,7 @@ https://github.com/coreos/quartermaster/tree/master/examples/glusterfs/auth/rbac ``` kubectl create namespace gluster ./gk-deploy --deploy-gluster --namespace gluster --object-capacity 2Ti ``` -
adamcharnock revised this gist
Nov 16, 2017 . 1 changed file with 4 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 @@ -79,12 +79,12 @@ Note that the last line gives helm admin priviliges. This means that anyone who Reference: https://github.com/gluster/gluster-kubernetes ``` sudo mkfs.xsf /dev/md4 sudo mkdir -p /data/gluster sudo mount /dev/sdb1 /data/gluster ``` Add ``/dev/md4 /data/gluster ext4 defaults 0 0`` to ``/etc/fstab``. Actually, no? ``` git clone https://github.com/gluster/gluster-kubernetes.git @@ -120,6 +120,8 @@ Create ``topology.json`` as follows: } ``` https://github.com/coreos/quartermaster/tree/master/examples/glusterfs/auth/rbac ``` ./gk-deploy --deploy-gluster --namespace gluster --object-capacity 2Ti -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 20 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 @@ -76,7 +76,7 @@ Note that the last line gives helm admin priviliges. This means that anyone who ## Gluster Reference: https://github.com/gluster/gluster-kubernetes ``` sudo mkfs.ext4 /dev/md4 @@ -125,6 +125,25 @@ Create ``topology.json`` as follows: ./gk-deploy --deploy-gluster --namespace gluster --object-capacity 2Ti ``` As per: https://github.com/gluster/gluster-kubernetes/blob/master/docs/examples/hello_world/README.md Create ``defaultstorageclass.yaml``: ```apiVersion: storage.k8s.io/v1beta1 kind: StorageClass metadata: name: gluster-heketi annotations: storageclass.kubernetes.io/is-default-class: "true" provisioner: kubernetes.io/glusterfs parameters: resturl: "http://deploy-heketi.gluster.svc.cluster.local:8080" restuser: "ignore" restuserkey: "ignore" ``` ## OpenVPN for access ``` -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 33 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 @@ -89,6 +89,39 @@ Add ``/dev/md4 /data/gluster ext4 defaults 0 0`` to ``/etc/fstab``. ``` git clone https://github.com/gluster/gluster-kubernetes.git cd gluster-kubernetes/deploy ``` Create ``topology.json`` as follows: ``` { "clusters": [ { "nodes": [ { "node": { "hostnames": { "manage": [ "node1" ], "storage": [ "79.137.68.39", "172.17.0.1" ] }, "zone": 1 }, "devices": [ "/dev/md4" ] } ] } ] } ``` ``` ./gk-deploy --deploy-gluster --namespace gluster --object-capacity 2Ti ``` -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 3 additions and 7 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 @@ -79,10 +79,6 @@ Note that the last line gives helm admin priviliges. This means that anyone who Reference: http://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/install-and-configure-glusterfs-on-ubuntu-16-04-debian-8.html ``` sudo mkfs.ext4 /dev/md4 sudo mkdir -p /data/gluster sudo mount /dev/sdb1 /data/gluster @@ -91,9 +87,9 @@ sudo mount /dev/sdb1 /data/gluster Add ``/dev/md4 /data/gluster ext4 defaults 0 0`` to ``/etc/fstab``. ``` git clone https://github.com/gluster/gluster-kubernetes.git cd gluster-kubernetes/deploy ./gk-deploy --deploy-gluster --namespace gluster --object-capacity 2Ti ``` ## OpenVPN for access -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 22 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 @@ -74,6 +74,28 @@ kubectl create clusterrolebinding ks-default --clusterrole=cluster-admin --servi Note that the last line gives helm admin priviliges. This means that anyone who has helm access will have admin access to the cluster. Fine for a personal cluster, but do something more robust otherwise ## Gluster Reference: http://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/install-and-configure-glusterfs-on-ubuntu-16-04-debian-8.html ``` apt install software-properties-common add-apt-repository ppa:gluster/glusterfs-3.12 sudo apt-get update sudo mkfs.ext4 /dev/md4 sudo mkdir -p /data/gluster sudo mount /dev/sdb1 /data/gluster ``` Add ``/dev/md4 /data/gluster ext4 defaults 0 0`` to ``/etc/fstab``. ``` sudo mkdir -p /data/gluster/gvol0 gluster volume create gvol0 node1:/data/gluster/gvol0 ``` ## OpenVPN for access ``` -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 12 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 @@ -69,10 +69,22 @@ chmod 700 get_helm.sh helm init kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller kubectl create clusterrolebinding ks-default --clusterrole=cluster-admin --serviceaccount=kube-system:default ``` Note that the last line gives helm admin priviliges. This means that anyone who has helm access will have admin access to the cluster. Fine for a personal cluster, but do something more robust otherwise ## OpenVPN for access ``` helm install stable/openvpn --name vpn --namespace vpn POD_NAME=$(kubectl get pods --namespace vpn -l type=openvpn -o jsonpath='{ .items[0].metadata.name }') SERVICE_NAME=$(kubectl get svc --namespace vpn -l type=openvpn -o jsonpath='{ .items[0].metadata.name }') SERVICE_IP=$(kubectl get svc --namespace vpn $SERVICE_NAME -o go-template='{{ range $k, $v := (index .status.loadBalancer.ingress 0)}}{{ $v }}{{end}}') KEY_NAME=kubeVPN kubectl --namespace vpn exec -it $POD_NAME /etc/openvpn/setup/newClientCert.sh $KEY_NAME $SERVICE_IP kubectl --namespace vpn exec -it $POD_NAME cat /etc/openvpn/certs/pki/$KEY_NAME.ovpn > $KEY_NAME.ovpn ``` TBA: https://github.com/kubernetes/charts/tree/master/stable/openvpn -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 2 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 @@ -66,6 +66,8 @@ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_ chmod 700 get_helm.sh ./get_helm.sh helm init kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller ``` -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 2 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 @@ -69,6 +69,8 @@ chmod 700 get_helm.sh kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller ``` Note that the last line gives helm admin priviliges. This means that anyone who has helm access will have admin access to the cluster. Fine for a personal cluster, but do something more robust otherwise ## OpenVPN for access TBA: https://github.com/kubernetes/charts/tree/master/stable/openvpn -
adamcharnock revised this gist
Nov 15, 2017 . 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 @@ -59,6 +59,16 @@ kubeadm init --pod-network-cidr=10.244.0.0/16 --node-name=node1 kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml ``` ## Helm ``` curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh chmod 700 get_helm.sh ./get_helm.sh kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller ``` ## OpenVPN for access TBA: https://github.com/kubernetes/charts/tree/master/stable/openvpn -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 9 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 @@ -53,3 +53,12 @@ First, comment out the definition of ``KUBELET_NETWORK_ARGS`` in ``/etc/systemd/ kubeadm init --pod-network-cidr=10.244.0.0/16 --node-name=node1 ``` ## Install the dashboard ``` kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml ``` ## OpenVPN for access TBA: https://github.com/kubernetes/charts/tree/master/stable/openvpn -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 8 additions and 6 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,4 +1,6 @@ # Kubernetes install on Ubuntu 17.10 via kubeadm ## Initial setup ``` apt-get update @@ -9,7 +11,7 @@ apt-get install curl curl -sSL https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh | bash ``` ## Install docker ``` apt-get install -y docker.io @@ -21,7 +23,7 @@ cat << EOF > /etc/docker/daemon.json EOF ``` ## Install kubeadm ``` apt-get install -y apt-transport-https @@ -35,15 +37,15 @@ apt-get update apt-get install -y kubelet kubeadm kubectl ``` ## Disable swap Comment out your swap lines in ``/etc/fstab`` ## Set hostname Set hostname to ``node1``. [Instructions](http://ubuntuhandbook.org/index.php/2016/06/change-hostname-ubuntu-16-04-without-restart/). ## Initialise kubernetes First, comment out the definition of ``KUBELET_NETWORK_ARGS`` in ``/etc/systemd/system/kubelet.service.d/10-kubeadm.conf``. This disables the use of the CNI networking plugin. -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 7 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 @@ -39,10 +39,15 @@ apt-get install -y kubelet kubeadm kubectl Comment out your swap lines in ``/etc/fstab`` # Set hostname Set hostname to ``node1``. [Instructions](http://ubuntuhandbook.org/index.php/2016/06/change-hostname-ubuntu-16-04-without-restart/). # Initialise kubernetes First, comment out the definition of ``KUBELET_NETWORK_ARGS`` in ``/etc/systemd/system/kubelet.service.d/10-kubeadm.conf``. This disables the use of the CNI networking plugin. ``` kubeadm init --pod-network-cidr=10.244.0.0/16 --node-name=node1 ``` -
adamcharnock revised this gist
Nov 15, 2017 . 1 changed file with 3 additions and 3 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 @@ -41,8 +41,8 @@ Comment out your swap lines in ``/etc/fstab`` # Initialise kubernetes First, comment out the definition of ``KUBELET_NETWORK_ARGS`` in ``/etc/systemd/system/kubelet.service.d/10-kubeadm.conf``. This disables the use of the CNI networking plugin. ``` kubeadm init --pod-network-cidr=10.244.0.0/16 --node-name=truck ``` -
adamcharnock revised this gist
Nov 14, 2017 . 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 @@ -43,4 +43,6 @@ Comment out your swap lines in ``/etc/fstab`` ``` kubeadm init --pod-network-cidr=10.244.0.0/16 --node-name=truck ``` Comment out the definition of ``KUBELET_NETWORK_ARGS`` in ``/etc/systemd/system/kubelet.service.d/10-kubeadm.conf`` -
adamcharnock revised this gist
Nov 14, 2017 . 1 changed file with 24 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 @@ -16,8 +16,31 @@ apt-get install -y docker.io cat << EOF > /etc/docker/daemon.json { "exec-opts": ["native.cgroupdriver=cgroupfs"] } EOF ``` # Install kubeadm ``` apt-get install -y apt-transport-https curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - cat <<EOF >/etc/apt/sources.list.d/kubernetes.list deb http://apt.kubernetes.io/ kubernetes-xenial main EOF apt-get update apt-get install -y kubelet kubeadm kubectl ``` # Disable swap Comment out your swap lines in ``/etc/fstab`` # Initialise kubernetes ``` kubeadm init --pod-network-cidr=10.244.0.0/16 --node-name=truck ``` -
adamcharnock revised this gist
Nov 14, 2017 . 1 changed file with 17 additions and 13 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,19 +1,23 @@ # Initial setup ``` apt-get update apt-get upgrade apt-get install curl # Check VXLAN exists curl -sSL https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh | bash ``` # Install docker ``` apt-get install -y docker.io cat << EOF > /etc/docker/daemon.json { "exec-opts": ["native.cgroupdriver=systemd"] } EOF ``` -
adamcharnock created this gist
Nov 14, 2017 .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,19 @@ Initial setup apt-get update apt-get upgrade apt-get install curl # Check VXLAN exists curl -sSL https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh | bash Install docker apt-get install -y docker.io cat << EOF > /etc/docker/daemon.json { "exec-opts": ["native.cgroupdriver=systemd"] } EOF