Skip to content

Latest commit

 

History

History

01-single-container-pod

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

GKE Workshop LAB-01

Web-Application, Single Container Pod Example

Context License

Introduction

In the following lab we will set up our local development environment, provision the workshop cluster and roll out a static nginx page as single container Pod. Your deployment won't be exposed and is only available by ClusterIP of the corresponding pod-service. You can access the application by tunneling your localhost through kubectl proxy command.

Deployment

  1. Run deployment
kubectl apply -f .

Cluster Application Check / Playground

  1. You can check the state of Pods at any time with the following kubectl command:
kubectl get pods -n doit-lab-01
  1. You can also permanently display the current log stream of the pod in question in your terminal using the following command:
kubectl get pods -n doit-lab-01 --watch
  1. You can access this pod from your local environment by kubectl port-forwarding & access this web-app @localhost:8080
kubectl port-forward pod/static-web-app 8080:80 -n doit-lab-01
  1. You can also jump directly into a sh-terminal of the started pod
kubectl exec -it static-web-app -n doit-lab-01 -- sh

Optional Steps

Now we can set the current k8s context to our lab exercise namespace doit-lab-01 to make sure that every command set is run against this lab resources.

kubectl config set-context --current --namespace=doit-lab-01

Application Clean-Up

kubectl delete -f .

Links