How to Generate the Scaffold Aggregated Apiserver

Learn how to generate a scaffold project for the aggregated apiserver.

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 use the development kit apiserver-builder to help generate a scaffold repository for our custom APIs. The apiserver-builder is a collection of libraries and tools, which are built to help users build native Kubernetes extensions using Kubernetes apiserver aggregation.

In this lesson, we will do the second options and create an empty repository using the apiserver-builder. During this lesson, we’re using the terminal below for developing and testing.

Get hands-on with 1400+ tech skills courses.