Create Kubernetes cluser using gcloud

Login to gcloud with

Set default region

To create a cluser, run

To create a cluster with 2 nodes, run

To specify compute engine type during cluster creation, run

You can also specify scopes, this allow you to give the cluster permission to access other google cloud resources. For example to allow cluster access Cloud Source Repositories and Google Container Registry. run

To list your container, run

gcloud clusters

Before you can use cluser, you need to get authentication credentials with command

To interact with Kubernetes, you need kubectl, on Ubuntu, yu can install it with

To deploy a container, run

This will deploy google provided hello-app container to the cluser.

To make the application available to public, create a loadbalancer service.

Now find IP of the LoadBalacner service with command

From the result, we found EXTERNAL-IP for LoadBalancer is 35.232.226.216. To access the application, go to url


http://35.232.226.216:8080

See Kubernetes

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *