v1

package
v0.0.0-...-a6845f2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 22

Documentation

Overview

+kubebuilder:validation:Optional +groupName=cluster.open-cluster-management.io

Index

Constants

View Source
const (
	// ManagedClusterConditionJoined means the managed cluster has successfully joined the hub.
	ManagedClusterConditionJoined string = "ManagedClusterJoined"
	// ManagedClusterConditionHubAccepted means the request to join the cluster is
	// approved by cluster-admin on hub.
	ManagedClusterConditionHubAccepted string = "HubAcceptedManagedCluster"
	// ManagedClusterConditionHubDenied means the request to join the cluster is denied by
	// cluster-admin on hub.
	ManagedClusterConditionHubDenied string = "HubDeniedManagedCluster"
	// ManagedClusterConditionAvailable means the managed cluster is available. If a managed
	// cluster is available, the kube-apiserver is healthy and the Klusterlet agent is
	// running with the minimum deployment on this managed cluster
	ManagedClusterConditionAvailable string = "ManagedClusterConditionAvailable"
)

Variables

View Source
var (
	GroupName    = "cluster.open-cluster-management.io"
	GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}

	// Install is a function which adds this version to a scheme
	Install = schemeBuilder.AddToScheme

	// SchemeGroupVersion generated code relies on this name
	// Deprecated
	SchemeGroupVersion = GroupVersion
	// AddToScheme exists solely to keep the old generators creating valid code
	// DEPRECATED
	AddToScheme = schemeBuilder.AddToScheme
)

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource generated code relies on this being here, but it logically belongs to the group DEPRECATED

Types

type ClientConfig

type ClientConfig struct {
	// URL is the URL of apiserver endpoint of the managed cluster.
	// +required
	URL string `json:"url"`

	// CABundle is the ca bundle to connect to apiserver of the managed cluster.
	// System certs are used if it is not set.
	// +optional
	CABundle []byte `json:"caBundle,omitempty"`
}

ClientConfig represents the apiserver address of the managed cluster. TODO include credential to connect to managed cluster kube-apiserver

func (*ClientConfig) DeepCopy

func (in *ClientConfig) DeepCopy() *ClientConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientConfig.

func (*ClientConfig) DeepCopyInto

func (in *ClientConfig) DeepCopyInto(out *ClientConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ClientConfig) SwaggerDoc

func (ClientConfig) SwaggerDoc() map[string]string

type ManagedCluster

type ManagedCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec represents a desired configuration for the agent on the managed cluster.
	Spec ManagedClusterSpec `json:"spec"`

	// Status represents the current status of joined managed cluster
	// +optional
	Status ManagedClusterStatus `json:"status,omitempty"`
}

ManagedCluster represents the desired state and current status of managed cluster. ManagedCluster is a cluster scoped resource. The name is the cluster UID.

The cluster join process follows a double opt-in process:

1. Agent on managed cluster creates CSR on hub with cluster UID and agent name. 2. Agent on managed cluster creates ManagedCluster on hub. 3. Cluster admin on hub approves the CSR for UID and agent name of the ManagedCluster. 4. Cluster admin sets spec.acceptClient of ManagedCluster to true. 5. Cluster admin on managed cluster creates credential of kubeconfig to hub.

Once the hub creates the cluster namespace, the Klusterlet agent on the ManagedCluster pushes the credential to the hub to use against the kube-apiserver of the ManagedCluster.

func (*ManagedCluster) DeepCopy

func (in *ManagedCluster) DeepCopy() *ManagedCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedCluster.

func (*ManagedCluster) DeepCopyInto

func (in *ManagedCluster) DeepCopyInto(out *ManagedCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ManagedCluster) DeepCopyObject

func (in *ManagedCluster) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (ManagedCluster) SwaggerDoc

func (ManagedCluster) SwaggerDoc() map[string]string

type ManagedClusterClaim

type ManagedClusterClaim struct {
	// Name is the name of a ClusterClaim resource on managed cluster. It's a well known
	// or customized name to identify the claim.
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name,omitempty"`

	// Value is a claim-dependent string
	// +kubebuilder:validation:MaxLength=1024
	// +kubebuilder:validation:MinLength=1
	Value string `json:"value,omitempty"`
}

ManagedClusterClaim represents a ClusterClaim collected from a managed cluster.

func (*ManagedClusterClaim) DeepCopy

func (in *ManagedClusterClaim) DeepCopy() *ManagedClusterClaim

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterClaim.

func (*ManagedClusterClaim) DeepCopyInto

func (in *ManagedClusterClaim) DeepCopyInto(out *ManagedClusterClaim)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ManagedClusterClaim) SwaggerDoc

func (ManagedClusterClaim) SwaggerDoc() map[string]string

type ManagedClusterList

type ManagedClusterList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of managed clusters.
	Items []ManagedCluster `json:"items"`
}

ManagedClusterList is a collection of managed cluster.

func (*ManagedClusterList) DeepCopy

