Documentation ¶
Index ¶
- Constants
- func IsTokenVolume(v corev1.Volume) bool
- func Namespace(nodeName, localNamespace string) *corev1.Namespace
- func NamespaceName(nodeName, localNamespace string) string
- func PrepareObject(nodeName string, o runtime.Object)
- func PrepareObjectMeta(nodeName string, o metav1.Object)
- func PreparePod(nodeName string, pod *corev1.Pod, o ...PreparePodOption)
- func PreparePodUpdate(nodeName string, local, remote *corev1.Pod)
- func PrepareServiceAccountTokenSecret(s *corev1.Secret)
- func RecoverObjectMeta(o metav1.Object)
- func RecoverPod(pod *corev1.Pod)
- type PreparePodOption
Constants ¶
const ( // LabelKeyNodeName represents the node-name of the Virtual Kubelet that // created an object in a remote cluster. Each Virtual Kubelet should have a // uninque node-name within its remote cluster. LabelKeyNodeName = "actual.vk/node-name" // LabelKeyNamespace represents the 'local' namespace of an object created // in a remote cluster. LabelKeyNamespace = "actual.vk/namespace" // AnnotationKeyServiceAccountName is added to replicated service account // token secrets to indicate the service account they are associated with. AnnotationKeyServiceAccountName = "actual.vk/replicated-service-account.name" // SecretTypeReplicatedServiceAccountToken indicates that a secret is a // service account token replicated by the Virtual Kubelet so that a remote // pod may connect to the local API. SecretTypeReplicatedServiceAccountToken corev1.SecretType = "actual.vk/replicated-service-account-token" )
Variables ¶
This section is empty.
Functions ¶
func IsTokenVolume ¶
IsTokenVolume returns true if the supplied volume is (very likely to be) a service account token volume.
func Namespace ¶
Namespace returns a remote namespace corresponding to the supplied local namespace. It assumes a many-to-one local-to-remote relationship, allowing many (local) virtual kubelets to create pods (and their dependencies) in one remote cluster. Each remote namespace corresponds to a single local namespace as long as all Kubelet node names are unique within the remote cluster.
func NamespaceName ¶
NamespaceName returns a remote namespace name. Remote namespaces are named such that each remote namespace corresponds to a single local namespace as long as all Kubelet node names are unique within the remote cluster.
func PrepareObject ¶
PrepareObject prepares the supplied object for submission to a remote cluster by running PrepareObjectMeta on it, if possible.
func PrepareObjectMeta ¶
PrepareObjectMeta prepares the supplied object for submission to a remote cluster by adding labels that relate it back to its identity on the local cluster, and removing any metadata (UIDs, etc) that would conflict with the remote cluster.
func PreparePod ¶
func PreparePod(nodeName string, pod *corev1.Pod, o ...PreparePodOption)
PreparePod prepares the supplied pod for submission to a remote cluster by running PrepareObjectMeta on it, and removing any scheduling constraints that might influence the remote cluster.
func PreparePodUpdate ¶
PreparePodUpdate prepares the supplied remote pod to be updated in accordance with the supplied local pod. Few pod fields may be updated - currently only labels and annotations are supported.
func PrepareServiceAccountTokenSecret ¶
PrepareServiceAccountTokenSecret updates the type and annotations of a service account secret. This ensures the remote cluster's service account controller does not attempt to garbage collect or otherwise interfere with the secret.
func RecoverObjectMeta ¶
RecoverObjectMeta recovers a remote object for representation in the local cluster by recovering data from labels that relate it back to its identity on the local cluster, stripping those labels, and removing any metadata (UIDs, etc) that would conflict with the local cluster.
func RecoverPod ¶
RecoverPod recovers the supplied pod for representation in the local cluster by running RecoverObjectMeta on it, and removing any scheduling constraints that might influence the local cluster.
Types ¶
type PreparePodOption ¶
type PreparePodOption func(*ppo)
A PreparePodOption influences how a pod is prepared for the remote cluster.
func WithEnvVars ¶
func WithEnvVars(v ...corev1.EnvVar) PreparePodOption
WithEnvVars injects the supplied environment variables into all containers of the pod. Any existing environment variables of the same name are replaced.