Documentation ¶
Index ¶
- Constants
- func ClusterClientset(config *rest.Config) (*kubeclient.Clientset, error)
- func ClusterServiceAccountName(joiningClusterName, hostClusterName string) string
- func CurrentContext(config clientcmd.ClientConfig) (string, error)
- func GetNamespace(hostClusterContext string, kubeconfig string, config FedConfig) (string, error)
- func HealthCheckRoleName(serviceAccountName, namespace string) string
- func HostClientset(config *rest.Config) (*kubeclient.Clientset, error)
- func IsFederatedAPIResource(kind, group string) bool
- func IsPrimaryCluster(obj, clusterObj pkgruntime.Object) bool
- func MetaAccessor(obj pkgruntime.Object) metav1.Object
- func NewClusterController(client kubernetes.Interface, config *rest.Config, ...) *clusterController
- func RoleName(serviceAccountName string) string
- type FedConfig
Constants ¶
const ( DefaultFederatedGroup = "types.kubefed.io" DefaultFederatedVersion = "v1beta1" FederatedKindPrefix = "Federated" )
Default values for the federated group and version used by the enable and disable subcommands of `kubefedctl`.
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 ¶
ClusterServiceAccountName returns the name of a service account whose credentials are used by the host cluster to access the client cluster.
func CurrentContext ¶
func CurrentContext(config clientcmd.ClientConfig) (string, error)
CurrentContext retrieves the current context from the provided config.
func GetNamespace ¶
GetNamespace returns namespace of the current context
func HealthCheckRoleName ¶
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 ¶
IsFederatedAPIResource checks if a resource with the given Kind and group is a Federated one
func IsPrimaryCluster ¶
func IsPrimaryCluster(obj, clusterObj pkgruntime.Object) bool
IsPrimaryCluster checks if the caller is working with objects for the primary cluster by checking if the UIDs match for both ObjectMetas passed in. TODO (font): Need to revisit this when cluster ID is available.
func MetaAccessor ¶
func MetaAccessor(obj pkgruntime.Object) metav1.Object
func NewClusterController ¶
func NewClusterController( client kubernetes.Interface, config *rest.Config, clusterInformer clusterinformer.ClusterInformer, clusterClient clusterclient.ClusterInterface, resyncPeriod time.Duration, ) *clusterController
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.