Documentation
¶
Index ¶
- Constants
- func GetClusterRole() (rbacv1.ClusterRole, error)
- func GetClusterRoleBinding() (rbacv1.ClusterRoleBinding, error)
- func GetConfigMap() (v1.ConfigMap, error)
- func GetCustomResourceDefinition(crdyaml NDMYaml) (apiextensionsV1.CustomResourceDefinition, error)
- func GetDaemonSet() (appsv1.DaemonSet, error)
- func GetDeployment() (appsv1.Deployment, error)
- func GetNamespace() (v1.Namespace, error)
- func GetServiceAccount() (v1.ServiceAccount, error)
- func NewBDC(bdcName string) *apis.BlockDeviceClaim
- func WaitForReconciliation()
- func WaitForStateChange()
- type K8sClient
- func (c K8sClient) CreateBlockDeviceClaim(claim *apis.BlockDeviceClaim) error
- func (c K8sClient) CreateClusterRole(clusterRole rbacv1.ClusterRole) error
- func (c K8sClient) CreateClusterRoleBinding(clusterRoleBinding rbacv1.ClusterRoleBinding) error
- func (c K8sClient) CreateConfigMap(configMap corev1.ConfigMap) error
- func (c K8sClient) CreateCustomResourceDefinition(customResourceDefinition apiextensionsV1.CustomResourceDefinition) error
- func (c K8sClient) CreateDaemonSet(daemonset appsv1.DaemonSet) error
- func (c K8sClient) CreateDeployment(deployment appsv1.Deployment) error
- func (c K8sClient) CreateNDMBlockDeviceCRD() error
- func (c K8sClient) CreateNDMBlockDeviceClaimCRD() error
- func (c K8sClient) CreateNDMCRDs() error
- func (c K8sClient) CreateNDMClusterRole() error
- func (c K8sClient) CreateNDMClusterRoleBinding() error
- func (c K8sClient) CreateNDMConfigMap() error
- func (c K8sClient) CreateNDMDaemonSet() error
- func (c K8sClient) CreateNDMOperatorDeployment() error
- func (c K8sClient) CreateNDMServiceAccount() error
- func (c K8sClient) CreateNamespace(namespace corev1.Namespace) error
- func (c K8sClient) CreateOpenEBSNamespace() error
- func (c K8sClient) CreateServiceAccount(serviceAccount corev1.ServiceAccount) error
- func (c K8sClient) DeleteBlockDeviceClaim(claim *apis.BlockDeviceClaim) error
- func (c K8sClient) DeleteClusterRole(clusterRole rbacv1.ClusterRole) error
- func (c K8sClient) DeleteClusterRoleBinding(clusterrolebinding rbacv1.ClusterRoleBinding) error
- func (c K8sClient) DeleteConfigMap(configMap corev1.ConfigMap) error
- func (c K8sClient) DeleteCustomResourceDefinition(customResourceDefinition apiextensionsV1.CustomResourceDefinition) error
- func (c K8sClient) DeleteDaemonSet(daemonset appsv1.DaemonSet) error
- func (c K8sClient) DeleteDeployment(deployment appsv1.Deployment) error
- func (c K8sClient) DeleteNDMBlockDeviceCRD() error
- func (c K8sClient) DeleteNDMBlockDeviceClaimCRD() error
- func (c K8sClient) DeleteNDMCRDs() error
- func (c K8sClient) DeleteNDMClusterRole() error
- func (c K8sClient) DeleteNDMClusterRoleBinding() error
- func (c K8sClient) DeleteNDMConfigMap() error
- func (c K8sClient) DeleteNDMDaemonSet() error
- func (c K8sClient) DeleteNDMOperatorDeployment() error
- func (c K8sClient) DeleteNDMServiceAccount() error
- func (c K8sClient) DeleteNamespace(namespace corev1.Namespace) error
- func (c K8sClient) DeleteOpenEBSNamespace() error
- func (c K8sClient) DeleteServiceAccount(serviceAccount corev1.ServiceAccount) error
- func (c K8sClient) GetBlockDevice(Name, Namesapce string) (*apis.BlockDevice, error)
- func (c K8sClient) GetBlockDeviceClaim(NameSpace, Name string) (*apis.BlockDeviceClaim, error)
- func (c K8sClient) ListBlockDeviceClaims() (*apis.BlockDeviceClaimList, error)
- func (c K8sClient) ListBlockDevices() (*apis.BlockDeviceList, error)
- func (c K8sClient) ListNodeStatus() (map[string]string, error)
- func (c K8sClient) ListPodStatus() (map[string]string, error)
- func (k *K8sClient) RegenerateClient() error
- func (c K8sClient) RestartPod(name string) error
- func (c K8sClient) UpdateBlockDeviceClaim(claim *apis.BlockDeviceClaim) error
- type NDMYaml
Constants ¶
const ( // Namespace is the default namespace Namespace = "openebs" // WaitDuration is the default wait duration WaitDuration time.Duration = 5 * time.Second // Running is the active/running status of pod Running = "Running" )
Variables ¶
This section is empty.
Functions ¶
func GetClusterRole ¶
func GetClusterRole() (rbacv1.ClusterRole, error)
GetClusterRole generates the ClusterRole object from the yaml file
func GetClusterRoleBinding ¶
func GetClusterRoleBinding() (rbacv1.ClusterRoleBinding, error)
GetClusterRoleBinding generates the ClusterRoleBinding object from the yaml file
func GetConfigMap ¶
GetConfigMap generates the ConfigMap object for NDM from the yaml file
func GetCustomResourceDefinition ¶
func GetCustomResourceDefinition(crdyaml NDMYaml) (apiextensionsV1.CustomResourceDefinition, error)
GetCustomResourceDefinition generates the CustomResourceDefinition object from the specified YAML file
func GetDaemonSet ¶
GetDaemonSet generates the NDM DaemonSet object from the yaml file
func GetDeployment ¶
func GetDeployment() (appsv1.Deployment, error)
GetDeployment generates the NDO Deployment object from the yaml file
func GetNamespace ¶
GetNamespace generates the openebs namespace object from yaml file
func GetServiceAccount ¶
func GetServiceAccount() (v1.ServiceAccount, error)
GetServiceAccount generates the ServiceAccount object from the yaml file
func NewBDC ¶
func NewBDC(bdcName string) *apis.BlockDeviceClaim
NewBDC creates a sample device claim which can be used for claiming a block device.
func WaitForReconciliation ¶
func WaitForReconciliation()
WaitForReconciliation sleeps the process for a fixed duration so that the reconcile loop can run and fetch the required changes
func WaitForStateChange ¶
func WaitForStateChange()
WaitForStateChange sleeps the process for a fixed Duration so that the state changes get written in etcd and we get the updated result
Types ¶
type K8sClient ¶
type K8sClient struct {
ClientSet *kubernetes.Clientset
APIextClient *apiextensionsclient.Clientset
RunTimeClient client.Client
// contains filtered or unexported fields
}
K8sClient is the client used for etcd operations
func GetClientSet ¶
GetClientSet generates the client-set from the config file on the host Three clients are generated by the function:
- Client-set from client-go which is used for operations on pods/nodes and other first-class k8s objects. While using runtime client for this operations, the podList etc retrieved were not up-to-date
- Client from apiextensions which is used for CRUD operations on CRDs
- Runtime client from the controller-runtime which will be used for CRUD operations related to custom resources
func (K8sClient) CreateBlockDeviceClaim ¶
func (c K8sClient) CreateBlockDeviceClaim(claim *apis.BlockDeviceClaim) error
CreateBlockDeviceClaim creates a BDC
func (K8sClient) CreateClusterRole ¶
func (c K8sClient) CreateClusterRole(clusterRole rbacv1.ClusterRole) error
CreateClusterRole creates a cluster role
func (K8sClient) CreateClusterRoleBinding ¶
func (c K8sClient) CreateClusterRoleBinding(clusterRoleBinding rbacv1.ClusterRoleBinding) error
CreateClusterRoleBinding creates a rolebinding
func (K8sClient) CreateConfigMap ¶
CreateConfigMap creates a config map
func (K8sClient) CreateCustomResourceDefinition ¶
func (c K8sClient) CreateCustomResourceDefinition(customResourceDefinition apiextensionsV1.CustomResourceDefinition) error
CreateCustomResourceDefinition creates a CRD
func (K8sClient) CreateDaemonSet ¶
CreateDaemonSet creates a Daemonset
func (K8sClient) CreateDeployment ¶
func (c K8sClient) CreateDeployment(deployment appsv1.Deployment) error
CreateDeployment creates a deployment
func (K8sClient) CreateNDMBlockDeviceCRD ¶
CreateNDMBlockDeviceCRD creates the CustomResourceDefinition for a Device type
func (K8sClient) CreateNDMBlockDeviceClaimCRD ¶
CreateNDMBlockDeviceClaimCRD creates the CustomResourceDefinition for a BlockDeviceClaim type
func (K8sClient) CreateNDMCRDs ¶
CreateNDMCRDs creates the Disk, BlockDevice and BlockDeviceClaim CRDs
func (K8sClient) CreateNDMClusterRole ¶
CreateNDMClusterRole creates the ClusterRole required for NDM
func (K8sClient) CreateNDMClusterRoleBinding ¶
CreateNDMClusterRoleBinding creates the role binding required by NDM
func (K8sClient) CreateNDMConfigMap ¶
CreateNDMConfigMap creates the ConfigMap required for NDM
func (K8sClient) CreateNDMDaemonSet ¶
CreateNDMDaemonSet creates the NDM Daemonset
func (K8sClient) CreateNDMOperatorDeployment ¶
CreateNDMOperatorDeployment creates the NDM Operator
func (K8sClient) CreateNDMServiceAccount ¶
CreateNDMServiceAccount creates the ServiceAccount required for NDM
func (K8sClient) CreateNamespace ¶
CreateNamespace creates a namespace
func (K8sClient) CreateOpenEBSNamespace ¶
CreateOpenEBSNamespace creates the openebs namespace required for NDM installation
func (K8sClient) CreateServiceAccount ¶
func (c K8sClient) CreateServiceAccount(serviceAccount corev1.ServiceAccount) error
CreateServiceAccount creates a service account
func (K8sClient) DeleteBlockDeviceClaim ¶
func (c K8sClient) DeleteBlockDeviceClaim(claim *apis.BlockDeviceClaim) error
DeleteBlockDeviceClaim deletes a BDC
func (K8sClient) DeleteClusterRole ¶
func (c K8sClient) DeleteClusterRole(clusterRole rbacv1.ClusterRole) error
DeleteClusterRole deletes the cluster role
func (K8sClient) DeleteClusterRoleBinding ¶
func (c K8sClient) DeleteClusterRoleBinding(clusterrolebinding rbacv1.ClusterRoleBinding) error
DeleteClusterRoleBinding deletes the role binding
func (K8sClient) DeleteConfigMap ¶
DeleteConfigMap deletes the config map
func (K8sClient) DeleteCustomResourceDefinition ¶
func (c K8sClient) DeleteCustomResourceDefinition(customResourceDefinition apiextensionsV1.CustomResourceDefinition) error
DeleteCustomResourceDefinition deletes the CRD
func (K8sClient) DeleteDaemonSet ¶
DeleteDaemonSet deletes the Daemonset
func (K8sClient) DeleteDeployment ¶
func (c K8sClient) DeleteDeployment(deployment appsv1.Deployment) error
DeleteDeployment deletes a deployment
func (K8sClient) DeleteNDMBlockDeviceCRD ¶
DeleteNDMBlockDeviceCRD deletes the CustomResourceDefinition for a Device type
func (K8sClient) DeleteNDMBlockDeviceClaimCRD ¶
DeleteNDMBlockDeviceClaimCRD deletes the CustomResourceDefinition for a BlockDeviceClaim type
func (K8sClient) DeleteNDMCRDs ¶
DeleteNDMCRDs deletes the disk, blockdevice and blockdevice claim CRDs
func (K8sClient) DeleteNDMClusterRole ¶
DeleteNDMClusterRole deletes the ClusterRole required for NDM
func (K8sClient) DeleteNDMClusterRoleBinding ¶
DeleteNDMClusterRoleBinding deletes the role binding required by NDM
func (K8sClient) DeleteNDMConfigMap ¶
DeleteNDMConfigMap deletes the ConfigMap required for NDM
func (K8sClient) DeleteNDMDaemonSet ¶
DeleteNDMDaemonSet deletes the NDM Daemonset
func (K8sClient) DeleteNDMOperatorDeployment ¶
DeleteNDMOperatorDeployment deletes the NDM operator
func (K8sClient) DeleteNDMServiceAccount ¶
DeleteNDMServiceAccount deletes the ServiceAccount required for NDM
func (K8sClient) DeleteNamespace ¶
DeleteNamespace deletes a namespace
func (K8sClient) DeleteOpenEBSNamespace ¶
DeleteOpenEBSNamespace deletes the openebs namespace in which NDM was installed
func (K8sClient) DeleteServiceAccount ¶
func (c K8sClient) DeleteServiceAccount(serviceAccount corev1.ServiceAccount) error
DeleteServiceAccount deletes the service account
func (K8sClient) GetBlockDevice ¶
func (c K8sClient) GetBlockDevice(Name, Namesapce string) (*apis.BlockDevice, error)
GetBlockDevice with Name in Namespace
func (K8sClient) GetBlockDeviceClaim ¶
func (c K8sClient) GetBlockDeviceClaim(NameSpace, Name string) (*apis.BlockDeviceClaim, error)
GetBlockDeviceClaim from Namespace and name
func (K8sClient) ListBlockDeviceClaims ¶
func (c K8sClient) ListBlockDeviceClaims() (*apis.BlockDeviceClaimList, error)
ListBlockDeviceClaims returns list of BlockDeviceClaims in the cluster
func (K8sClient) ListBlockDevices ¶
func (c K8sClient) ListBlockDevices() (*apis.BlockDeviceList, error)
ListBlockDevices returns list of BlockDeviceCR in the cluster
func (K8sClient) ListNodeStatus ¶
ListNodeStatus returns list of all nodes(node name) in the cluster along with their status
func (K8sClient) ListPodStatus ¶
ListPodStatus returns the list of all pods in the given Namespace along with their status
func (*K8sClient) RegenerateClient ¶
func (K8sClient) RestartPod ¶
RestartPod the given pod
func (K8sClient) UpdateBlockDeviceClaim ¶
func (c K8sClient) UpdateBlockDeviceClaim(claim *apis.BlockDeviceClaim) error
UpdateBlockDeviceClaim updates the BDC
type NDMYaml ¶
type NDMYaml string
NDMYaml is a string type that stores the path to the YAML files which are required to deploy NDM
const ( ConfigMapYAML NDMYaml = "../yamls/node-disk-manager-config.yaml" ServiceAccountYAML NDMYaml = "../../deploy/yamls/serviceaccount.yaml" ClusterRoleYAML NDMYaml = "../../deploy/yamls/clusterrole.yaml" ClusterRoleBindingYAML NDMYaml = "../../deploy/yamls/clusterrolebinding.yaml" BlockDeviceCRDYAML NDMYaml = "../../deploy/crds/openebs.io_blockdevices.yaml" BlockDeviceClaimCRDYAML NDMYaml = "../../deploy/crds/openebs.io_blockdeviceclaims.yaml" DaemonSetYAML NDMYaml = "../yamls/node-disk-manager.yaml" DeploymentYAML NDMYaml = "../../deploy/yamls/node-disk-operator.yaml" OpenEBSNamespaceYAML NDMYaml = "../../deploy/yamls/namespace.yaml" )
Path to various YAMLs used for integration testing