Skip to content

Commit

Permalink
Add init cluster annotations and labels setting in klusterlet.
Browse files Browse the repository at this point in the history
Signed-off-by: xuezhaojun <[email protected]>
  • Loading branch information
xuezhaojun committed Jul 13, 2023
1 parent 6d7212c commit 40e0f49
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ spec:
imagePullSpec:
description: ImagePullSpec represents the desired image configuration of agent, it takes effect only when singleton mode is set. quay.io/open-cluster-management.io/registration-operator:latest will be used if unspecified
type: string
initClusterAnnotations:
description: InitClusterAnnotations is a set of annotations that are applied to the managed cluster created during the registration process.
type: object
additionalProperties:
type: string
initClusterLabels:
description: InitClusterLabels is a set of labels that are applied to the managed cluster created during the registration process.
type: object
additionalProperties:
type: string
namespace:
description: Namespace is the namespace to deploy the agent on the managed cluster. The namespace must have a prefix of "open-cluster-management-", and if it is not set, the namespace of "open-cluster-management-agent" is used to deploy agent. In addition, the add-ons are deployed to the namespace of "{Namespace}-addon". In the Hosted mode, this namespace still exists on the managed cluster to contain necessary resources, like service accounts, roles and rolebindings, while the agent is deployed to the namespace with the same name as klusterlet on the management cluster.
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ spec:
of agent, it takes effect only when singleton mode is set. quay.io/open-cluster-management.io/registration-operator:latest
will be used if unspecified
type: string
initClusterAnnotations:
additionalProperties:
type: string
description: InitClusterAnnotations is a set of annotations that are
applied to the managed cluster created during the registration process.
type: object
initClusterLabels:
additionalProperties:
type: string
description: InitClusterLabels is a set of labels that are applied
to the managed cluster created during the registration process.
type: object
namespace:
description: Namespace is the namespace to deploy the agent on the
managed cluster. The namespace must have a prefix of "open-cluster-management-",
Expand Down
8 changes: 8 additions & 0 deletions operator/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,14 @@ type KlusterletSpec struct {
// +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
ClusterName string `json:"clusterName,omitempty"`

// InitClusterLabels is a set of labels that are applied to the managed cluster created during the registration process.
// +optional
InitClusterLabels map[string]string `json:"initClusterLabels,omitempty"`

// InitClusterAnnotations is a set of annotations that are applied to the managed cluster created during the registration process.
// +optional
InitClusterAnnotations map[string]string `json:"initClusterAnnotations,omitempty"`

// ExternalServerURLs represents the a list of apiserver urls and ca bundles that is accessible externally
// If it is set empty, managed cluster has no externally accessible url that hub cluster can visit.
// +optional
Expand Down
14 changes: 14 additions & 0 deletions operator/v1/zz_generated.deepcopy.go

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

2 changes: 2 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.

0 comments on commit 40e0f49

Please sign in to comment.