logo

Choose Wisely: Understanding Kubernetes Selectors - Christopher Hanson, RX

Authors:   Christopher Hanson


Summary

Understanding Kubernetes selectors and their use by controllers in managing objects in a Kubernetes cluster
  • Labels and annotations are used to identify and select objects in a Kubernetes cluster
  • Selectors are used by controllers to manage objects such as deployments, replica sets, and jobs
  • Different controller behaviors with selectors are explored through live demos
  • Advanced deployment patterns such as red/black, highlander, and canary can be achieved natively in Kubernetes via labels/selectors
The speaker demonstrates the use of labels and selectors in Kubernetes by showing how they can be used to select and manage pods, services, and other objects in a cluster. He also shows how different controllers use selectors to manage objects and explores advanced deployment patterns that can be achieved through labels and selectors.

Abstract

Kubernetes uses labels and selectors to tie otherwise distinct API objects together. Application controllers like ReplicaSets use labels on pods to enforce replication factor; Services (via Endpoint controllers) also use labels on pods to identify endpoints for routing client traffic. However, not all controller behavior is the same! Some controllers add extra label metadata to avoid potential collisions and others do not! Through a series of live demos, this session explores the use of labels and selectors used by controllers so that you can clearly understand and use both to your advantage when deploying apps on Kubernetes. The talk will conclude with examples of advanced deployment patterns such as red/black, highlander, and canary that can be achieved natively in Kubernetes via labels/selectors.

Materials:

Tags:

Post a comment

Related work