Documentation ¶
Index ¶
- Constants
- func GetClusterRole() (rbacv1beta1.ClusterRole, error)
- func GetClusterRoleBinding() (rbacv1beta1.ClusterRoleBinding, error)
- func GetConfigMap() (v1.ConfigMap, error)
- func GetCustomResourceDefinition(crdyaml NDMYaml) (apiextensionsv1beta1.CustomResourceDefinition, error)
- func GetDaemonSet() (appsv1.DaemonSet, error)
- func GetDeployment() (appsv1.Deployment, 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 rbacv1beta1.ClusterRole) error
- func (c K8sClient) CreateClusterRoleBinding(clusterRoleBinding rbacv1beta1.ClusterRoleBinding) error
- func (c K8sClient) CreateConfigMap(configMap v1.ConfigMap) error
- func (c K8sClient) CreateCustomResourceDefinition(customResourceDefinition apiextensionsv1beta1.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) CreateServiceAccount(serviceAccount v1.ServiceAccount) error
- func (c K8sClient) DeleteBlockDeviceClaim(claim *apis.BlockDeviceClaim) error
- func (c K8sClient) DeleteClusterRole(clusterRole rbacv1beta1.ClusterRole) error
- func (c K8sClient) DeleteClusterRoleBinding(clusterrolebinding rbacv1beta1.ClusterRoleBinding) error
- func (c K8sClient) DeleteConfigMap(configMap v1.ConfigMap) error
- func (c K8sClient) DeleteCustomResourceDefinition(customResourceDefinition apiextensionsv1beta1.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) DeleteServiceAccount(serviceAccount v1.ServiceAccount) 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 = "default" // 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() (rbacv1beta1.ClusterRole, error)
GetClusterRole generates the ClusterRole object from the yaml file
func GetClusterRoleBinding ¶
func GetClusterRoleBinding() (rbacv1beta1.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) (apiextensionsv1beta1.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 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 ¶ added in v0.4.7
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 ¶ added in v0.4.3
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 ¶ added in v0.4.3
func (c K8sClient) CreateBlockDeviceClaim(claim *apis.BlockDeviceClaim) error
CreateBlockDeviceClaim creates a BDC
func (K8sClient) CreateClusterRole ¶ added in v0.4.3
func (c K8sClient) CreateClusterRole(clusterRole rbacv1beta1.ClusterRole) error
CreateClusterRole creates a cluster role
func (K8sClient) CreateClusterRoleBinding ¶ added in v0.4.3
func (c K8sClient) CreateClusterRoleBinding(clusterRoleBinding rbacv1beta1.ClusterRoleBinding) error
CreateClusterRoleBinding creates a rolebinding
func (K8sClient) CreateConfigMap ¶ added in v0.4.3
CreateConfigMap creates a config map
func (K8sClient) CreateCustomResourceDefinition ¶ added in v0.4.3
func (c K8sClient) CreateCustomResourceDefinition(customResourceDefinition apiextensionsv1beta1.CustomResourceDefinition) error
CreateCustomResourceDefinition creates a CRD
func (K8sClient) CreateDaemonSet ¶ added in v0.4.3
CreateDaemonSet creates a Daemonset
func (K8sClient) CreateDeployment ¶ added in v0.4.3
func (c K8sClient) CreateDeployment(deployment appsv1.Deployment) error
CreateDeployment creates a deployment
func (K8sClient) CreateNDMBlockDeviceCRD ¶ added in v0.4.3
CreateNDMBlockDeviceCRD creates the CustomResourceDefinition for a Device type
func (K8sClient) CreateNDMBlockDeviceClaimCRD ¶ added in v0.4.3
CreateNDMBlockDeviceClaimCRD creates the CustomResourceDefinition for a BlockDeviceClaim type
func (K8sClient) CreateNDMCRDs ¶ added in v0.4.3
CreateNDMCRDs creates the Disk, BlockDevice and BlockDeviceClaim CRDs
func (K8sClient) CreateNDMClusterRole ¶ added in v0.4.3
CreateNDMClusterRole creates the ClusterRole required for NDM
func (K8sClient) CreateNDMClusterRoleBinding ¶ added in v0.4.3
CreateNDMClusterRoleBinding creates the role binding required by NDM
func (K8sClient) CreateNDMConfigMap ¶ added in v0.4.3
CreateNDMConfigMap creates the ConfigMap required for NDM
func (K8sClient) CreateNDMDaemonSet ¶ added in v0.4.3
CreateNDMDaemonSet creates the NDM Daemonset
func (K8sClient) CreateNDMOperatorDeployment ¶ added in v0.4.3
CreateNDMOperatorDeployment creates the NDM Operator
func (K8sClient) CreateNDMServiceAccount ¶ added in v0.4.3
CreateNDMServiceAccount creates the ServiceAccount required for NDM
func (K8sClient) CreateServiceAccount ¶ added in v0.4.3
func (c K8sClient) CreateServiceAccount(serviceAccount v1.ServiceAccount) error
CreateServiceAccount creates a service account
func (K8sClient) DeleteBlockDeviceClaim ¶ added in v0.4.3
func (c K8sClient) DeleteBlockDeviceClaim(claim *apis.BlockDeviceClaim) error
DeleteBlockDeviceClaim deletes a BDC
func (K8sClient) DeleteClusterRole ¶ added in v0.4.3
func (c K8sClient) DeleteClusterRole(clusterRole rbacv1beta1.ClusterRole) error
DeleteClusterRole deletes the cluster role
func (K8sClient) DeleteClusterRoleBinding ¶ added in v0.4.3
func (c K8sClient) DeleteClusterRoleBinding(clusterrolebinding rbacv1beta1.ClusterRoleBinding) error
DeleteClusterRoleBinding deletes the role binding
func (K8sClient) DeleteConfigMap ¶ added in v0.4.3
DeleteConfigMap deletes the config map
func (K8sClient) DeleteCustomResourceDefinition ¶ added in v0.4.3
func (c K8sClient) DeleteCustomResourceDefinition(customResourceDefinition apiextensionsv1beta1.CustomResourceDefinition) error
DeleteCustomResourceDefinition deletes the CRD
func (K8sClient) DeleteDaemonSet ¶ added in v0.4.3
DeleteDaemonSet deletes the Daemonset
func (K8sClient) DeleteDeployment ¶ added in v0.4.3
func (c K8sClient) DeleteDeployment(deployment appsv1.Deployment) error
DeleteDeployment deletes a deployment
func (K8sClient) DeleteNDMBlockDeviceCRD ¶ added in v0.4.3
DeleteNDMBlockDeviceCRD deletes the CustomResourceDefinition for a Device type
func (K8sClient) DeleteNDMBlockDeviceClaimCRD ¶ added in v0.4.3
DeleteNDMBlockDeviceClaimCRD deletes the CustomResourceDefinition for a BlockDeviceClaim type
func (K8sClient) DeleteNDMCRDs ¶ added in v0.4.3
DeleteNDMCRDs deletes the disk, blockdevice and blockdevice claim CRDs
func (K8sClient) DeleteNDMClusterRole ¶ added in v0.4.3
DeleteNDMClusterRole deletes the ClusterRole required for NDM
func (K8sClient) DeleteNDMClusterRoleBinding ¶ added in v0.4.3
DeleteNDMClusterRoleBinding deletes the role binding required by NDM
func (K8sClient) DeleteNDMConfigMap ¶ added in v0.4.3
DeleteNDMConfigMap deletes the ConfigMap required for NDM
func (K8sClient) DeleteNDMDaemonSet ¶ added in v0.4.3
DeleteNDMDaemonSet deletes the NDM Daemonset
func (K8sClient) DeleteNDMOperatorDeployment ¶ added in v0.4.3
DeleteNDMOperatorDeployment deletes the NDM operator
func (K8sClient) DeleteNDMServiceAccount ¶ added in v0.4.3
DeleteNDMServiceAccount deletes the ServiceAccount required for NDM
func (K8sClient) DeleteServiceAccount ¶ added in v0.4.3
func (c K8sClient) DeleteServiceAccount(serviceAccount v1.ServiceAccount) error
DeleteServiceAc[2050]:4589616count deletes the service account
func (K8sClient) GetBlockDeviceClaim ¶ added in v0.4.3
func (c K8sClient) GetBlockDeviceClaim(NameSpace, Name string) (*apis.BlockDeviceClaim, error)
GetBlockDeviceClaim from Namespace and name
func (K8sClient) ListBlockDeviceClaims ¶ added in v0.4.3
func (c K8sClient) ListBlockDeviceClaims() (*apis.BlockDeviceClaimList, error)
ListBlockDeviceClaims returns list of BlockDeviceClaims in the cluster
func (K8sClient) ListBlockDevices ¶ added in v0.4.3
func (c K8sClient) ListBlockDevices() (*apis.BlockDeviceList, error)
ListBlockDevices returns list of BlockDeviceCR in the cluster
func (K8sClient) ListNodeStatus ¶ added in v0.4.3
ListNodeStatus returns list of all nodes(node name) in the cluster along with their status
func (K8sClient) ListPodStatus ¶ added in v0.4.3
ListPodStatus returns the list of all pods in the given Namespace along with their status
func (*K8sClient) RegenerateClient ¶ added in v0.8.0
func (K8sClient) RestartPod ¶ added in v0.4.3
RestartPod the given pod
func (K8sClient) UpdateBlockDeviceClaim ¶ added in v0.4.3
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/configmap.yaml" ServiceAccountYAML NDMYaml = "../yamls/serviceaccount.yaml" ClusterRoleYAML NDMYaml = "../yamls/clusterrole.yaml" ClusterRoleBindingYAML NDMYaml = "../yamls/clusterrolebinding.yaml" BlockDeviceCRDYAML NDMYaml = "../yamls/blockDeviceCR.yaml" BlockDeviceClaimCRDYAML NDMYaml = "../yamls/blockDeviceClaimCR.yaml" DaemonSetYAML NDMYaml = "../yamls/daemonset.yaml" DeploymentYAML NDMYaml = "../yamls/deployment.yaml" )
Path to various YAMLs used for integration testing