apiserver-builder-alpha

module
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2019 License: Apache-2.0

README

apiserver-builder-alpha

Build Status Go Report Card

Unless you absolutely need apiserver-aggregation, you are recommended to use Kubebuilder instead of apiserver-builder for building Kubernetes APIs. Kubebuilder builds APIs using CRDs and addresses limitations and feedback from apiserver-builder.

Apiserver Builder is a collection of libraries and tools to build native Kubernetes extensions using Kubernetes apiserver aggregation. Aggregated apiserver empowers you to customize your apiserver to do following things cannot achieved by CR[D]:

  • Makes your apiserver adopt different storage APIs rather than ETCDv3
  • Extends long-running subresources/endpoints like websocket for your own resources
  • Integrates your apiserver with whatever other external systems

Motivation

Addon apiservers are a Kubernetes extension point allowing fully featured Kubernetes APIs to be developed on the same api-machinery used to build the core Kubernetes APIS, but with the flexibility of being distributed and installed separately from the Kubernetes project. This allows APIs to be developed outside of the Kubernetes repo and installed separately as a package.

Building addon apiservers directly on the raw api-machinery libraries requires non-trivial code that must be maintained and rebased as the raw libraries change. The goal of this project is to make building apiservers in Go simple and accessible to everyone in the Kubernetes community.

apiserver-builder provides libraries, code generators, and tooling to make it possible to build and run a basic apiserver in an afternoon, while providing all of the hooks to offer the same capabilities when building from scratch.

Highlights

  • Tools to bootstrap type definitions, controllers (powered by controller-runtime framework), tests and documentation for new resources
  • Tools to build and run the extension control plane standalone and in minikube and remote clusters.
  • Easily watch and update Kubernetes API types from your controller
  • Easily add new resources and subresources
  • Provides sane defaults for most values, but can be overridden

Examples

  • BasicExample: Various simple resource examples.
  • KineExample: Plumbs aggregated apiserver over SQL-storages including sqlite, mysql, etc..
  • PodLogsExample: Serves pod/logs in aggregation layer to offload kube-apiserver connections.
  • PodExecExample: Serves pod/exec in aggregation layer to offload kube-apiserver connections.

Guides

Note: The guides are presented roughly in the order of recommended progression.

Installation guide

Download the latest release and install on your PATH.

installation guide

Building APIs concept guide

Conceptual information on how APIs and the Kubernetes control plane is structure and how to build new API extensions using apiserver-builder.

If you want to get straight to building something without knowing all the details of what is going on, skip ahead to the tools guide and come back to this later.

api building concept guide

Tools user guide

Instructions on how to use the tools packaged with apiserver-builder to build and run a new apiserver.

tools guide

Step by step example

List of commits showing apiserver-boot commands run and the corresponding changes:

https://sigs.k8s.io/apiserver-builder-alpha/commits/example-simple

Coding and libraries user guide

Instructions for how to implement custom APIs on top of the apiserver-builder libraries.

libraries guide

Concept guides

Conceptual information on addon apiservers, such as how auth works and how they interact with the main Kubernetes API server and API aggregator.

Concepts

Additional material

Using delegated auth with minikube

Instructions on how to run an apiserver using delegated auth with a minikube cluster

Details here

Community, discussion, contribution, and support

Learn how to engage with the Kubernetes community on the community page.

You can reach the maintainers of this project at:

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

Directories

Path Synopsis
cmd module
example
basic/pkg/apis/innsmouth
Package api is the internal version of the API.
Package api is the internal version of the API.
basic/pkg/apis/innsmouth/v1
+groupName=innsmouth.k8s.io
+groupName=innsmouth.k8s.io
basic/pkg/apis/kingsport
Package api is the internal version of the API.
Package api is the internal version of the API.
basic/pkg/apis/kingsport/v1
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/basic/pkg/apis/kingsport +k8s:defaulter-gen=TypeMeta +groupName=kingsport.k8s.io
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/basic/pkg/apis/kingsport +k8s:defaulter-gen=TypeMeta +groupName=kingsport.k8s.io
basic/pkg/apis/miskatonic
Package api is the internal version of the API.
Package api is the internal version of the API.
basic/pkg/apis/miskatonic/v1beta1
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/basic/pkg/apis/miskatonic +k8s:defaulter-gen=TypeMeta +groupName=miskatonic.k8s.io
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/basic/pkg/apis/miskatonic +k8s:defaulter-gen=TypeMeta +groupName=miskatonic.k8s.io
basic/pkg/apis/olympus
Package api is the internal version of the API.
Package api is the internal version of the API.
basic/pkg/apis/olympus/v1beta1
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/basic/pkg/apis/olympus +k8s:defaulter-gen=TypeMeta +groupName=olympus.k8s.io
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/basic/pkg/apis/olympus +k8s:defaulter-gen=TypeMeta +groupName=olympus.k8s.io
basic/pkg/openapi
Package openapi exists to hold generated openapi code
Package openapi exists to hold generated openapi code
kine/pkg/apis/sqlite
Package api is the internal version of the API.
Package api is the internal version of the API.
kine/pkg/apis/sqlite/v1alpha1
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/kine/pkg/apis/sqlite +k8s:defaulter-gen=TypeMeta +groupName=sqlite.example.com
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/kine/pkg/apis/sqlite +k8s:defaulter-gen=TypeMeta +groupName=sqlite.example.com
podexec/pkg/apis/podexec
Package api is the internal version of the API.
Package api is the internal version of the API.
podexec/pkg/apis/podexec/v1
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/podexec/pkg/apis/podexec +k8s:defaulter-gen=TypeMeta +groupName=podexec.example.com
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/podexec/pkg/apis/podexec +k8s:defaulter-gen=TypeMeta +groupName=podexec.example.com
podlogs/pkg/apis/podlogs
Package api is the internal version of the API.
Package api is the internal version of the API.
podlogs/pkg/apis/podlogs/v1
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/podlogs/pkg/apis/podlogs +k8s:defaulter-gen=TypeMeta +groupName=podlogs.example.com
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/apiserver-builder-alpha/example/podlogs/pkg/apis/podlogs +k8s:defaulter-gen=TypeMeta +groupName=podlogs.example.com
podlogs/pkg/client/clientset_generated/clientset
This package has the automatically generated clientset.
This package has the automatically generated clientset.
podlogs/pkg/client/clientset_generated/clientset/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
podlogs/pkg/client/clientset_generated/clientset/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
podlogs/pkg/client/clientset_generated/clientset/typed/podlogs/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
podlogs/pkg/client/clientset_generated/clientset/typed/podlogs/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
basic Module
kine Module
non-etcd Module
podexec Module
podlogs Module
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL