kubernetes

package
v3.0.0-...-d6c4d9c Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func ClusterFromNamespace

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

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

func DatacenterGetterFactory

func DatacenterGetterFactory(client ctrlruntimeclient.Reader) (provider.DatacenterGetter, error)

DatacenterGetterFactory returns a DatacenterGetter. It has validation of all its arguments.

func DatacentersGetterFactory

func DatacentersGetterFactory(client ctrlruntimeclient.Client) (provider.DatacentersGetter, error)

func DynamicKubermaticConfigurationGetterFactory

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

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 NamespaceName

func NamespaceName(clusterName string) string

NamespaceName returns the namespace name for a cluster.

func StaticKubermaticConfigurationGetterFactory

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

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