Search⌘ K
AI Features

How to Generate the Scaffold Aggregated Apiserver

Explore the process of generating scaffolded aggregated apiservers in Kubernetes using the apiserver-builder toolkit. Learn to create custom API groups, define resources with subresources, auto-generate code, build container images, and produce deployment files for easy application within a Kubernetes cluster. This lesson equips you with practical skills to extend Kubernetes APIs efficiently.

Overview

Aggregated apiservers are complex and hard to implement from scratch. There are lots of API schema, auto generated codes, golang build tags, deployments files, TLS certificates for communication, delegated auth, etc.

Ways to build custom aggregated apiservers

Normally, there are two ways to build custom aggregated apiservers.

  • We could fork the repository k8s.io/sample-apiserver, modify it to add our own custom types, and then periodically rebase upstream changes to pick up improvements and bug fixes. This repository is used only for demonstration. However, it contains all the needed files—including source codes, deployment artifacts, and hack scripts—which can be used for codes’ auto generating and containers’ image building.

  • We could ...