Posts Tagged kubernetes

How do Kubernetes Deployments work?

How do Kubernetes Deployments work?

This post is part 3 in a series on the Kubernetes API. Earlier, Part 1 focused on the lifecycle of a Pod and Part 2 focused on the lifecycle of a Service.

What is happening when a Deployment rolls out a change to your app? What does it actually do when a Pod crashes or is killed? What happens when a Pod is re-labled so that it’s not targeted by the Deployment?

Deployment is probably the most complex resource type in Kubernetes core. Deployment specifies how changes should be rolled out over ReplicaSets, which themselves specify how Pods should be replicated in a cluster.

In this post we continue our exploration of the Kubernetes API, cracking Deployment open using kubespy, a small tool we developed to observe Kubernetes resources in real-time.

Read more →

kubespy trace: a real-time view into of a Kubernetes Service

kubespy trace: a real-time view into of a Kubernetes Service

This post is part 3 in a series on the Kubernetes API. Earlier, Part 1 focused on the lifecycle of a Pod, and later Part 3 details how Kubernetes deployments work.

Why isn’t my Pod getting any traffic?

An experienced ops team running on GKE might assemble the following checklist to help answer this question:

  1. Does a Service exist? Does that service have a .spec.selector that matches some number of Pods?
  2. Are the Pods alive and has their readiness probe passed?
  3. Did the Service create an Endpoints object that specifies one or more Pods to direct traffic to?
  4. Is the Service reachable via DNS? When you kubectl ``exec into a Pod and you use curl to poke the Service hostname, do you get a response? (If not, does any Service have a DNS entry?)
  5. Is the Service reachable via IP? When you SSH into a Node and you use curl to poke the Service IP, do you get a response?
  6. Is kube-proxy up? Is it writing iptables rules? Is it proxying to the Service?

This question might have the highest complexity-to-sentence-length ratio of any question in the Kubernetes ecosystem. Unfortunately, it’s also a question that every user finds themselves asking at some point. And when they do, it usually means their app is down.

To help answer questions like this, we’ve been developing a small diagnostic tool, kubespy. In this post we’ll look at the new kubespy trace command, which is broadly aimed at automating questions 1, 2, 3, and providing “hints” about 4 and 5.

Read more →

Program Kubernetes with 11 Pulumi Pearls

Program Kubernetes with 11 Pulumi Pearls

In this post, we’ll take a look at 11 “pearls” – bite-sized code snippets – that demonstrate using Pulumi to build and deploy Kubernetes applications using cloud native infrastructure as code. These pearls are organized into three categories, each demonstrating a unique scenario:

  • Config as Code: Use your favorite language for authoring applications and configuration, eliminating toil and YAML.
  • Multi-Cloud Infrastructure: Mix cloud services alongside Kubernetes resources and manage them using one set of tools and workflows.
  • Software Delivery as Code: Perform sophisticated continuous delivery of your Kubernetes deployments – including canaries, staged rollouts, leveraging cloud native projects like Envoy and Prometheus – authored in code using familiar languages.

Read more →

Cloud Native Infrastructure with Kubernetes and Pulumi

Cloud Native Infrastructure with Kubernetes and Pulumi

Kubernetes has quickly become the “gold standard” for running containers in production, spanning public, private, and hybrid cloud scenarios. It’s been remarkable to watch its explosive growth just this past year alone. Every cloud vendor now supports an easy-to-use managed Kubernetes solution — Google GKE, Azure AKS, and AWS AKS — making it easier than ever to start writing and deploying Kubernetes applications.

Pulumi for Kubernetes is a way to create, deploy, and manage Kubernetes applications using your favorite programming languages. that works across AWS, Azure, Google Cloud, OpenStack, and other clouds, now to Kubernetes and cloud native architectures. You can dive right in here and look at some powerful things Pulumi enables here.

Read more →

Simple, Reproducible Kubernetes Deployments

Simple, Reproducible Kubernetes Deployments

Kubernetes is a powerful container orchestrator for cloud native applications that can run on any cloud – AWS, Azure, GCP – in addition to hybrid and on-premises environments. Its CLI, kubectl, offers basic built-in support for performing deployments, but intentionally stops short here. In particular, it doesn’t offer diffs and previews, the ability to know when a deployment has succeeded or failed, and why, and/or sophisticated deployment orchestration.

In this post, we’ll see how Pulumi, an open source cloud native development platform, can not only let you express Kubernetes programs in familiar programming languages, like TypeScript, instead of endless YAML templates, but also how Pulumi delivers simple and reproducible, yet powerful, Kubernetes deployment workflows.

Read more →