VM based deployments to Kubernetes

Starting your journey with Captain Kube

Bhavin Gandhi

InfraCloud Technologies

The beginning

phippy-01-1.png

Image Credits: phippy.io (CC-BY 4.0)

  • Application with minimum business logic
  • Less number of users
  • Small team of engineers

Infrastructure

  • Deployed as few Virtual Machines (VMs)

The growth

  • More users
  • Demand for new features

  • More number of engineers
  • Need of moving faster with new features

What about the infrastructure?

Should the way we deploy things change?

Continuous Delivery with VMs

  • Building VM images for application updates
  • Using tools like Ansible, Puppet

Shortcomings

kubernetes-illustrated-guide-illustration-3-1.png

Image Credits: phippy.io (CC-BY 4.0)

Time consuming

  • VMs take time to boot
  • Building VM images
  • OS updates

Auto scaling

  • No metrics about actual consumption of application
  • Scaling based on VMs memory/CPU usage

Introducing Kubernetes

“Kubernetes” is the Greek word for a ship’s captain.

The Kubernetes project focuses on building a robust platform for running thousands of containers in production.

What Kubernetes offers

  • Networking, scheduling, load balancing, autoscaling
  • Declarative approach to deployments
  • Abstraction over underlying infrastructure
  • And many more.

How Kubernetes helps

  • No need to manage individual VMs
  • Common/Standard industry patterns for deploying things
  • No vendor lock in

Migrating to Kubernetes

Containerizing applications

kubernetes-illustrated-guide-illustration-4-1.png

Image Credits: phippy.io (CC-BY 4.0)

Containers?

Isolated processes running with their dependencies

Best practices

  • One process per container
  • Try to keep the images lightweight
  • No direct lift and shift from VM images (Packer)
  • Logging to stdout and stderr

Ready to sail with Captain Kube?

kubernetes-illustrated-guide-illustration-6-1.png

Image Credits: phippy.io (CC-BY 4.0)

Challenges running in Kubernetes

  • Resource limits
  • Interprocess communication

Don't miss this

  • Pod IPs are ephemeral
  • Health check end points for applications
  • Resource requests and limits for each application
  • Use community Helm charts and operators
  • Namespaces per application or teams

Migration strategies

  • Lift and shift all the applications
  • Migrate gradually

Migrating gradually

Start with stateless applications followed by stateful applications and then move databases

  • One application at a time
  • One API end point at a time

Should I run my monoliths?

YES! YES! YES!

Make sure you containerize them correctly

Cluster management

Deploying the cluster

  • Using managed cluster solutions
    • GKE, EKS, AKS, …
  • Self managed clusters
    • Rancher, kops, Kubespray, …

Backup and restore

Use tools like Velero

Cluster updates

One minor release every 3 months

The way ahead

  • Checkout tools from CNCF landscape
  • Prometheus for metrics collection
  • Argo for CI/CD
  • nginx-ingress to expose services publicly

Questions

bhavin192[at]geeksocket.in

@_bhavin192

References

These slides are released publicly under

Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)