-
Notifications
You must be signed in to change notification settings - Fork 74
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
✨ add work driver config to cluster manager. #323
Conversation
f41da78
to
e9bf35b
Compare
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' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added examples.
056da50
to
681cd5d
Compare
operator/v1/types_clustermanager.go
Outdated
// 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"` |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
operator/v1/types_clustermanager.go
Outdated
// 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
operator/v1/types_clustermanager.go
Outdated
// sourceEvents: sources/maestro/consumers/+/sourceevents | ||
// agentEvents: $share/statussubscribers/sources/maestro/consumers/+/agentevents | ||
// | ||
// An example of GRPC driver config (in YAML format) is as follows: |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated it.
681cd5d
to
b61b5ee
Compare
operator/v1/types_clustermanager.go
Outdated
|
||
// 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in what ns?
There was a problem hiding this comment.
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> | ||
// |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
b61b5ee
to
c242d35
Compare
Signed-off-by: morvencao <lcao@redhat.com>
c242d35
to
2f5e203
Compare
Signed-off-by: morvencao <lcao@redhat.com>
one more thing, we should define driver name as const in api repo. |
Signed-off-by: morvencao <lcao@redhat.com>
4478554
to
3ac661f
Compare
added work driver type const definition in API repo: 3ac661f |
/approve |
[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 |
19eb7b5
into
open-cluster-management-io:main
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 #