Posts in Kubernetes

Build and deploy Flask app to EKS

Here’s an example of how to adopt DevOps approach in your development process.

Code your application

In this example we’ll use Flask to build a website and you can adopt this approach to any programming language

This app is simple Flask (video link bellow) with one route that returns index.html file.

Build your application

Once the current version is ready you can build the project, the pipeline should include build and tests.

If you’re using Static-typed language then you’ll need to compile the application before building the container image and then copy the artifact to the image.

For Dynamic-typed languages there no compile so it’s just building the container image using CI pipeline.

Deploy your application

To keep a software product updated and maintained, the deployment process should be on-demand and easy (click a button).

This code > test > deployment should be repeated for every code change.

What can be accomplished here?

By doing the work (coding) and implementing a deployment process the gap between development and production is resolved and the outcome is faster software delivery (CD) with reliable code (tests).

So DevOps is an approach and a way to build software.

Check this video tutorial for E2E build and deploy Flask website to Kubernetes cluster (EKS).

ClusterIP vs. NodePort

What are ClusterIP and NodePort? (in K8S)

First, let’s describe a service, A service is a way to expose an application running on a pod or a set of pods.

so to connect to that application we need a service.

What types of services can you use?

The “types” of services can be:

  • ClusterIP
  • NodePort
  • LoadBalancer
  • ExternalName

let’s focus on ClusterIP and NodePort for this blog post.

What is ClusterIP?

ClusterIP exposes the service for cluster internal communication, only within the Kubernetes cluster.

What is NodePort?

NodePort exposes the service for the cluster external communication.

to access the application you’ll need the IP of the node and the port.

<NodeIP>:<NodePort>