kubebuilder

module
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0

README

Build Status Go Report Card

Kubebuilder

Kubebuilder is a framework for building Kubernetes APIs using custom resource definitions (CRDs).

Note: kubebuilder does not exist as an example to copy-paste, but instead provides powerful libraries and tools to simplify building and publishing Kubernetes APIs from scratch.

Installation

It is strongly recommended that you use a released version. Release binaries are available on the releases page. Follow the instructions to install Kubebuilder.

Getting Started

See the Getting Started documentation.

Quick Start

Documentation

Check out the Kubebuilder book.

Resources

Motivation

Building Kubernetes tools and APIs involves making a lot of decisions and writing a lot of boilerplate.

In order to facilitate easily building Kubernetes APIs and tools using the canonical approach, this framework provides a collection of Kubernetes development tools to minimize toil.

Kubebuilder attempts to facilitate the following developer workflow for building APIs

  1. Create a new project directory
  2. Create one or more resource APIs as CRDs and then add fields to the resources
  3. Implement reconcile loops in controllers and watch additional resources
  4. Test by running against a cluster (self-installs CRDs and starts controllers automatically)
  5. Update bootstrapped integration tests to test new fields and business logic
  6. Build and publish a container from the provided Dockerfile

Scope

Building APIs using CRDs, Controllers and Admission Webhooks.

Philosophy

Provide clean library abstractions with clear and well exampled godocs.

  • Prefer using go interfaces and libraries over relying on code generation
  • Prefer using code generation over 1 time init of stubs
  • Prefer 1 time init of stubs over forked and modified boilerplate
  • Never fork and modify boilerplate

Techniques

  • Provide higher level libraries on top of low level client libraries
    • Protect developers from breaking changes in low level libraries
    • Start minimal and provide progressive discovery of functionality
    • Provide sane defaults and allow users to override when they exist
  • Provide code generators to maintain common boilerplate that can't be addressed by interfaces
    • Driven off of //+ comments
  • Provide bootstrapping commands to initialize new packages

Troubleshooting

  • Bugs and Feature Requests:

    If you have what looks like a bug, or you would like to make a feature request, please use the Github issue tracking system. Before you file an issue, please search existing issues to see if your issue is already covered.

  • Slack

    For realtime discussion, you can join the #kubebuilder slack channel. Slack requires registration, but the Kubernetes team is open invitation to anyone to register here. Feel free to come and ask any questions.

Contributing

Contributions are greatly appreciated. The maintainers actively manage the issues list, and try to highlight issues suitable for newcomers. The project follows the typical GitHub pull request model. See CONTRIBUTING.md for more details. Before starting any work, please either comment on an existing issue, or file a new one.

Directories

Path Synopsis
cmd
docs
book/utils Module
pkg
scaffold
Package scaffold contains libraries for scaffolding code to use with controller-runtime
Package scaffold contains libraries for scaffolding code to use with controller-runtime
test
e2e
The signals package contains e2e tests for kubebuilder
The signals package contains e2e tests for kubebuilder
e2e/framework/ginkgowrapper
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string.
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string.
project/pkg/apis
Package apis contains Kubernetes API groups.
Package apis contains Kubernetes API groups.
project/pkg/apis/creatures
Package creatures contains creatures API versions
Package creatures contains creatures API versions
project/pkg/apis/creatures/v2alpha1
Package v2alpha1 contains API Schema definitions for the creatures v2alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures +k8s:defaulter-gen=TypeMeta +groupName=creatures.testproject.org Package v2alpha1 contains API Schema definitions for the creatures v2alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures +k8s:defaulter-gen=TypeMeta +groupName=creatures.testproject.org
Package v2alpha1 contains API Schema definitions for the creatures v2alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures +k8s:defaulter-gen=TypeMeta +groupName=creatures.testproject.org Package v2alpha1 contains API Schema definitions for the creatures v2alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/creatures +k8s:defaulter-gen=TypeMeta +groupName=creatures.testproject.org
project/pkg/apis/crew
Package crew contains crew API versions
Package crew contains crew API versions
project/pkg/apis/crew/v1
Package v1 contains API Schema definitions for the crew v1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew +k8s:defaulter-gen=TypeMeta +groupName=crew.testproject.org Package v1 contains API Schema definitions for the crew v1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew +k8s:defaulter-gen=TypeMeta +groupName=crew.testproject.org
Package v1 contains API Schema definitions for the crew v1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew +k8s:defaulter-gen=TypeMeta +groupName=crew.testproject.org Package v1 contains API Schema definitions for the crew v1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/crew +k8s:defaulter-gen=TypeMeta +groupName=crew.testproject.org
project/pkg/apis/policy
Package policy contains policy API versions
Package policy contains policy API versions
project/pkg/apis/policy/v1beta1
Package v1beta1 contains API Schema definitions for the policy v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/policy +k8s:defaulter-gen=TypeMeta +groupName=policy.testproject.org Package v1beta1 contains API Schema definitions for the policy v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/policy +k8s:defaulter-gen=TypeMeta +groupName=policy.testproject.org
Package v1beta1 contains API Schema definitions for the policy v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/policy +k8s:defaulter-gen=TypeMeta +groupName=policy.testproject.org Package v1beta1 contains API Schema definitions for the policy v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/policy +k8s:defaulter-gen=TypeMeta +groupName=policy.testproject.org
project/pkg/apis/ship
Package ship contains ship API versions
Package ship contains ship API versions
project/pkg/apis/ship/v1beta1
Package v1beta1 contains API Schema definitions for the ship v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship +k8s:defaulter-gen=TypeMeta +groupName=ship.testproject.org Package v1beta1 contains API Schema definitions for the ship v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship +k8s:defaulter-gen=TypeMeta +groupName=ship.testproject.org
Package v1beta1 contains API Schema definitions for the ship v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship +k8s:defaulter-gen=TypeMeta +groupName=ship.testproject.org Package v1beta1 contains API Schema definitions for the ship v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/kubebuilder/test/project/pkg/apis/ship +k8s:defaulter-gen=TypeMeta +groupName=ship.testproject.org

Jump to

Keyboard shortcuts

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