Google Cloud Kubernetes Basic Commands To Deploy An Application:

  1. First create a Kubernetes Cluster K1

gcloud container clusters create k1

k1.jpg

2. Deploy an app from google container registry

kubectl run app –image gcr.io/google-samples/hellp-app:1.0

k1-1

3. You can see the deployment status using the below command

  kubectl get pods

k1-2

4 Now scale up replicas to 4 using the below command

kbectl scale deployment app –replicas 4

k1-3

5. Verify the replica status using the command kubectl get podsK1-4

6. Now expose your app to the world by exposing the port 80

kubectl expose deployment app –port 80 –type=loadbalancer

k1-6

7. Now verify the website using cluster public IP

K1-7