How to setup Kubernetes cluster on AWS

How to setup Kubernetes cluster on AWS

Step-by-Step to Setting Up Kubernetes on AWS

In this edition of our Kubernetes consulting series, we’ll take you through a step-by-step to launching Kubernetes on Amazon Web Services.

 

Running an application in the cloud without the proper tools to manage it and improve its functionality can be tricky. That is why when deploying a customer’s application you want to have the means for fast deployment, features roll out, resource management, resilience and automation of certain operations. Kubernetes is an open-source platform that gives you a set of tools to do just that.

 

Today we will run Kubernetes multi-master cluster on AWS and deploy a simple application. We’ll use kops (Kubernetes Operations), which is a utility for managing Kubernetes clusters. In our opinion, currently kops is the best tool for deploying Kubernetes clusters in Amazon Web Services
.

1. Creating a zone in Route53:

2. Creating an S3 bucket to store the cluster configuration:

We include versioning:

3. Creating our new cluster

name                          cluster name should be identical to zone name

master-zones            zones where masters will be launched

zones                          zones where the nodes will be located

state                            configuration storage bucket

node-count                a number of nodes in the cluster

yes                               applies changes

Checking availability of the cluster:

The output:

Kops also creates settings for kubectl. We can also do:

The output:

To edit nodes configuration, we do this:

Editing the file:

Saving the file and applying the configuration:

Checking the state of the cluster:

The output:

For convenience, let’s deploy a dashboard:

Dashboard will be available at:

https://api.example.com/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/#!/pod?namespace=default

 

Now we will deploy a simple web application, with a setup for balancer with ssl and a domain name

 

To associate Kubernetes with Route53, we’ll need to deploy pod:

In the IAM role, we’ll need to find the names of the nodes and add policy:

Writing a yaml file for Deployments:

Now creating a yaml file for Service:

After deployment, we’ll see our application at https://projectci.example.com

 

And in the AWS console we’ll see the newly created balancer:

That’s it! You’re good to go. You might also be interested in other articles in our Kubernetes series such as Our Guide for Hashicorp Consul/Vault with Kubernetes.

K&C – IT Services & Cloud Consulting Made In Germany

Munich-based K&C has over 20 years of experience as an IT Services consultant and outsourced development resource. We provide DevOps, Cloud services, Serverless architecture design and many other areas of expertise across contemporary development technology stacks and consultancy.

 

Our partners span some of Europe’s best known brands, exciting start-ups and well established SMEs – all of whom have learned to trust completely our combination of German management and nearshored tech talent to realise their outsourced IT needs.

 

We’d be delighted to hear about any project or problem we might be able to help you with! Just drop us a line or pick up the phone.

Add comment

E-mail is already registered on the site. Please use the Login form or enter another.

You entered an incorrect username or password

Sorry that something went wrong, repeat again!
Contact us