Lab 0: Preparation

  1. Open a Terminal window by clicking on the Termnial icon in the left sidebar - we will use this extensively later as well

  2. Start the demo application

    kubectl create -f ~/training/deployment/demoapp.yaml
    kubectl create -f ~/training/deployment/demoapp-service.yaml
    kubectl create -f ~/training/deployment/demoapp-backend.yaml
    kubectl create -f ~/training/deployment/demoapp-backend-service.yaml
    

    ``

  3. Wait for the demo application to be available (the status must be 1/1)

    kubectl get pods
       
    > NAME                               READY   STATUS    RESTARTS   AGE
    > k8sdemo-backend-5b779f567f-2rbgj   1/1     Running   0          21s
    > k8sdemo-backend-5b779f567f-p6j76   1/1     Running   0          21s
    > k8sdemo-bd6bbd548-jcb6r            1/1     Running   0          21s
       
    

    ``

  4. Open the demo application in the browser

    Training VM

    If you are using the training VM, you can open the webpage directly by typing:

    minikube service k8sdemo-service
    

    where k8sdemo-service is the name of the exposed kubernetes service.


    Cloud/Standalone

    If you are NOT using the training VM, you can open the webpage by typing:

    kubectl port-forward --namespace default $(kubectl get po -n default -l app=k8sdemo | grep k8sdemo | \awk '{print $1;}') 3000:3000
    

    And then navigating to http://localhost:3000/ in your browser.