As a tech leader and developer, I like to focus my effort in writing code or invest my efforts in architecting web software.
I like to move fast from code to deploy, especially in the development process, and using great ui solution, such as Google’s Cloud Kubernetes Engine is very useful for me, as I can avoid getting deep diving into DevOps orchestration.
In this article I’ll go thru on how to deploy a node containerized application to Google’s Kubernetes Cluster using only the GKE UI.
First we will need to create a GKE Cluster. Just login to google’s cloud console and from the menu head to Kubernetes Engine -> Clusters.
Before we can actually create the cluster, we’ll need to wait for the Kubernetes Engine Api beeing enabled.
Creating a Kubernetes Cluster
button and select our desired configuration. Google offer almost every preset needed to get started, either to play around or to set up a production ready high availability Kubernetes clusters.
We’ll go with the default Standard Cluster.
Google will now create the cluster for us. Meanwhile we can dockerize our node application.
Node.Js Express App
This is our simple express app that will display the request headers and the hostname in JSON:
And this is Dockerfile we will use:
To buid the image we will run docker build command with the your dockerhub repo:
$ docker build -t alonronin/node-env .
And push it to dockerhub’s using the docker push command:
$ docker push alonronin/node-env
Creating a Deployment
button at the top.
button and after on the
button to the Configuration section.
button and press it.
with default of
replicas and an autoscale (HPA) between
1 - 5
Creating a Service
, let’s click on the deployment and hit the expose
by default, but you can change that to any port you want, and we will need to tell it the target port of the container, which is
in our express app listening port.
we can configure it to receive a traffic from the web, we need to create an
Creating an Ingress
button at the top.
as the Backends service.
as the HTTP will be created by default.
Create a new certificate
from the Certificate drop down.
certificate so it will issued and renewed automatically by google. Add the domain and the name for the certificate and click the
and transfer traffic from Google’s Load Balancers to our
and from the
and from there to our
record for our domain to that IP Address.
Check the certificate status
This can take up until an hour, according to google’s docs, so be patient.
Going to the domain we configured we can see everything is just fine and our express app is working as expected.
So we managed to create a Kubernetes cluster, ready for production, only by using the GKE UI.
We accomplished to:
- Create docker image for our application and push it to Dockerhub’s repo.
- Create a Kubernets Cluster
- Create a Deployment
- Create a Service
- Create an Ingress
- Create an auto managed SSL Certificate
If you have any question, suggestion or you find a mistake I’ve made, feel free to comment on it.