discovery

package
v0.0.0-...-6783019 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	ID                       string  `yaml:"id"`
	Name                     string  `yaml:"name"`
	ControlPlaneEndpoint     *string `yaml:"endpoint"`
	CertificateAuthorityData *string `yaml:"ca"`
}

Cluster represents the information about a discovered k8s cluster

type DiscoverInput

type DiscoverInput struct {
	ConfigSet config.ConfigurationSet
	Identity  identity.Identity
}

DiscoverInput is the input to Discover

type DiscoverOutput

type DiscoverOutput struct {
	DiscoveryProvider string `yaml:"discoveryProvider"`
	IdentityProvider  string `yaml:"identityProvider"`

	Clusters map[string]*Cluster `yaml:"clusters"`
}

DiscoverOutput holds details of the output of the Discover

type GetClusterInput

type GetClusterInput struct {
	ClusterID string
	ConfigSet config.ConfigurationSet
	Identity  identity.Identity
}

GetClusterInput is the input to GetCluster

type GetClusterOutput

type GetClusterOutput struct {
	Cluster *Cluster
}

GetClusterOutput is the output to GetCluster

type GetConfigInput

type GetConfigInput struct {
	Cluster   *Cluster
	Namespace *string
	Identity  identity.Identity
}

type GetConfigOutput

type GetConfigOutput struct {
	KubeConfig  *api.Config
	ContextName *string
}

type Provider

type Provider interface {
	provider.Plugin
	provider.PluginPreReqs
	provcfg.Resolver

	// Discover will discover what clusters the supplied identity has access to
	Discover(ctx context.Context, input *DiscoverInput) (*DiscoverOutput, error)

	// Get will get the details of a cluster with the provided provider
	// specific cluster id
	GetCluster(ctx context.Context, input *GetClusterInput) (*GetClusterOutput, error)

	// GetClusterConfig will get the kubeconfig for a cluster
	GetConfig(ctx context.Context, input *GetConfigInput) (*GetConfigOutput, error)
}

Provider is the interface that is used to implement providers of Kubernetes clusters. Its the job of the provider to discover clusters based on a users identity and to generate a kubeconfig (and any other files) that are required to access a selected cluster.

type ProviderCreatorFun

type ProviderCreatorFun func(input *provider.PluginCreationInput) (Provider, error)

Jump to

Keyboard shortcuts

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