Documentation ¶
Index ¶
Constants ¶
const (
//DefaultClusterName is the cluster for the unspecified cluster
DefaultClusterName = "_default"
)
Variables ¶
This section is empty.
Functions ¶
func GetClusters ¶ added in v0.9.3
func GetClusters(client versioned.Interface, ns string, opts metav1.ListOptions) (*v1alpha1.ClusterList, error)
GetClusters get clusters resourcese. If this resource not exist on cluster, just ignore it.
Types ¶
type ClusterRefresher ¶ added in v0.9.3
type ClusterRefresher struct {
// contains filtered or unexported fields
}
func NewClusterRefresher ¶ added in v0.9.3
func NewClusterRefresher(ns string, cfg *rest.Config) *ClusterRefresher
NewClusterRefresher ... This runnable intent to inform captain to restart when it found a new cluster. This is not a ideal solution, but it works on most occasions. Add/Remove cluster should be a rear operation in prod environment.
type Info ¶
type Info struct { // Name is the cluster name, usually the Cluster resource's name Name string // Endpoint the apiserver's endpoint of the cluster Endpoint string // Token is a admin token , it should have all the access to the cluster Token string // Namespace the namespace which the chart will be installed to Namespace string }
Info represents a Cluster,
func RestConfigToCluster ¶
RestConfigToCluster generate a cluster Info from a rest config This method and the Info.ToRestConfig both only support bearer token for now luckily, the in-cluster rest config also use bearer token
func (*Info) GetContext ¶
GetContext is the context name for this cluster, this name format is generated from k8s code
func (*Info) ToRestConfig ¶
ToRestConfig generate rest.Config from cluster info.