Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 1.01 KB

File metadata and controls

64 lines (42 loc) · 1.01 KB

Hello K8s

In this course, we will create an application which will be reachable in the WWW.

Navigate to the lab folder:

cd /workspaces/kubernetes-fundamentals/01_hello-k8s

Create and expose the application

  • Inspect pod.yaml definition file and create the pod

    cat pod.yaml
    kubectl create -f pod.yaml
  • Inspect service.yaml file content and create the service

    cat service.yaml
    kubectl create -f service.yaml

Access the application

  • Print the service details

    kubectl get services

    Copy the EXTERNAL-IP of your service

  • Curl the application:

    curl http://<EXTERNAL-IP>

Modify the application

  • Copy the index.html file into the pod

    kubectl cp index.html my-pod:/usr/share/nginx/html/index.html
  • Curl the application:

    curl http://<EXTERNAL-IP>

Cleanup

  • Delete the resources - pod and service.

    kubectl delete pod my-pod
    kubectl delete service my-service