Using Kubernetes API from Go
summary
Shows how to use client-go to build a real tool that monitors node image storage and alerts on size changes, using trash to vendor dependencies and dapper to build an Ubuntu image; demo compiles, runs outside the cluster with a kubeconfig or in-cluster via service account, and replaces crude polling with informers and ListWatch to get event callbacks and a local cache. RBAC requires creating a ClusterRole (get/watch/list/update) and a ServiceAccount; deployment runs and the image pull triggers the expected alert.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 0:57Why we love Kubernetes
- 2:36Kubernetes ecosystem
- 3:17Extending Kubernetes
- 5:05What is Kubernetes Controller
- 6:26How to talk to Kubernetes API
- 7:55Why Go
- 8:37Build from Scratch
- 9:06Tools
- 10:32Add Go dependency
- 11:39Cluster vs outside of cluster
- 14:15Config
- 15:22Node function
- 16:35Override
- 17:37Node polling
- 18:32Informer
- 19:29namespace
- 21:24Shared Informer
- 26:15Deploy
- 29:50Permissions
- 32:03Controller
related talks
20mUsing Kubernetes API Effectively with Golang
20mHow to Secure Your Node.js Containers on Kubernetes With Best Practices
01h 49mHands-on Intro to Kubernetes (and OpenShift) for JS Developers
28mScaling Node.js Applications with Kubernetes and Docker
30mNode.js in a Kubernetes World
35mDeep Dive: Virtual Kubelet
21mScaling Node.js applications with Kubernetes and Docker
01h 45mHands On Intro to Kubernetes & OpenShift for JS Hackers
