Documentation ¶
Index ¶
- func CreateAllowedContextMap(contexts []string) map[string]string
- func GetClusterCandidatesFromKubeconfig(kubeconfig []byte, projectID uint, local bool) ([]*models.ClusterCandidate, error)
- func GetRawConfigFromBytes(kubeconfig []byte) (*api.Config, error)
- type Agent
- func (a *Agent) GetDaemonSet(c grapher.Object) (*appsv1.DaemonSet, error)
- func (a *Agent) GetDeployment(c grapher.Object) (*appsv1.Deployment, error)
- func (a *Agent) GetPodLogs(namespace string, name string, conn *websocket.Conn) error
- func (a *Agent) GetPodsByLabel(selector string) (*v1.PodList, error)
- func (a *Agent) GetReplicaSet(c grapher.Object) (*appsv1.ReplicaSet, error)
- func (a *Agent) GetStatefulSet(c grapher.Object) (*appsv1.StatefulSet, error)
- func (a *Agent) ListNamespaces() (*v1.NamespaceList, error)
- func (a *Agent) StreamControllerStatus(conn *websocket.Conn, kind string) error
- type ListOptions
- type Message
- type OutOfClusterConfig
- func (conf *OutOfClusterConfig) GetClientConfigFromCluster() (clientcmd.ClientConfig, error)
- func (conf *OutOfClusterConfig) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
- func (conf *OutOfClusterConfig) ToRESTConfig() (*rest.Config, error)
- func (conf *OutOfClusterConfig) ToRESTMapper() (meta.RESTMapper, error)
- func (conf *OutOfClusterConfig) ToRawKubeConfigLoader() clientcmd.ClientConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAllowedContextMap ¶
CreateAllowedContextMap creates a dummy map from context name to context name
func GetClusterCandidatesFromKubeconfig ¶
func GetClusterCandidatesFromKubeconfig( kubeconfig []byte, projectID uint, local bool, ) ([]*models.ClusterCandidate, error)
GetClusterCandidatesFromKubeconfig parses a kubeconfig for a list of cluster candidates.
The local boolean represents whether the auth mechanism should be designated as "local": if so, the auth mechanism uses local plugins/mechanisms purely from the kubeconfig.
Types ¶
type Agent ¶
type Agent struct { RESTClientGetter genericclioptions.RESTClientGetter Clientset kubernetes.Interface }
Agent is a Kubernetes agent for performing operations that interact with the api server
func GetAgentInClusterConfig ¶
GetAgentInClusterConfig uses the service account that kubernetes gives to pods to connect
func GetAgentOutOfClusterConfig ¶
func GetAgentOutOfClusterConfig(conf *OutOfClusterConfig) (*Agent, error)
GetAgentOutOfClusterConfig creates a new Agent using the OutOfClusterConfig
func GetAgentTesting ¶
GetAgentTesting creates a new Agent using an optional existing storage class
func (*Agent) GetDaemonSet ¶
GetDaemonSet gets the daemonset by name and namespace
func (*Agent) GetDeployment ¶
GetDeployment gets the depployment given the name and namespace
func (*Agent) GetPodLogs ¶
GetPodLogs streams real-time logs from a given pod.
func (*Agent) GetPodsByLabel ¶
GetPodsByLabel retrieves pods with matching labels
func (*Agent) GetReplicaSet ¶
GetReplicaSet gets the replicaset given the name and namespace
func (*Agent) GetStatefulSet ¶
GetStatefulSet gets the statefulset given the name and namespace
func (*Agent) ListNamespaces ¶
func (a *Agent) ListNamespaces() (*v1.NamespaceList, error)
ListNamespaces simply lists namespaces
type ListOptions ¶
type ListOptions struct {
FieldSelector string
}
type OutOfClusterConfig ¶
type OutOfClusterConfig struct { Cluster *models.Cluster Repo *repository.Repository }
OutOfClusterConfig is the set of parameters required for an out-of-cluster connection. This implements RESTClientGetter
func (*OutOfClusterConfig) GetClientConfigFromCluster ¶
func (conf *OutOfClusterConfig) GetClientConfigFromCluster() (clientcmd.ClientConfig, error)
GetClientConfigFromCluster will construct new clientcmd.ClientConfig using the configuration saved within a Cluster model
func (*OutOfClusterConfig) ToDiscoveryClient ¶
func (conf *OutOfClusterConfig) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
ToDiscoveryClient returns a CachedDiscoveryInterface using a computed RESTConfig It's required to implement the interface genericclioptions.RESTClientGetter
func (*OutOfClusterConfig) ToRESTConfig ¶
func (conf *OutOfClusterConfig) ToRESTConfig() (*rest.Config, error)
ToRESTConfig creates a kubernetes REST client factory -- it calls ClientConfig on the result of ToRawKubeConfigLoader, and also adds a custom http transport layer if necessary (required for GCP auth)
func (*OutOfClusterConfig) ToRESTMapper ¶
func (conf *OutOfClusterConfig) ToRESTMapper() (meta.RESTMapper, error)
ToRESTMapper returns a mapper
func (*OutOfClusterConfig) ToRawKubeConfigLoader ¶
func (conf *OutOfClusterConfig) ToRawKubeConfigLoader() clientcmd.ClientConfig
ToRawKubeConfigLoader creates a clientcmd.ClientConfig from the raw kubeconfig found in the OutOfClusterConfig. It does not implement loading rules or overrides.