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

Allow set work agent clusterrole in klusterlet #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,13 @@ spec:
description: WorkConfiguration contains the configuration of work
type: object
properties:
clusterRoles:
description: ClusterRoles is the clusterroles that work agent binds to. If it is empty, the default admin clusterrole in kubernetes is bound to the work agent.
type: array
items:
type: string
featureGates:
description: "FeatureGates represents the list of feature gates for work If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates: 1. If featuregate/Foo does not exist, registration-operator will discard it 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true] 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false, \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false."
description: "FeatureGates represents the list of feature gates for work agent If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates: 1. If featuregate/Foo does not exist, registration-operator will discard it 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true] 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false, \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false."
type: array
items:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,13 @@ spec:
description: WorkConfiguration contains the configuration of work
type: object
properties:
clusterRoles:
description: ClusterRoles is the clusterroles that work agent binds to. If it is empty, the default admin clusterrole in kubernetes is bound to the work agent.
type: array
items:
type: string
featureGates:
description: "FeatureGates represents the list of feature gates for work If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates: 1. If featuregate/Foo does not exist, registration-operator will discard it 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true] 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false, \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false."
description: "FeatureGates represents the list of feature gates for work agent If it is set empty, default feature gates will be used. If it is set, featuregate/Foo is an example of one item in FeatureGates: 1. If featuregate/Foo does not exist, registration-operator will discard it 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true] 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false, \the can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false."
type: array
items:
type: object
Expand Down
19 changes: 18 additions & 1 deletion operator/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,31 @@ type KlusterletSpec struct {

// WorkConfiguration contains the configuration of work
// +optional
WorkConfiguration *WorkConfiguration `json:"workConfiguration,omitempty"`
WorkConfiguration *KlusterletWorkConfiguration `json:"workConfiguration,omitempty"`

// HubApiServerHostAlias contains the host alias for hub api server.
// registration-agent and work-agent will use it to communicate with hub api server.
// +optional
HubApiServerHostAlias *HubApiServerHostAlias `json:"hubApiServerHostAlias,omitempty"`
}

// KlusterletWorkConfiguration contains the configuration of work agent
type KlusterletWorkConfiguration struct {
// ClusterRoles is the clusterroles that work agent binds to. If it is empty, the default admin clusterrole
// in kubernetes is bound to the work agent.
ClusterRoles []string `json:"clusterRoles,omitempty"`

// FeatureGates represents the list of feature gates for work agent
// If it is set empty, default feature gates will be used.
// If it is set, featuregate/Foo is an example of one item in FeatureGates:
// 1. If featuregate/Foo does not exist, registration-operator will discard it
// 2. If featuregate/Foo exists and is false by default. It is now possible to set featuregate/Foo=[false|true]
// 3. If featuregate/Foo exists and is true by default. If a cluster-admin upgrading from 1 to 2 wants to continue having featuregate/Foo=false,
// he can set featuregate/Foo=false before upgrading. Let's say the cluster-admin wants featuregate/Foo=false.
// +optional
FeatureGates []FeatureGate `json:"featureGates,omitempty"`
}

// ServerURL represents the apiserver url and ca bundle that is accessible externally
type ServerURL struct {
// URL is the url of apiserver endpoint of the managed cluster.
Expand Down
28 changes: 27 additions & 1 deletion operator/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.