util

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 10 Imported by: 9

Documentation

Index

Constants

View Source
const FederatedKindPrefix = "Federated"

Variables

This section is empty.

Functions

func ClusterClientset

func ClusterClientset(config *rest.Config) (*kubeclient.Clientset, error)

ClusterClientset provides a kubernetes API compliant clientset to communicate with the joining cluster's kubernetes API server.

func ClusterServiceAccountName

func ClusterServiceAccountName(joiningClusterName, hostClusterName string) string

ClusterServiceAccountName returns the name of a service account whose credentials are used by the host cluster to access the client cluster.

func ClusterServiceAccountTokenSecretName added in v0.10.0

func ClusterServiceAccountTokenSecretName(joiningClusterName, hostClusterName string) string

ClusterServiceAccountTokenSecretName returns the name of a service account token secret whose credentials are used by the host cluster to access the client cluster.

func GetNamespace added in v0.3.0

func GetNamespace(hostClusterContext string, kubeconfig string, config FedConfig) (string, error)

GetNamespace returns namespace of the current context

func HealthCheckRoleName

func HealthCheckRoleName(serviceAccountName, namespace string) string

HealthCheckRoleName returns the name of a ClusterRole and its associated ClusterRoleBinding that is used to allow the service account to check the health of the cluster and list nodes.

func HostClientset

func HostClientset(config *rest.Config) (*kubeclient.Clientset, error)

HostClientset provides a kubernetes API compliant clientset to communicate with the host cluster's kubernetes API server.

func IsFederatedAPIResource added in v0.3.0

func IsFederatedAPIResource(kind, group string) bool

IsFederatedAPIResource checks if a resource with the given Kind and group is a Federated one

func RoleName

func RoleName(serviceAccountName string) string

RoleName returns the name of a Role or ClusterRole and its associated RoleBinding or ClusterRoleBinding that are used to allow the service account to access necessary resources on the cluster.

func WriteUnstructuredToYaml

func WriteUnstructuredToYaml(unstructuredObj *unstructured.Unstructured, w io.Writer) error

Types

type FedConfig

type FedConfig interface {
	HostConfig(context, kubeconfigPath string) (*rest.Config, error)
	ClusterConfig(context, kubeconfigPath string) (*rest.Config, error)
	GetClientConfig(ontext, kubeconfigPath string) clientcmd.ClientConfig
}

FedConfig provides a rest config based on the filesystem kubeconfig (via pathOptions) and context in order to talk to the host kubernetes cluster and the joining kubernetes cluster.

func NewFedConfig

func NewFedConfig(pathOptions *clientcmd.PathOptions) FedConfig

NewFedConfig creates a fedConfig for `kubefedctl` commands.

Jump to

Keyboard shortcuts

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