remote

package
v0.0.0-...-938e221 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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

func IsTokenVolume(v corev1.Volume) bool

IsTokenVolume returns true if the supplied volume is (very likely to be) a service account token volume.

func Namespace

func Namespace(nodeName, localNamespace string) *corev1.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

func NamespaceName(nodeName, localNamespace string) string

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

func PrepareObject(nodeName string, o runtime.Object)

PrepareObject prepares the supplied object for submission to a remote cluster by running PrepareObjectMeta on it, if possible.

func PrepareObjectMeta

func PrepareObjectMeta(nodeName string, o metav1.Object)

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

func PreparePodUpdate(nodeName string, local, remote *corev1.Pod)

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

func PrepareServiceAccountTokenSecret(s *corev1.Secret)

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

func RecoverObjectMeta(o metav1.Object)

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

func RecoverPod(pod *corev1.Pod)

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.

Jump to

Keyboard shortcuts

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