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
-
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
-
Print the service details
kubectl get services
Copy the EXTERNAL-IP of your service
-
Curl the application:
curl http://<EXTERNAL-IP>
-
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>
-
Delete the resources - pod and service.
kubectl delete pod my-pod kubectl delete service my-service