util

package
v1.7.6-beta.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KubeconfigSecretDataKey is the key name used in the secret to
	// stores a cluster's credentials.
	KubeconfigSecretDataKey = "kubeconfig"

	// Used in and to create the kube-dns configmap storing the zone info
	FedDomainMapKey       = "federations"
	KubeDnsConfigmapName  = "kube-dns"
	FedDNSZoneName        = "dns-zone-name"
	FedNameServer         = "nameserver"
	FedDNSProvider        = "dns-provider"
	FedDNSProviderCoreDNS = "coredns"
	KubeDnsStubDomains    = "stubDomains"

	// DefaultFederationSystemNamespace is the namespace in which
	// federation system components are hosted.
	DefaultFederationSystemNamespace = "federation-system"

	KubeAPIQPS   = 20.0
	KubeAPIBurst = 30
)

Variables

This section is empty.

Functions

func ClusterRoleName added in v1.7.0

func ClusterRoleName(federationName, serviceAccountName string) string

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

func ClusterServiceAccountName added in v1.7.0

func ClusterServiceAccountName(joiningClusterName, hostContext string) string

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

func CreateKubeconfigSecret

func CreateKubeconfigSecret(clientset client.Interface, kubeconfig *clientcmdapi.Config, namespace, name, federationName, clusterName string, dryRun bool) (*api.Secret, error)

func GetClientsetFromSecret added in v1.6.0

func GetClientsetFromSecret(secret *api.Secret, serverAddress string) (*client.Clientset, error)

func GetServerAddress added in v1.6.0

func GetServerAddress(c *federationapi.Cluster) (string, error)

func GetVersionedClientForRBACOrFail added in v1.6.0

func GetVersionedClientForRBACOrFail(hostFactory cmdutil.Factory) (client.Interface, error)

GetVersionedClientForRBACOrFail discovers the versioned rbac APIs and gets the versioned clientset for either the preferred version or the first listed version (if no preference listed) TODO: We need to evaluate the usage of RESTMapper interface to achieve te same functionality

Types

type AdminConfig

type AdminConfig interface {
	// PathOptions provides filesystem based kubeconfig access.
	PathOptions() *clientcmd.PathOptions
	// FedClientSet provides a federation API compliant clientset
	// to communicate with the federation control plane api server
	FederationClientset(context, kubeconfigPath string) (*fedclient.Clientset, error)
	// ClusterFactory provides a mechanism to communicate with the
	// cluster derived from the context and the kubeconfig.
	ClusterFactory(context, kubeconfigPath string) cmdutil.Factory
}

AdminConfig provides a filesystem based kubeconfig (via `PathOptions()`) and a mechanism to talk to the federation host cluster and the federation control plane api server.

func NewAdminConfig

func NewAdminConfig(pathOptions *clientcmd.PathOptions) AdminConfig

NewAdminConfig creates an admin config for `kubefed` commands.

type NoRBACAPIError added in v1.6.0

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

used to identify the rbac api availability error.

func (*NoRBACAPIError) Error added in v1.6.0

func (n *NoRBACAPIError) Error() string

type SubcommandOptions added in v1.6.0

type SubcommandOptions struct {
	Name                      string
	Host                      string
	FederationSystemNamespace string
	Kubeconfig                string
}

SubcommandOptions holds the configuration required by the subcommands of `kubefed`.

func (*SubcommandOptions) Bind added in v1.6.0

func (o *SubcommandOptions) Bind(flags *pflag.FlagSet)

func (*SubcommandOptions) SetName added in v1.6.0

func (o *SubcommandOptions) SetName(cmd *cobra.Command, args []string) error

Jump to

Keyboard shortcuts

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