Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ add work driver config to cluster manager. #323

Conversation

morvencao
Copy link
Member

Summary

This PR adds the capability to configure the work driver for the work controller via the cluster manager by adding work driver configuration.

Related issue(s)

Fixes #

file for the work driver in YAML format. It must not be empty
if the driver is not kube. For detailed configuration content,
refer to the specific work driver options package: MQTT: https://github.com/open-cluster-management-io/sdk-go/blob/00a94671ced1c17d2ca2b5fad2f4baab282a7d3c/pkg/cloudevents/generic/options/mqtt/options.go#L46-L76
GRPC: https://github.com/open-cluster-management-io/sdk-go/blob/00a94671ced1c17d2ca2b5fad2f4baab282a7d3c/pkg/cloudevents/generic/options/grpc/options.go#L30-L40'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to show a simple example for MQTT and GRPC here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added examples.

@morvencao morvencao force-pushed the br_add_work_driver branch 2 times, most recently from 056da50 to 681cd5d Compare March 19, 2024 01:12
// GRPC: https://github.com/open-cluster-management-io/sdk-go/blob/00a94671ced1c17d2ca2b5fad2f4baab282a7d3c/pkg/cloudevents/generic/options/grpc/options.go#L30-L40
// +optional
// +kubebuilder:default:=kube
WorkDriver string `json:"workDriver,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use +kubebuilder:validation:Enum:=kube,mqtt,grpc ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

// clientKeyFile: /certs/client.key
//
// For detailed driver config content, refer to the specific work driver options package:
// MQTT: https://github.com/open-cluster-management-io/sdk-go/blob/00a94671ced1c17d2ca2b5fad2f4baab282a7d3c/pkg/cloudevents/generic/options/mqtt/options.go#L46-L76
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may add some config example/document in the https://github.com/open-cluster-management-io/sdk-go/blob/main/pkg/cloudevents/README.md, and link them in here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

// sourceEvents: sources/maestro/consumers/+/sourceevents
// agentEvents: $share/statussubscribers/sources/maestro/consumers/+/agentevents
//
// An example of GRPC driver config (in YAML format) is as follows:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

driver.config |-
  broker: broker.example.com:1883
  dirver.config |-
     url: grpc.example.com:8443

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated it.


// WorkDriver represents the type of work driver. Possible values are "kube", "mqtt", or "grpc".
// If not provided, the default value is "kube".
// If the driver is not "kube", the driver config must be provided in a secret named "work-driver-config" with the following structure:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in what ns?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the same ns as cluster manager is running, because this secret needs to be created by user, and open-cluster-management-hub ns is not created before clustermanager CR is created.

// If the driver is not "kube", the driver config must be provided in a secret named "work-driver-config" with the following structure:
// config.yaml: |
// <driver-config-in-yaml>
//
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to mention that if we choose to use different driver, the klusterlet needs to use the same driver.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Signed-off-by: morvencao <lcao@redhat.com>
Signed-off-by: morvencao <lcao@redhat.com>
@qiujian16
Copy link
Member

one more thing, we should define driver name as const in api repo.

Signed-off-by: morvencao <lcao@redhat.com>
@morvencao
Copy link
Member Author

added work driver type const definition in API repo: 3ac661f

@qiujian16
Copy link
Member

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Mar 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: morvencao, qiujian16

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 19eb7b5 into open-cluster-management-io:main Mar 20, 2024
10 checks passed
@morvencao morvencao deleted the br_add_work_driver branch March 20, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants