Loading Posts...

How To Start Working With Google Kubernetes Engine (GKE)

I’m a great fan of Google Cloud Platform and I have been actively working with this cloud platform in few of my projects and let’s see How to start working with Google Kubernetes Engine aka GKE. I’m pretty impressed with GKE and thought to write about the initial deployment and start working with this world famous platform.

If you have not worked or tried Google Cloud Platform, I suggest you to go ahead and sign up with a free account and play around with this cloud platform.

To getting started just click on the top menu which we call as “Hamburger Menu” and select “Kubernetes Engine” -> “Clusters

Click on “Create cluster

When you are creating a cluster you can define below information for your cluster

  • Cluster Name
  • Location Type (Zonal or Regional)
  • Master Version
  • Node Pool Configuration (Advanced Configuration Option)

In the node pool configuration, node version, automatic scaling configuration and image version can be selected

Node resource customization is fully adjustable and you can have custom resource allocated node for your node pool

Few other parameters such as, auto upgrade and repair of the nodes, access scopes and metadata can be configured at the bottom of the window and “Save” the node pool configuration

Open the “Advanced Options” to do the Networking and Availability Configuration

Availability Zones, custom VPC and subnet, custom Pod address range and smoother networking configuration is available under this advanced configuration option

Note: One important thing to remember when you are selecting additional availability zones to your cluster, eventually additional nodes will be deployed and there is an additional cost involvement to your cloud bill. Keep that in your mind.

In my node configuration, I had 6 nodes with 2 pools, after selecting two additional Availability zones my node size extended to 18

Stackdriver can be enabled for the Logging and Monitoring of your Kubernetes cluster, I will discuss this configuration in a different post.

Once these configuration options are completed, cluster can be simply created with the “Create” button which can be seeing at the bottom of the window

It will take sometime to complete the deployment, you can see the status of the cluster deployment in the same window

Once it completes the deployment you can see the status of the cluster and the configuration details

Node Pool configurations also visible at the bottom of the Window

Storage and Node details are available at the top of the Tabs, Node status will be clearly visible with the information

Cloud Console can be leverage to connect to the GKE cluster, set your cluster and the project to complete the connection

“Kubectl” commands available to manage the GKE cluster

Running commands in a full screen tab

Creating A Deployment In GKE Cluster

Deployment can be easily created in GKE cluster, just click on the “Deploy” option at the top and you’ll be redirecting to the Deployment Wizard

Select the container image, I selected the existing “nginx” container image for my deployment

Provide an “Application Name”, “Namespace”, “Labels” and “Cluster”. I have deployed only single cluster so, one cluster will be visible in the drop down menu

You can also view the YAML output of the deployment

Once the deployment succeeded, deployment status can be seen under the workloads

“Expose” The Deployment

After completing the Deployment, it should be “exposed” to the outside world to access the application. To “Expose” the application click on the “Expose” button under the Workload section

Configure the “Port Mapping”, “Service type”, “Service Name” and click on “Expose” to publish the application

Once it complete the operation just click on the “External endpoint” IP

Your “Nginx” page will be loaded on your browser

If you go back and check your “Compute Engine” section you can see that your Kubernetes Engine is running on top of the VM Instances

This is a bit of a lengthier post and I just wanted to touch all of the basics with Google Kubernetes Engine, and I hope anyone who needs to see how GKE is working this post is a good start for them.

Click to rate this post!
[Total: 5 Average: 5]

Aruna Lakmal

Associate Technical Specialist, Sri Lanka. Technology junky, enthusiast, a VMware vExpert and a blogger with more than 8 years of Experience in Virtualization and Cloud Native technologies.

Get Updates Directly To Your Inbox!

   

Leave a Comment

Loading Posts...