kubernetes

package
v2.24.12 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// NamespacePrefix is the prefix for the cluster namespace.
	NamespacePrefix = "cluster-"
)

Variables

This section is empty.

Functions

func ClusterFromNamespace added in v2.21.0

func ClusterFromNamespace(ctx context.Context, client ctrlruntimeclient.Client, namespace string) (*kubermaticv1.Cluster, error)

ClusterFromNamespace filters all Cluster objects and returns the one where status.namespaceName matches the given namespace. If no such cluster exists, nil is returned (no error).

func CreateOrUpdateCredentialSecretForCluster

func CreateOrUpdateCredentialSecretForCluster(ctx context.Context, seedClient ctrlruntimeclient.Client, cluster *kubermaticv1.Cluster) error

CreateOrUpdateCredentialSecretForCluster creates a new secret for a credential.

func CreateOrUpdateSecretForCluster added in v2.22.0

func CreateOrUpdateSecretForCluster(ctx context.Context, client ctrlruntimeclient.Client, externalcluster *kubermaticv1.ExternalCluster, secretData map[string][]byte, secretName, secretNamespace string) (*providerconfig.GlobalSecretKeySelector, error)

func DynamicKubermaticConfigurationGetterFactory added in v2.22.0

func DynamicKubermaticConfigurationGetterFactory(client ctrlruntimeclient.Reader, namespace string) (provider.KubermaticConfigurationGetter, error)

DynamicKubermaticConfigurationGetterFactory returns a dynamic KubermaticConfigurationGetter, which will list all Configurations in the given namespace and return the found config or an error if 0 or more Configurations where found.

func GetRawKubermaticConfiguration added in v2.22.0

func GetRawKubermaticConfiguration(ctx context.Context, client ctrlruntimeclient.Reader, namespace string) (*kubermaticv1.KubermaticConfiguration, error)

GetRawKubermaticConfiguration will list all Configurations in the given namespace and return the found config or an error if 0 or more Configurations where found. Most code should use a KubermaticConfigurationGetter instead of calling this function directly. This function does not apply the default values.

func GetSeedKubeconfig added in v2.22.0

func GetSeedKubeconfig(ctx context.Context, client ctrlruntimeclient.Client, seed *kubermaticv1.Seed) ([]byte, error)

func GetSeedKubeconfigSecret added in v2.22.0

func GetSeedKubeconfigSecret(ctx context.Context, client ctrlruntimeclient.Client, seed *kubermaticv1.Seed) (*corev1.Secret, error)

func NamespaceName

func NamespaceName(clusterName string) string

NamespaceName returns the namespace name for a cluster.

func SeedClientGetterFactory added in v2.22.0

func SeedClientGetterFactory(kubeconfigGetter provider.SeedKubeconfigGetter) provider.SeedClientGetter

SeedClientGetterFactory returns a SeedClientGetter. It uses a RestMapperCache to cache the discovery data, which considerably speeds up client creation.

func SeedGetterFactory added in v2.22.0

func SeedGetterFactory(ctx context.Context, client ctrlruntimeclient.Reader, seedName string, namespace string) (provider.SeedGetter, error)

SeedGetterFactory returns a SeedGetter. It has validation of all its arguments.

func SeedKubeconfigGetterFactory added in v2.22.0

func SeedKubeconfigGetterFactory(ctx context.Context, client ctrlruntimeclient.Client) (provider.SeedKubeconfigGetter, error)

func SeedsGetterFactory added in v2.22.0

func SeedsGetterFactory(ctx context.Context, client ctrlruntimeclient.Client, namespace string) (provider.SeedsGetter, error)

func StaticKubermaticConfigurationGetterFactory added in v2.22.0

func StaticKubermaticConfigurationGetterFactory(config *kubermaticv1.KubermaticConfiguration) (provider.KubermaticConfigurationGetter, error)

StaticKubermaticConfigurationGetterFactory returns a KubermaticConfigurationGetter that returns the same Configuration on every call. This is mostly used for local development in order to provide an easy to modify configuration file. Actual production use will use the dynamic getter instead.

Types

type DefaultImpersonationClient

type DefaultImpersonationClient struct {
	// contains filtered or unexported fields
}

DefaultImpersonationClient knows how to create impersonated client set.

func NewImpersonationClient

func NewImpersonationClient(cfg *restclient.Config, restMapper meta.RESTMapper) *DefaultImpersonationClient

NewImpersonationClient creates a new default impersonation client that knows how to create Interface client for a impersonated user.

func (*DefaultImpersonationClient) CreateImpersonatedClient

CreateImpersonatedClient actually creates impersonated client set for the given user.

type ImpersonationClient added in v2.18.0

type ImpersonationClient func(impCfg restclient.ImpersonationConfig) (ctrlruntimeclient.Client, error)

ImpersonationClient gives runtime controller client that uses user impersonation.

Jump to

Keyboard shortcuts

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