Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/open-cluster-management-io/placement

Controller to make placement decisions based on Placement APIs
https://github.com/open-cluster-management-io/placement

Last synced: 2 days ago
JSON representation

Controller to make placement decisions based on Placement APIs

Awesome Lists containing this project

README

        

# Note: Do not edit any file in this repo.

The component is moved to the [ocm](https://github.com/open-cluster-management-io/ocm) as this [task of consolidating code](https://github.com/open-cluster-management-io/ocm/issues/128) is going, please follow the [CONTRIBUTING Guidence in the ocm](https://github.com/open-cluster-management-io/ocm/blob/main/CONTRIBUTING.md) to contribute.

# Placement

With `Placement`, you can select a set of `ManagedClusters` from the `ManagedClusterSets` bound to the placement namespace.

## Community, discussion, contribution, and support

Check the [CONTRIBUTING Doc](CONTRIBUTING.md) for how to contribute to the repo.

------

## Getting Started

### Prerequisites

You have at least one running kubernetes cluster;

### Clone this repo

```sh
git clone https://github.com/open-cluster-management-io/placement.git
cd placement
```

### Deploy the placement controller

Set environment variables.

```sh
export KUBECONFIG=
```

Build the docker image to run the placement controller.

```sh
go install github.com/openshift/imagebuilder/cmd/[email protected]
make images
export IMAGE_NAME= # export IMAGE_NAME=quay.io/open-cluster-management/placement:latest
```

If your are using kind, load image into the kind cluster.

```sh
kind load docker-image # kind load docker-image quay.io/open-cluster-management/placement:latest
```

And then deploy placement manager on the cluster.

```sh
make deploy-hub
```

### What is next

After a successful deployment, check on the cluster and see the placement controller has been deployed.

```sh
kubectl -n open-cluster-management-hub get pods
NAME READY STATUS RESTARTS AGE
cluster-manager-placement-controller-cf9bbd6c-x9dnd 1/1 Running 0 2m16s
```

Here is an example.

Create a `ManagedClusterSet`.

```sh
cat <
```

### Clean up

Undeploy placement controller from the cluster.

```sh
make undeploy-hub
```

### Run e2e test cases as sanity check on an existing environment

In order to verify the `Placement` API on an existing environment with placement controller installed and well configured, you are able to run the e2e test cases as sanity check by following the steps below.

Build the binary of the e2e test cases
```
make build-e2e
```

And then run the e2e test cases against an existing environment.
```
./e2e.test --ginkgo.v --ginkgo.label-filter=sanity-check -hub-kubeconfig=/path/to/file
```

In an environment that has already had the `global` clusterset created, you can skip the creation of the `global` clusterset during testing.
```
./e2e.test --ginkgo.v --ginkgo.label-filter=sanity-check -hub-kubeconfig=/path/to/file -create-global-clusterset=false
```

Since the e2e test cases create fake ManagedClusters (without agent installed) during testing, in a full featured OCM environment (with registration controller running on the hub), a taint `cluster.open-cluster-management.io/unreachable` will be added to those fake ManagedClusters automatically. You have to tolerate this taint when running e2e test cases in such an environment.
```
./e2e.test --ginkgo.v --ginkgo.label-filter=sanity-check -hub-kubeconfig=/path/to/file -tolerate-unreachable-taint
```