Skip to content

cameronmwall/discovery

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WORK IN PROGRESS

We are in the process of enabling this repo for community contribution. See wiki here.

Discovery

Operator for managing discovered clusters from OpenShift Cluster Manager

Prerequisites

  • Go v1.16+
  • kubectl 1.19+
  • Operator-sdk v1.3.0
  • Docker
  • Connection to an existing Kubernetes cluster

Installation

Before deploying, the Discovery CRDs need to be installed onto the cluster.

make install

Outside the Cluster

The operator can be run locally against the configured Kubernetes cluster in ~/.kube/config with the following command:

make run

Inside the Cluster

The operator can also run inside the cluster as a Deployment. To do that first build the container image and push to an accessible image registry:

  1. Build the image:
    make docker-build URL=<registry>/<imagename>:<tag>
  2. Push the image:
    make docker-push URL=<registry>/<imagename>:<tag>
  3. Deploy the Operator:
    make deploy URL=<registry>/<imagename>:<tag>

Usage

The discovery operator generates DiscoveredClusters based on a DiscoveryConfig resource. The config takes in a secret containing your OCM api token. To create this secret run the following:

make secret OCM_API_TOKEN=<OpenShift Cluster Manager API Token>

The OpenShift Cluster Manager API Token can be retrieved from here. This will create a secret named ocm-api-token in the current namespace. With the secret created you can then create the DiscoveryConfig resource using the following command:

make samples

This will create a DiscoveryConfig like the example below:

apiVersion: discovery.open-cluster-management.io/v1
kind: DiscoveryConfig
metadata:
  name: discoveryconfig
spec:
  providerConnections:
    - ocm-api-token
  filters:
    lastActive: 7

About

Controller to managed discovered clusters

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 86.3%
  • Makefile 8.2%
  • Shell 3.7%
  • Dockerfile 1.8%