2. Kubernetes Engine: Qwik Start

📒 link

Overview

  • What is Google Kubernetes Engine(GKE)

    • Google Kubernetes Engine (GKE) provides a managed environment for deploying, managing, and scaling your containerized applications using Google infrastructure.

    • The Kubernetes Engine environment consists of multiple machines (specifically Compute Engine instances) grouped to form a container cluster.

  • Benefit of Kubernetes on Google Cloud

Task 1. Set a default compute zone

gcloud config set compute/zone us-central1-a

Task 2. Create a GKE cluster

gcloud container clusters create [CLUSTER-NAME]

Task 3. Get authentication credentials for the cluster

gcloud container clusters get-credentials [CLUSTER-NAME]

Task 4. Deploy an application to the cluster

  • Deployment

    • Provides declarative updates for Pods and ReplicaSets.

  • Services

    • Abstrac way to expose an application running on a set of Pods as a network service.

✔️ Create a new Deployment

kubectl create deployment hello-server --image=gcr.io/google-samples/hello-app:1.0

✔️ Create a Kubernetes Service

kubectl expose deployment hello-server --type=LoadBalancer --port 8080

✔️ Inspect the Service

kubectl get service

✔️ View the application from your web browser, open a new tab and enter the following address.

http://[EXTERNAL-IP]:8080

Task 5. Deleting the cluster

gcloud container clusters delete [CLUSTER-NAME]

Summary

  • Get hands-on practice with container creation and application deployment with GKE.

Last updated