Hello GKE#

In this lab you’ll re-deploy last week’s application onto Google Kubernetes Engine.

Update the Service#

Update the service definition to type: LoadBalancer:

apiVersion: v1
kind: Service
metadata:
  name: hello-svc
spec:
  type: LoadBalancer
  selector:
    function: webserver
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80

Apply the updated version to GKE:

$ kubectl apply -f hello-svc.yaml

Verify that the service is present:

$ kubectl get all 

Inspect the service more closely:

$ kubectl describe service/hello-service

After a few minutes the service should have an external IP address. You should be able to access it from your browser.

Delete the Resources#

Let’s clean up:

$ kubectl delete pod/hello-pod svc/hello-svc