Skip to content

devfile/registry-operator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Devfile Registry Operator

Apache2.0 License OpenSSF Best Practices OpenSSF Scorecard

The Devfile Registry operator manages the lifecycle of the following custom resources:

  1. Devfile Registry
  2. Devfile Registries List
  3. Cluster Devfile Registries List

Releases

Minor releases will be scheduled roughly on a quarterly basis and will include non-feature breaking changes made between release cycles.

Patch releases are provided as needed for critical bug fixes and security patches, it is strongly recommended for users running on the same minor version of the registry operator to update when these releases become available.

Releases are available on GitHub along with bundle entries on OperatorHub.io and the OpenShift OperatorHub community catalog.

For more updates on releases, please join our communication channels.

Issue Tracking

Issue tracking repo: https://github.com/devfile/api with label area/registry

Changelog

This repository utilizes Release Notes to track and display changes, a changelog for every release can be found here.

Requirements

Deployment cluster must meet one of the following criteria:

  • OpenShift Container Platform (OCP) 4.15.x
  • Kubernetes 1.29.x

Note: Though full support for OpenShift Container Platform (OCP) 4.16.x is not currently in place, it includes Kubernetes 1.29.x APIs therefore should work in theory.

More on the support of container orchestration systems can be found here.

Deployments made by the devfile registry operator must never target the default namespace due to incompatibility with security setups.

Development

  • Go 1.21.x
  • Docker / Podman
  • Operator SDK 1.28.x

See Upgrade SDK Version for a guide on updating the Operator SDK. Ensure the Operator SDK version and the version of Kubernetes APIs match each other when updating by checking CLUSTER_SUPPORT.md.

Running the controller in a cluster

Install cert-manager to provision self-signed certificates for the validating webhooks which are used specifically for the ClusterDevfileRegistriesList and DevfileRegistriesList CRs. Cert manager needs to be installed in order for the controller manager to start.

make install-cert

The controller can be deployed to a cluster provided you are logged in with cluster-admin credentials:

make install && make deploy

The operator will be installed under the registry-operator-system namespace. However, devfile registries can be deployed in any namespace.

Deploying registry to a cluster

After the operator has been installed to a cluster you can deploy a devfile registry by following these instructions.

Development

The repository contains a Makefile; building and deploying can be configured via the environment variables

variable purpose default value
IMG Image used for controller (run makefile, if IMG is updated) quay.io/devfile/registry-operator:next
BUNDLE_IMG Image used for bundle OLM package quay.io/devfile/registry-operator-bundle:<latest_version>
CERT_MANAGER_VERSION Version of cert-manager installed using make install-cert v1.15.1
ENABLE_WEBHOOKS If false, disables operator webhooks true
ENABLE_WEBHOOK_HTTP2 Overrides webhook HTTP server deployment to use http/2 if set to true, not recommended false
BUNDLE_CHANNELS Sets the list channel(s) include bundle build under alpha
BUNDLE_DEFAULT_CHANNEL Sets the default channel to use when installing the bundle
ENVTEST_K8S_VERSION Version of k8s to use for the test environment 1.26 (current)
CONTROLLER_TOOLS_VERSION Version of the controller tools v0.14.0
KUSTOMIZE_VERSION Version of kustomize v3.8.7
GOBIN Path to install Go binaries to ${GOPATH}/bin
K8S_CLI Path to CLI tool to use with the target cluster environment, kubectl or oc Either oc or kubectl if installed in that order
OPERATOR_SDK_CLI CLI path to operator-sdk tool operator-sdk
SHELL Active shell to use with make /usr/bin/env bash -o pipefail
LOCALBIN Path to place project binaries ./bin
KUSTOMIZE Path to target kustomize binary ${LOCALBIN}/kustomize
CONTROLLER_GEN Path to target controller-gen binary ${LOCALBIN}/controller-gen
ENVTEST Path to target setup-envtest binary ${LOCALBIN}/setup-envtest
TARGET_ARCH Target architecture for operator manager builds, possible values: amd64, arm64, s390x, ppc64le amd64
TARGET_OS Target operating system for operator manager build, only for make manager linux
PLATFORMS Target architecture(s) for make docker-buildx All supported: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
KUSTOMIZE_INSTALL_SCRIPT URL of kustomize installation script, see kustomize installation instructions https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh

Some of the rules supported by the makefile:

rule purpose
controller-gen install the controller-gen tool, used by other commands
kustomize install the kustomize tool, used by other commands
docker-build build registry operator container image using docker
docker-push push registry operator container image using docker
docker-buildx-build build registry operator docker image for all supported architectures using docker
docker-buildx-push build & push registry operator docker image for all supported architectures using docker
docker-bundle-buildx-build build registry operator bundle docker image for all supported architectures using docker
docker-bundle-buildx-push build & push registry operator bundle docker image for all supported architectures using docker
podman-buildx-build build registry operator docker image for all supported architectures using podman
podman-buildx-push push registry operator docker image for all supported architectures using podman
podman-build build registry operator container image using podman
podman-push push registry operator container image using podman
deploy deploy operator to cluster
undeploy undeploy operator from cluster
install create the devfile registry CRDs on the cluster
uninstall remove the devfile registry operator and CRDs from the cluster
install-cert for validating webhooks, install cert manager on the cluster
uninstall-cert for validating webhooks, remove cert manager from the cluster
manifests Generate manifests e.g. CRD, RBAC etc.
generate Generate the API type definitions. Must be run after modifying the DevfileRegistry type.
bundle Generate bundle manifests and metadata, then validate generated files.
test-integration Run the integration tests for the operator.
test Run the unit tests for the operator.
fmt Check code formatting
fmt_license Ensure license header is set on all files
vet Check suspicious constructs into code
gosec Check for security problems in non-test source files

To see all rules supported by the makefile, run make help

Security

Further information for the devfile organization security policy can be found here.

Testing

Detailed instructions on how to run tests for the Devfile Registry Operator are found in CONTRIBUTING.md.

Run operator locally

It's possible to run an instance of the operator locally while communicating with a cluster.

  1. You may need to install the controller-gen tool before, used when building the binary:
make controller-gen
  1. Build the binary
make manager
  1. Deploy the CRDs
make install
  1. Run the controller
make run ENABLE_WEBHOOKS=false

Contributing

Please see our CONTRIBUTING.md.

Known Issues