discovery

command module
v0.0.0-...-b93537c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 39 Imported by: 0

README

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.22+
  • kubectl 1.21+
  • Operator-sdk v1.22.2
  • 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>
  1. Push the image:
make docker-push URL=<registry>/<imagename>:<tag>
  1. 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 commands:

make secret
make connfig

This will create a DiscoveryConfig like the example below:

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

Rebuild Image: Wed Jan 8 12:52:04 EST 2025

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1
Package v1 contains API Schema definitions for the discovery v1 API group +kubebuilder:object:generate=true +groupName=discovery.open-cluster-management.io
Package v1 contains API Schema definitions for the discovery v1 API group +kubebuilder:object:generate=true +groupName=discovery.open-cluster-management.io
v1alpha1
Package v1alpha1 contains API Schema definitions for the discovery v1alpha1 API group +kubebuilder:object:generate=true +groupName=discovery.open-cluster-management.io
Package v1alpha1 contains API Schema definitions for the discovery v1alpha1 API group +kubebuilder:object:generate=true +groupName=discovery.open-cluster-management.io
pkg
ocm
test
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL