Documentation ¶
Index ¶
- Constants
- func GetBmlVolumeIDByPVCName(claimName string) string
- type K8SClient
- func (c *K8SClient) CreatePod(pod *v1.Pod) (*v1.Pod, error)
- func (c *K8SClient) DeletePod(pod *v1.Pod) error
- func (c *K8SClient) GetPersistentVolumeClaim(namespace, name string, getOptions metav1.GetOptions) (*v1.PersistentVolumeClaim, error)
- func (c *K8SClient) GetPod(podName, namespace string) (*v1.Pod, error)
- func (c *K8SClient) GetPodLog(podName, namespace, containerName string) (string, error)
- func (c *K8SClient) ListPersistentVolume(listOptions metav1.ListOptions) (*v1.PersistentVolumeList, error)
- func (c *K8SClient) ProxyGetPods(nodeID string) (result *v1.PodList, err error)
- type K8SInterface
- type VolumeMount
Constants ¶
View Source
const ( PFSPrefix = "pfs-" PVCSuffix = "-pvc" )
Variables ¶
This section is empty.
Functions ¶
func GetBmlVolumeIDByPVCName ¶
Types ¶
type K8SClient ¶
type K8SClient struct { Clientset kubernetes.Interface Config *rest.Config }
func (*K8SClient) GetPersistentVolumeClaim ¶
func (c *K8SClient) GetPersistentVolumeClaim(namespace, name string, getOptions metav1.GetOptions) (*v1.PersistentVolumeClaim, error)
func (*K8SClient) ListPersistentVolume ¶
func (c *K8SClient) ListPersistentVolume(listOptions metav1.ListOptions) (*v1.PersistentVolumeList, error)
func (*K8SClient) ProxyGetPods ¶
ProxyGetPods returns all pods on the node with nodeName, and the api server will forward this request to the kubelet proxy on the node. Therefore, the pods information comes from kubelet cache, not etcd
type K8SInterface ¶
type K8SInterface interface { ProxyGetPods(nodeID string) (result *v1.PodList, err error) GetPersistentVolumeClaim(namespace, name string, getOptions metav1.GetOptions) (*v1.PersistentVolumeClaim, error) ListPersistentVolume(listOptions metav1.ListOptions) (*v1.PersistentVolumeList, error) CreatePod(pod *v1.Pod) (*v1.Pod, error) GetPod(podName, namespace string) (*v1.Pod, error) GetPodLog(podName, namespace, containerName string) (string, error) DeletePod(pod *v1.Pod) error }
func GetK8sClient ¶
func GetK8sClient() (K8SInterface, error)
type VolumeMount ¶
type VolumeMount struct { // POD UID is the unique in time and space value for the Pod PodUID string // PFSID is the unique identifies for volume in paddle flow storage service PFSID string // VolumeName is the PV's name VolumeName string // ClaimName is the PVC's name ClaimName string // ReadOnly which setting in pod's volumes ReadOnly bool }
VolumeMount is a struct that contains volume information and its mounts in the pod spec
func GetVolumeMounts ¶
func GetVolumeMounts(pod *v1.Pod) []VolumeMount
GetVolumeMounts Get volume mounts information from the pod spec
Click to show internal directories.
Click to hide internal directories.