Documentation ¶
Index ¶
- func BuildMetadata(cluster, vcns, vcname, targetNamespace string, obj runtime.Object) (runtime.Object, error)
- func BuildSuperMasterNamespace(cluster, vcName, vcNamespace, vcUID string, obj runtime.Object) (runtime.Object, error)
- func BuildVirtualCRD(cluster string, pCRD *v1beta1.CustomResourceDefinition) *v1beta1.CustomResourceDefinition
- func BuildVirtualEvent(cluster string, pEvent *v1.Event, vObj metav1.Object) *v1.Event
- func BuildVirtualPersistentVolume(cluster, vcNS, vcName string, pPV *v1.PersistentVolume, ...) *v1.PersistentVolume
- func BuildVirtualPriorityClass(cluster string, pPriorityClass *v1scheduling.PriorityClass) *v1scheduling.PriorityClass
- func BuildVirtualStorageClass(cluster string, pStorageClass *storagev1.StorageClass) *storagev1.StorageClass
- func CheckDWPodConditionEquality(pPod, vPod *v1.Pod) *v1.PodStatus
- func Equality(syncerConfig *config.SyncerConfiguration, vc *v1alpha1.VirtualCluster) *vcEquality
- func GetKubeConfigOfVC(c v1core.CoreV1Interface, vc *v1alpha1.VirtualCluster) ([]byte, error)
- func GetVirtualNamespace(nsLister listersv1.NamespaceLister, pNamespace string) (cluster, namespace string, err error)
- func GetVirtualOwner(meta metav1.Object) (cluster, namespace string)
- func IsControlPlaneService(service *v1.Service, cluster string) bool
- func ResetMetadata(obj metav1.Object)
- func ToClusterKey(vc *v1alpha1.VirtualCluster) string
- func ToSuperMasterNamespace(cluster, ns string) string
- type PodMutateInterface
- type PodMutator
- type SecretMutateInterface
- type ServiceMutateInterface
- type VCMutateInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildMetadata ¶
func BuildVirtualCRD ¶
func BuildVirtualCRD(cluster string, pCRD *v1beta1.CustomResourceDefinition) *v1beta1.CustomResourceDefinition
func BuildVirtualEvent ¶
func BuildVirtualPersistentVolume ¶
func BuildVirtualPersistentVolume(cluster, vcNS, vcName string, pPV *v1.PersistentVolume, vPVC *v1.PersistentVolumeClaim) *v1.PersistentVolume
func BuildVirtualPriorityClass ¶
func BuildVirtualPriorityClass(cluster string, pPriorityClass *v1scheduling.PriorityClass) *v1scheduling.PriorityClass
func BuildVirtualStorageClass ¶
func BuildVirtualStorageClass(cluster string, pStorageClass *storagev1.StorageClass) *storagev1.StorageClass
func CheckDWPodConditionEquality ¶
CheckDWPodConditionEquality check whether super master Pod Status and virtual Pod Status are logically equal. In most cases, the source of truth is super pod status, because super master actually own the physical resources, status is reported by **real** kubelet. Besides, kubernetes allows user-defined conditions, such as pod readiness gate, it will report readiness state to pod conditions. In other words, the source of truth for user-defined pod conditions should be tenant side controller, only the condition reported by kubelet should keep consistent with super. It is not recommended that webhook in super append other readiness gate to pod. we left them unchanged in super, don't sync them upward to tenant side. ref https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-readiness-gate
func Equality ¶
func Equality(syncerConfig *config.SyncerConfiguration, vc *v1alpha1.VirtualCluster) *vcEquality
func GetKubeConfigOfVC ¶
func GetKubeConfigOfVC(c v1core.CoreV1Interface, vc *v1alpha1.VirtualCluster) ([]byte, error)
func GetVirtualNamespace ¶
func GetVirtualNamespace(nsLister listersv1.NamespaceLister, pNamespace string) (cluster, namespace string, err error)
GetVirtualNamespace is used to find the corresponding namespace in tenant master for objects created in super master originally, e.g., events.
func GetVirtualOwner ¶
func IsControlPlaneService ¶
IsControlPlaneService will return if the namespacedName matches the proper NamespacedName in the tenant control plane
func ResetMetadata ¶
func ToClusterKey ¶
func ToClusterKey(vc *v1alpha1.VirtualCluster) string
ToClusterKey makes a unique key which is used to create the root namespace in super master for a virtual cluster. To avoid name conflict, the key uses the format <namespace>-<hash>-<name>
func ToSuperMasterNamespace ¶
Types ¶
type PodMutateInterface ¶
type PodMutateInterface interface {
Mutate(ms ...PodMutator) error
}
type PodMutator ¶
type PodMutator func(p *podMutateCtx) error
func PodAddExtensionMeta ¶
func PodAddExtensionMeta(vPod *v1.Pod) PodMutator
for now, only Deployment Pods are mutated.
func PodMutateAutoMountServiceAccountToken ¶
func PodMutateAutoMountServiceAccountToken(disable bool) PodMutator
func PodMutateDefault ¶
func PodMutateServiceLink ¶
func PodMutateServiceLink(disableServiceLinks bool) PodMutator
type SecretMutateInterface ¶
type ServiceMutateInterface ¶
type VCMutateInterface ¶
type VCMutateInterface interface { Pod(pPod *v1.Pod) PodMutateInterface Service(pService *v1.Service) ServiceMutateInterface ServiceAccountTokenSecret(pSecret *v1.Secret) SecretMutateInterface }
func VC ¶
func VC(mc *mc.MultiClusterController, clusterName string) VCMutateInterface