Documentation
¶
Overview ¶
Package executor manages objects within k8s that implement virtual clusters.
For the most part, the exported functions in this package will create, update, or delete individual native k8s objects that make up parts of the virtual cluster. The exceptions are in guest.go, where the exported functions handle operations within a cluster member's OS.
Index ¶
- func CreateDir(cr *kdv1.KubeDirectorCluster, podName string, dirName string) error
- func CreateFile(cr *kdv1.KubeDirectorCluster, podName string, filePath string, ...) error
- func CreateHeadlessService(cr *kdv1.KubeDirectorCluster) (*v1.Service, error)
- func CreatePodService(cr *kdv1.KubeDirectorCluster, role *kdv1.Role, podName string) (*v1.Service, error)
- func CreateStatefulSet(cr *kdv1.KubeDirectorCluster, role *kdv1.Role) (*appsv1.StatefulSet, error)
- func DeletePVC(namespace string, pvcName string) error
- func DeletePodService(namespace string, serviceName string) error
- func DeleteStatefulSet(namespace string, statefulSetName string) error
- func EnsureFinalizer(cr *kdv1.KubeDirectorCluster) error
- func IsFileExists(cr *kdv1.KubeDirectorCluster, podName string, filePath string) bool
- func RemoveFinalizer(cr *kdv1.KubeDirectorCluster) error
- func RunScript(cr *kdv1.KubeDirectorCluster, podName string, description string, ...) error
- func UpdateHeadlessService(cr *kdv1.KubeDirectorCluster, service *v1.Service) error
- func UpdatePodService(cr *kdv1.KubeDirectorCluster, role *kdv1.Role, podName string, ...) error
- func UpdateStatefulSetNonReplicas(cr *kdv1.KubeDirectorCluster, role *kdv1.Role, statefulSet *appsv1.StatefulSet) error
- func UpdateStatefulSetReplicas(cr *kdv1.KubeDirectorCluster, replicas int32, statefulSet *appsv1.StatefulSet) error
- func UpdateStatus(cr *kdv1.KubeDirectorCluster) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDir ¶
func CreateDir( cr *kdv1.KubeDirectorCluster, podName string, dirName string, ) error
CreateDir creates a directory (and any parent directors) in the filesystem of the given pod
func CreateFile ¶
func CreateFile( cr *kdv1.KubeDirectorCluster, podName string, filePath string, reader io.Reader, ) error
CreateFile takes the stream from the given reader, and writes it to the indicated filepath in the filesystem of the given pod.
func CreateHeadlessService ¶
func CreateHeadlessService( cr *kdv1.KubeDirectorCluster, ) (*v1.Service, error)
CreateHeadlessService creates in k8s the "cluster service" used for intra-cluster network communication and for defining the virtual cluster's DNS subdomain. Cluster service name is an important part of DNS identity, so if we had already used a name previously and are re-creating the service, re-use that same name instead of generating a new one.
func CreatePodService ¶
func CreatePodService( cr *kdv1.KubeDirectorCluster, role *kdv1.Role, podName string, ) (*v1.Service, error)
CreatePodService creates in k8s a service that exposes the designated service endpoints of a virtual cluster member. Depending on the app type definition, this will be either a NodePort service (default) or a LoadBalancer service.
func CreateStatefulSet ¶
func CreateStatefulSet( cr *kdv1.KubeDirectorCluster, role *kdv1.Role, ) (*appsv1.StatefulSet, error)
CreateStatefulSet creates in k8s a zero-replicas statefulset for implementing the given role.
func DeletePodService ¶
DeletePodService deletes a per-member service from k8s.
func DeleteStatefulSet ¶
DeleteStatefulSet deletes a statefulset from k8s.
func EnsureFinalizer ¶
func EnsureFinalizer( cr *kdv1.KubeDirectorCluster, ) error
EnsureFinalizer adds the KubeDirector finalizer into the CR's finalizers list (if it is not in there).
func IsFileExists ¶
func IsFileExists( cr *kdv1.KubeDirectorCluster, podName string, filePath string, ) bool
IsFileExists probes whether the given pod's filesystem contains something at the indicated filepath.
func RemoveFinalizer ¶
func RemoveFinalizer( cr *kdv1.KubeDirectorCluster, ) error
RemoveFinalizer removes the KubeDirector finalizer from the CR's finalizers list (if it is in there).
func RunScript ¶
func RunScript( cr *kdv1.KubeDirectorCluster, podName string, description string, reader io.Reader, ) error
RunScript takes the stream from the given reader, and executes it as a shell script in the given pod.
func UpdateHeadlessService ¶
func UpdateHeadlessService( cr *kdv1.KubeDirectorCluster, service *v1.Service, ) error
UpdateHeadlessService examines the current cluster service in k8s and may take steps to reconcile it to the desired spec.
func UpdatePodService ¶
func UpdatePodService( cr *kdv1.KubeDirectorCluster, role *kdv1.Role, podName string, service *v1.Service, ) error
UpdatePodService examines a current per-member service in k8s and may take steps to reconcile it to the desired spec.
func UpdateStatefulSetNonReplicas ¶
func UpdateStatefulSetNonReplicas( cr *kdv1.KubeDirectorCluster, role *kdv1.Role, statefulSet *appsv1.StatefulSet, ) error
UpdateHeadlessService examines a current statefulset in k8s and may take steps to reconcile it to the desired spec, for properties other than the replicas count.
func UpdateStatefulSetReplicas ¶
func UpdateStatefulSetReplicas( cr *kdv1.KubeDirectorCluster, replicas int32, statefulSet *appsv1.StatefulSet, ) error
UpdateStatefulSetReplicas modifies an existing statefulset in k8s to have the given number of replicas.
func UpdateStatus ¶
func UpdateStatus( cr *kdv1.KubeDirectorCluster, ) error
UpdateStatus propagates status changes back to k8s. Roles or members in the status that have been marked for deletion (by having certain fields set to emptystring) will be removed before the writeback.
Types ¶
This section is empty.