Skip to content

Commit

Permalink
Update the documents with taint as pre-requisite (#140)
Browse files Browse the repository at this point in the history
* Update the docs with taint as pre-requisite

* Fix CPIStatus Phase when ProviderID is not assigned
  • Loading branch information
ridaz-zz authored Jan 10, 2022
1 parent b3e9eba commit 5bf9500
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 12 additions & 1 deletion controllers/vdoconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,9 @@ nodeloop:
func (r *VDOConfigReconciler) reconcileNodeProviderID(ctx vdocontext.VDOContext, config *vdov1alpha1.VDOConfig, clientset kubernetes.Interface, vsphereCloudConfigs *[]vdov1alpha1.VsphereCloudConfig) (bool, error) {
nodeStatus := make(map[string]vdov1alpha1.NodeStatus)
var updReq bool
allNodesReady := true

cpiStatus := vdov1alpha1.Configured
var cpiStatus vdov1alpha1.VDOConfigPhase
nodes, err := clientset.CoreV1().Nodes().List(ctx, metav1.ListOptions{})
if err != nil {
return updReq, errors.Wrapf(err, "Error reconciling the providerID for CPI, unable to fetch list of nodes")
Expand All @@ -873,6 +874,7 @@ nodeLoop:
if _, ok := config.Status.CPIStatus.NodeStatus[node.Name]; ok {
nodeStatus[node.Name] = vdov1alpha1.NodeStatusPending
cpiStatus = vdov1alpha1.Configuring
allNodesReady = false
continue nodeLoop
}

Expand All @@ -884,6 +886,7 @@ nodeLoop:
if nodeExistsInVC {
nodeStatus[node.Name] = vdov1alpha1.NodeStatusPending
cpiStatus = vdov1alpha1.Configuring
allNodesReady = false
continue nodeLoop
}

Expand All @@ -896,6 +899,14 @@ nodeLoop:

}

if len(nodeStatus) <= 0 {
return false, nil
}

if allNodesReady {
cpiStatus = vdov1alpha1.Configured
}

if config.Status.CPIStatus.Phase != cpiStatus ||
!reflect.DeepEqual(config.Status.CPIStatus.NodeStatus, nodeStatus) {
config.Status.CPIStatus.NodeStatus = nodeStatus
Expand Down
4 changes: 4 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The operator is configured to run on master node, with a single replica deployme

VDO operator is built to run on vanilla k8s cluster as well Openshift clusters

## Pre-requisite

Please ensure the pre-requisites for [CSI](https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/2.0/vmware-vsphere-csp-getting-started/GUID-0AB6E692-AA47-4B6A-8CEA-38B754E16567.html) and [CPI](https://cloud-provider-vsphere.sigs.k8s.io/tutorials/kubernetes-on-vsphere-with-kubeadm.html#:~:text=Check%20that%20all%20nodes%20are%20tainted) are met so that the CloudProvider and StorageProvider function properly

## Choose your Deployment Schemes

VDO can be deployed and configured in multiple ways depending on the environment you are working on.
Expand Down

0 comments on commit 5bf9500

Please sign in to comment.