Skip to content

daxelrod-rh/ocm-operator

 
 

Repository files navigation

ocm-operator

Manage OpenShift Cluster Manager objects in a Kubernetes-native fashion using an operator.

Description

This operator allows you to manage OCM objects from a Kubernetes cluster using native Kubernetes CRDs. This allows you to plugin to more modern workflows such as GitOps.

  • Machine Pools: current limitation is that the cluster with the operator may only manage machine pools for itself. See rh-mobb#1.

Getting Started

You will need a cluster that supports managing Machine Pools from OCM (e.g. ROSA). Please see https://mobb.ninja/docs/quickstart-rosa/ for a quick start guide.

Running Outside of the Cluster (Development/Testing)

Prerequisite tooling:

  1. Retrieve your access token and place the token at /tmp/ocm.json

  2. To install the custom resources for this operator, make sure you have logged into your test cluster and run the following:

make install
  1. To run the controller locally against a test cluster:
make run
  1. You can then test the operator creation workflow by creating a sample manifest (this may take a few minutes until you see the completed *** reconciliation message):
  • Machine Pool: oc apply -f config/samples/machinepool/sample_simple.yaml

NOTE: other samples available for different use cases at config/samples/<object>/sample_*.yaml

  1. You can then test the operator deletion workflow by deleting a sample manifest (this may take a few minutes until the finalizer is deleted and the object is cleaned up):
  • Machine Pool: oc delete -f config/samples/machinepool/sample_simple.yaml

NOTE: other samples available for different use cases at config/samples/<object>/sample_*.yaml

  1. To clean up CRDs from the cluster:
make uninstall

Running on the Cluster

TODO: will be installed via OperatorHub

How it works

This project aims to follow the Kubernetes Operator pattern.

It uses Controllers, which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.

License

Copyright 2023.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 90.6%
  • Makefile 7.7%
  • Dockerfile 1.4%
  • Shell 0.3%