func (in *ManagedClusterList) DeepCopy() *ManagedClusterList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterList.

func (*ManagedClusterList) DeepCopyInto

func (in *ManagedClusterList) DeepCopyInto(out *ManagedClusterList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ManagedClusterList) DeepCopyObject

func (in *ManagedClusterList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (ManagedClusterList) SwaggerDoc

func (ManagedClusterList) SwaggerDoc() map[string]string

type ManagedClusterSpec

type ManagedClusterSpec struct {
	// ManagedClusterClientConfigs represents a list of the apiserver address of the managed cluster.
	// If it is empty, the managed cluster has no accessible address for the hub to connect with it.
	// +optional
	ManagedClusterClientConfigs []ClientConfig `json:"managedClusterClientConfigs,omitempty"`

	// hubAcceptsClient represents that hub accepts the joining of Klusterlet agent on
	// the managed cluster with the hub. The default value is false, and can only be set
	// true when the user on hub has an RBAC rule to UPDATE on the virtual subresource
	// of managedclusters/accept.
	// When the value is set true, a namespace whose name is the same as the name of ManagedCluster
	// is created on the hub. This namespace represents the managed cluster, also role/rolebinding is created on
	// the namespace to grant the permision of access from the agent on the managed cluster.
	// When the value is set to false, the namespace representing the managed cluster is
	// deleted.
	// +required
	HubAcceptsClient bool `json:"hubAcceptsClient"`

	// LeaseDurationSeconds is used to coordinate the lease update time of Klusterlet agents on the managed cluster.
	// If its value is zero, the Klusterlet agent will update its lease every 60 seconds by default
	// +optional
	LeaseDurationSeconds int32 `json:"leaseDurationSeconds,omitempty"`
}

ManagedClusterSpec provides the information to securely connect to a remote server and verify its identity.

func (*ManagedClusterSpec) DeepCopy

func (in *ManagedClusterSpec) DeepCopy() *ManagedClusterSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSpec.

func (*ManagedClusterSpec) DeepCopyInto

func (in *ManagedClusterSpec) DeepCopyInto(out *ManagedClusterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ManagedClusterSpec) SwaggerDoc

func (ManagedClusterSpec) SwaggerDoc() map[string]string

type ManagedClusterStatus

type ManagedClusterStatus struct {
	// Conditions contains the different condition statuses for this managed cluster.
	Conditions []metav1.Condition `json:"conditions"`

	// Capacity represents the total resource capacity from all nodeStatuses
	// on the managed cluster.
	Capacity ResourceList `json:"capacity,omitempty"`

	// Allocatable represents the total allocatable resources on the managed cluster.
	Allocatable ResourceList `json:"allocatable,omitempty"`

	// Version represents the kubernetes version of the managed cluster.
	Version ManagedClusterVersion `json:"version,omitempty"`

	// ClusterClaims represents cluster information that a managed cluster claims,
	// for example a unique cluster identifier (id.k8s.io) and kubernetes version
	// (kubeversion.open-cluster-management.io). They are written from the managed
	// cluster. The set of claims is not uniform across a fleet, some claims can be
	// vendor or version specific and may not be included from all managed clusters.
	// +optional
	ClusterClaims []ManagedClusterClaim `json:"clusterClaims,omitempty"`
}

ManagedClusterStatus represents the current status of joined managed cluster.

func (*ManagedClusterStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterStatus.

func (*ManagedClusterStatus) DeepCopyInto

func (in *ManagedClusterStatus) DeepCopyInto(out *ManagedClusterStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ManagedClusterStatus) SwaggerDoc

func (ManagedClusterStatus) SwaggerDoc() map[string]string

type ManagedClusterVersion

type ManagedClusterVersion struct {
	// Kubernetes is the kubernetes version of managed cluster.
	// +optional
	Kubernetes string `json:"kubernetes,omitempty"`
}

ManagedClusterVersion represents version information about the managed cluster. TODO add managed agent versions

func (*ManagedClusterVersion) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterVersion.

func (*ManagedClusterVersion) DeepCopyInto

func (in *ManagedClusterVersion) DeepCopyInto(out *ManagedClusterVersion)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ManagedClusterVersion) SwaggerDoc

func (ManagedClusterVersion) SwaggerDoc() map[string]string

type ResourceList

type ResourceList map[ResourceName]resource.Quantity

ResourceList defines a map for the quantity of different resources, the definition matches the ResourceList defined in k8s.io/api/core/v1.

func (ResourceList) DeepCopy

func (in ResourceList) DeepCopy() ResourceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceList.

func (ResourceList) DeepCopyInto

func (in ResourceList) DeepCopyInto(out *ResourceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceName

type ResourceName string

ResourceName is the name identifying various resources in a ResourceList.

const (
	// ResourceCPU defines the number of CPUs in cores. (500m = .5 cores)
	ResourceCPU ResourceName = "cpu"
	// ResourceMemory defines the amount of memory in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
	ResourceMemory ResourceName = "memory"
)

Jump to

Keyboard shortcuts

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