crd-reconciler-for-kubernetes

module
v0.0.0-...-bb7034b Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0

README

DISCONTINUATION OF PROJECT.

This project will no longer be maintained by Intel.

Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.

Intel no longer accepts patches to this project.

If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project.

crd-reconciler-for-kubernetes

  • Controllers to interpret CRDs to Kubernetes-native constructs and report health of those sub-resources.

  • Library and docs for writing controllers that reconcile against CRDs.

Build

The build depends on:

Quick-start
# Build a docker image containing only source dependencies:
$ make dep

# Run library tests, controller tests and build the controller images:
$ make
Intermediate container images

All builds and tests happen inside of a container. Each controller program (packages in ./cmd/...) builds its own result container that can be deployed in the local integration environment or a target cluster.

There are two intermediate container images:

  • crd-reconciler-for-kubernetes-dep -- contains only source dependencies, separate to speed up local dev iterations

  • crd-reconciler-for-kubernetes -- base image for all controller images, built on top of crd-reconciler-for-kubernetes-dep.

Most useful Make targets
  • make dep: Build a docker image containing only source dependencies and tag it as crd-reconciler-for-kubernetes-dep:$(version). This step is a prerequisite to run the other targets, and must be run explicitly.

  • make docker: Build a docker image containing the source repo, running the ./pkg/... tests in the process.

  • make controllers: Build all controller images (also runs tests.)

  • make <controller-name>: Build the controller image (also runs tests.)

  • make env-up and make env-down: Bring up/down the integration environment using docker-compose. List service status using e.g. docker-compose ps.

  • make dev TARGET=[test|example-controller...]: Drop into bash inside the source repo container in the integration environment. Run after make env-up. TARGET defaults to 'test' and can also be set in your SHELL profile

  • make test-e2e: Run the end-to-end integration tests.

  • make debug TARGET=[test|example-controller...]: Attach to the process running in the TARGET container. See tutorial. TARGET defaults to 'test' and can also be set in your SHELL profile

Dependency management

This project uses dep.

Cheatsheet:

  • dep ensure restores source dependencies
  • dep ensure --add github.com/<foo>/<bar> adds a new source dependency

After running dep ensure --add or manually editing Gopkg.toml, you must manually re-run make dep to update your local crd-reconciler-for-kubernetes-dep image. Otherwise, the other make targets will be based off of an outdated set of source dependencies.

Directories

Path Synopsis
cmd
example-controller
Note: the example only works with the code within the same release/branch.
Note: the example only works with the code within the same release/branch.
example-controller/apis/cr/v1
+k8s:deepcopy-gen=package
+k8s:deepcopy-gen=package
pkg
crd
crd/fake
+k8s:deepcopy-gen=package
+k8s:deepcopy-gen=package
resource/fake
+k8s:deepcopy-gen=package
+k8s:deepcopy-gen=package

Jump to

Keyboard shortcuts

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