Skip to content

Instantly share code, notes, and snippets.

@timroster
Last active October 22, 2018 19:23
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 timroster/85389fd91650a5af7aec27efb6a5a8d1 to your computer and use it in GitHub Desktop.
Save timroster/85389fd91650a5af7aec27efb6a5a8d1 to your computer and use it in GitHub Desktop.
Setting up a Play With Kubernetes environment for the IBM Kube 101 lab

kube101

These instructions show how to deploy a very simple web application that uses a data backend using redis. You don't need to install any software, just point your browser at the kubernetes playground and follow along with the steps.

Initial set up

  1. In a browser, open the kubernetes playground and log in using either a Docker Hub id or a GitHub id. Then click on Start.

  2. Click on ADD NEW INSTANCE to set up your first node.

  3. Bring up up kubernetes on the node

    kubeadm init --apiserver-advertise-address $(hostname -i)
    

    copy the example output of commands to add another node to cluster (your token and IP will be different) kubeadm join --token 37364e.138fd5cd5f5dce72 192.168.0.13:6443 --discovery-token-ca-cert-hash sha256:d7968bbcd0fafd6630ae366b3ffb7c91c2e093784f922705b6278eb8de882b67

  4. Set up networking

    kubectl apply -n kube-system -f \
    "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
    
  5. Check status, repeat until the master shows "Ready"

    kubectl get nodes
    NAME      STATUS     ROLES     AGE       VERSION
    node1     Ready      master    1m       v1.10.2
    
  6. Add another node

    • click ADD NEW INSTANCE

    • click into node2 and then run the command you recorded for adding new nodes from step 2:

      kubeadm join --token 37364e.138fd5cd5f5dce72 192.168.0.13:6443 --discovery-token-ca-cert-hash sha256:d7968bbcd0fafd6630ae366b3ffb7c91c2e093784f922705b6278eb8de882b67
      
  7. Return to the master (node1) and check on status with kubectl, wait until node2 shows ready:

    kubectl get nodes
    NNAME      STATUS    ROLES     AGE       VERSION
    node1     Ready     master    2m        v1.10.2
    node2     Ready     <none>    38s       v1.10.2
    
  8. Clone the application repository to simplify access to the lab deployment configuration files

    git clone https://github.com/IBM/guestbook.git
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment