Skip to content

Instantly share code, notes, and snippets.

@adamcharnock
Last active June 18, 2020 01:48
Show Gist options
  • Save adamcharnock/f504527bb110f978b7a45af4077fe031 to your computer and use it in GitHub Desktop.
Save adamcharnock/f504527bb110f978b7a45af4077fe031 to your computer and use it in GitHub Desktop.

Revisions

  1. adamcharnock revised this gist Nov 24, 2017. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions howto.md
    Original 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:
  2. adamcharnock revised this gist Nov 22, 2017. 1 changed file with 39 additions and 0 deletions.
    39 changes: 39 additions & 0 deletions howto.md
    Original 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
    ```
  3. adamcharnock revised this gist Nov 17, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion howto.md
    Original 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
    helm install --name registry --namespace registry incubator/docker-registry --set persistentVolume.enabled=true,persistentVolume.storageClass=nfs
    ```
  4. adamcharnock revised this gist Nov 17, 2017. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions howto.md
    Original 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
    ```
  5. adamcharnock revised this gist Nov 17, 2017. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion howto.md
    Original 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
    ```

    TBA: https://github.com/kubernetes/charts/tree/master/stable/openvpn
    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
    ```
  6. adamcharnock revised this gist Nov 16, 2017. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions howto.md
    Original 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

    ```
  7. adamcharnock revised this gist Nov 16, 2017. 1 changed file with 27 additions and 6 deletions.
    33 changes: 27 additions & 6 deletions howto.md
    Original 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
    ```

    ```
    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
    ./makeClientKey.sh joebloggs
    ```

    TBA: https://github.com/kubernetes/charts/tree/master/stable/openvpn
  8. adamcharnock revised this gist Nov 16, 2017. 1 changed file with 24 additions and 0 deletions.
    24 changes: 24 additions & 0 deletions howto.md
    Original 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}}')
  9. adamcharnock revised this gist Nov 16, 2017. 1 changed file with 10 additions and 3 deletions.
    13 changes: 10 additions & 3 deletions howto.md
    Original 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

    Make the new storage class the default:
    Use the following storage class:

    ```
    kubectl patch sc nfs -p '{"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class": "true"}}}'
    kubectl get sc
    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!)
  10. adamcharnock revised this gist Nov 16, 2017. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions howto.md
    Original 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
  11. adamcharnock revised this gist Nov 16, 2017. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion howto.md
    Original 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

    ## Gluster
    ## 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

  12. adamcharnock revised this gist Nov 16, 2017. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions howto.md
    Original 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``:
  13. adamcharnock revised this gist Nov 16, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion howto.md
    Original file line number Diff line number Diff line change
    @@ -105,7 +105,7 @@ Create ``topology.json`` as follows:
    "node1"
    ],
    "storage": [
    "79.137.68.39", "172.17.0.1"
    "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
    ```

  14. adamcharnock revised this gist Nov 16, 2017. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions howto.md
    Original 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.ext4 /dev/md4
    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``.
    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
  15. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 20 additions and 1 deletion.
    21 changes: 20 additions & 1 deletion howto.md
    Original 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: http://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/install-and-configure-glusterfs-on-ubuntu-16-04-debian-8.html
    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

    ```
  16. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 33 additions and 0 deletions.
    33 changes: 33 additions & 0 deletions howto.md
    Original 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
    ```

  17. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 3 additions and 7 deletions.
    10 changes: 3 additions & 7 deletions howto.md
    Original 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

    ```
    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
    @@ -91,9 +87,9 @@ 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
    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
  18. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 22 additions and 0 deletions.
    22 changes: 22 additions & 0 deletions howto.md
    Original 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

    ```
  19. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions howto.md
    Original 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
  20. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions howto.md
    Original 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
    ```

  21. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions howto.md
    Original 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
  22. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions howto.md
    Original 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
  23. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions howto.md
    Original 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
  24. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 8 additions and 6 deletions.
    14 changes: 8 additions & 6 deletions howto.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    # Initial setup
    # 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
    ## Install docker

    ```
    apt-get install -y docker.io
    @@ -21,7 +23,7 @@ cat << EOF > /etc/docker/daemon.json
    EOF
    ```

    # Install kubeadm
    ## 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
    ## Disable swap

    Comment out your swap lines in ``/etc/fstab``

    # Set hostname
    ## Set hostname

    Set hostname to ``node1``. [Instructions](http://ubuntuhandbook.org/index.php/2016/06/change-hostname-ubuntu-16-04-without-restart/).

    # Initialise kubernetes
    ## 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.

  25. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions howto.md
    Original 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=truck
    ```
    kubeadm init --pod-network-cidr=10.244.0.0/16 --node-name=node1
    ```

  26. adamcharnock revised this gist Nov 15, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions howto.md
    Original 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
    ```

    Comment out the definition of ``KUBELET_NETWORK_ARGS`` in ``/etc/systemd/system/kubelet.service.d/10-kubeadm.conf``
    ```
  27. adamcharnock revised this gist Nov 14, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion howto.md
    Original 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``
  28. adamcharnock revised this gist Nov 14, 2017. 1 changed file with 24 additions and 1 deletion.
    25 changes: 24 additions & 1 deletion howto.md
    Original 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=systemd"]
    "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
    ```
  29. adamcharnock revised this gist Nov 14, 2017. 1 changed file with 17 additions and 13 deletions.
    30 changes: 17 additions & 13 deletions howto.md
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,23 @@
    Initial setup
    # Initial setup

    apt-get update
    apt-get upgrade
    apt-get install curl
    ```
    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
    # Check VXLAN exists
    curl -sSL https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh | bash
    ```

    Install docker
    # Install docker

    apt-get install -y docker.io
    ```
    apt-get install -y docker.io
    cat << EOF > /etc/docker/daemon.json
    {
    "exec-opts": ["native.cgroupdriver=systemd"]
    }
    EOF
    cat << EOF > /etc/docker/daemon.json
    {
    "exec-opts": ["native.cgroupdriver=systemd"]
    }
    EOF
    ```

  30. adamcharnock created this gist Nov 14, 2017.
    19 changes: 19 additions & 0 deletions howto.md
    Original 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