Changes for README.md: 442 added lines, 56 removed lines.
Original line number
Diff line number
Diff line
# ocm-scheduler
# Hypo OCM Scheduler – Helm Chart
This Helm chart deploys the **Hypo OCM Scheduler** on an Open Cluster Management (OCM) Hub cluster and configures the managed clusters required for location-aware workload scheduling.
The chart provides an automated installation and cleanup process, including scheduler deployment, OCM ClusterSet configuration, managed cluster labeling, and location-based ClusterClaims.
## Getting started
## 1. Overview
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
The Hypo OCM Scheduler extends the OCM environment with scheduling functionality based on cluster-specific attributes.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
Each managed cluster is associated with a location through a custom `ClusterClaim` named `hypo.filter.location`. The scheduler can use this information to select an appropriate managed cluster for workload placement.
## Add your files
The Helm chart automates:
*[Create](https://docs.gitlab.com/user/project/repository/web_editor/#create-a-file) or [upload](https://docs.gitlab.com/user/project/repository/web_editor/#upload-a-file) files
*[Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command:
- Deployment of the Hypo Scheduler controller.
- Creation of the HypoSchedulingManifest Custom Resource Definition (CRD).
- Creation of an OCM `ManagedClusterSet` and its namespace binding.
- Assignment of managed clusters to the configured ClusterSet.
- Creation of location-based ClusterClaims on the managed clusters.
- Configuration of the required Kubernetes RBAC permissions.
- Cleanup of scheduler-related resources during uninstallation.
The scheduler runs on the **OCM Hub cluster**, while location ClusterClaims are created on the corresponding managed clusters.
## 2. Helm Chart Structure
ocm-scheduler-chart/
├── Chart.yaml
├── values.yaml
├── crds/
│ └── hypo-crd.yaml
└── templates/
├── scheduler.yaml
├── managed-clusters-job.yaml
└── cleanup-job.yaml
The chart consists of the following files:
Chart.yaml – Defines the Helm chart metadata and version.
values.yaml – Configures the scheduler image, replicas, ClusterSet, and managed clusters.
crds/hypo-crd.yaml – Defines the HypoSchedulingManifest Custom Resource Definition.
templates/scheduler.yaml – Deploys the scheduler controller, Kubernetes resources, and required RBAC.
templates/managed-clusters-job.yaml – Runs after installation or upgrade to assign managed clusters to the ClusterSet and configure their location ClusterClaims.
templates/cleanup-job.yaml – Runs before uninstallation to remove Hypo scheduling resources, ClusterClaims, ClusterSet membership labels, and the Hypo CRD.
The setup and cleanup Jobs are implemented as Helm hooks, allowing cluster configuration and cleanup to be performed automatically during the Helm release lifecycle.
## 3. Prerequisites
Before installing the chart, ensure that:
- A Kubernetes cluster is configured as an OCM Hub.
- The required OCM components are installed and running.
- The target managed clusters are registered and available in OCM.
- Helm 3 and `kubectl` are installed.
- The Hub can access the Hypo Scheduler container image.
- Kubeconfig files are available for the managed clusters.
- The installation namespace exists.
Create the namespace if necessary:
```bash
kubectl create namespace hypo-scheduler-system
```
Verify the registered managed clusters:
```bash
kubectl get managedclusters
```
Both managed clusters should report `JOINED=True` and `AVAILABLE=True`.
| `scheduler.imagePullSecrets` | Kubernetes Secrets used to authenticate to the image registry. |
### ClusterSet configuration
| Parameter | Description |
|---|---|
| `clusterSet.enabled` | Enables creation of the configured OCM ManagedClusterSet. |
| `clusterSet.name` | Name of the ManagedClusterSet to which the managed clusters will be assigned. |
### Managed cluster configuration
| Parameter | Description |
|---|---|
| `managedClusters[].name` | Name of the ManagedCluster registered on the OCM Hub. |
| `managedClusters[].location` | Location value assigned to the cluster through the `hypo.filter.location` ClusterClaim. |
| `managedClusters[].kubeconfigSecretName` | Name of the Kubernetes Secret containing the managed cluster kubeconfig. |
The `location` value is used by the scheduler when evaluating location-based scheduling requirements. It should match the location expected by the corresponding workload scheduling configuration.
## 5. Configure Access to Managed Clusters
The Helm setup and cleanup Jobs require access to the managed clusters to create and remove ClusterClaims.
If we deploy manually the Hlem chart and not from HypO, we need for each managed cluster, to create a Kubernetes Secret in the scheduler namespace containing its kubeconfig.
These checks verify the deployment and configuration. To validate scheduling functionality itself, submit a HypoSchedulingManifest and verify that the scheduler selects the expected managed cluster and creates the corresponding ManifestWork.
Use the built-in continuous integration in GitLab.
## 8. Update the Deployment
*[Get started with GitLab CI/CD](https://docs.gitlab.com/ci/quick_start/)
*[Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/user/application_security/sast/)
*[Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/topics/autodevops/requirements/)
*[Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/user/clusters/agent/)
*[Set up protected environments](https://docs.gitlab.com/ci/environments/protected_environments/)
After modifying `values.yaml` or the Helm templates, upgrade the existing installation:
***
```bash
helm upgrade hypo-scheduler .\
-n hypo-scheduler-system \
--wait\
--wait-for-jobs\
--timeout 10m
```
# Editing this README
The Helm post-upgrade Job reapplies the managed cluster configuration, including ClusterSet membership and location ClusterClaims.
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
Verify the updated configuration using the checks in Section 7.
## Suggestions for a good README
## 9. Uninstall the Scheduler
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
The chart includes a Helm `pre-delete` cleanup Job that removes scheduler-specific resources before Helm deletes the release.
## Name
Choose a self-explaining name for your project.
Uninstall:
```bash
helm uninstall hypo-scheduler \
-n hypo-scheduler-system \
--wait\
--timeout 10m
```
The cleanup Job performs the following operations:
1. Deletes HypoSchedulingManifest resources.
2. Deletes scheduler-owned ManifestWorks.
3. Removes the `hypo.filter.location` ClusterClaims from the configured managed clusters.
4. Removes the managed clusters' ClusterSet membership labels.
5. Deletes the HypoSchedulingManifest CRD.
Helm then removes the chart-managed resources, including the scheduler controller, associated RBAC resources, ClusterSet, and ClusterSetBinding.
**Note:** Helm does not automatically remove CRDs installed through the chart's `crds/` directory. The cleanup Job explicitly deletes the HypoSchedulingManifest CRD.
The registered OCM ManagedClusters themselves are not deleted.
## 10. Verify the Uninstallation
### Confirm Helm release removal
```bash
helm list -n hypo-scheduler-system --all
```
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
The `hypo-scheduler` release should no longer appear.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
### Confirm scheduler resources are removed
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
```bash
kubectl get all -n hypo-scheduler-system
```
No scheduler workloads should remain.
### Confirm ClusterSet removal
```bash
kubectl get managedclusterset test
kubectl get managedclustersetbinding test\
-n hypo-scheduler-system
```
Both resources should return `NotFound`.
### Confirm membership labels are removed
```bash
kubectl get managedclusters \
-L cluster.open-cluster-management.io/clusterset
```
Expected result:
```text
NAME JOINED AVAILABLE CLUSTERSET
managed-1 True True
managed-2 True True
```
The ManagedClusters remain registered and available, but no longer belong to the scheduler's ClusterSet.
### Confirm ClusterClaim removal
```bash
kubectl --kubeconfig=/home/ubuntu/managed1.yaml \
get clusterclaim hypo.filter.location
kubectl --kubeconfig=/home/ubuntu/managed2.yaml \
get clusterclaim hypo.filter.location
```
Both commands should return `NotFound`.
### Confirm CRD removal
```bash
kubectl get crd \
hyposchedulingmanifests.scheduling.hypo.eu
```
Expected result: `NotFound`.
### Confirm scheduler-owned ManifestWorks are removed
```bash
kubectl get manifestworks -A\
-l scheduling.hypo.eu/owner
```
No scheduler-owned ManifestWorks should remain.
### Confirm manually created Secrets are preserved
```bash
kubectl get secrets -n hypo-scheduler-system
```
The managed cluster kubeconfig Secrets and image registry Secret should remain available for future installations.
## 11. Troubleshooting
### Installation fails during managed cluster configuration
Inspect the setup Job:
```bash
kubectl get jobs-n hypo-scheduler-system
kubectl logs -n hypo-scheduler-system \
job/hypo-scheduler-configure-clusters
```
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
Common causes include:
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
- Missing kubeconfig Secrets.
- Incorrect Secret data keys.
- Invalid or inaccessible managed cluster kubeconfigs.
- Insufficient permissions to modify ManagedClusters.
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
The setup Job requires both ManagedCluster patch permissions and authorization to join the configured ClusterSet.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
## 12. Resource Lifecycle Summary
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
| Resource | Installation | Uninstallation |
|---|---|---|
| Hypo Scheduler controller | Created | Deleted |
| Scheduler RBAC | Created | Deleted |
| HypoSchedulingManifest CRD | Created | Deleted by cleanup Job |
| Manually created kubeconfig Secrets | Reused | Preserved |
| Manually created registry Secret | Reused | Preserved |
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
**Important:** The current cleanup behavior assumes the configured ClusterSet, location ClusterClaims, and Hypo CRD are dedicated to this scheduler installation. Avoid sharing these resources with unrelated workloads or Helm releases, since the cleanup Job explicitly removes them.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
---
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
Add the appropriate project license and copyright information here.