Skip to content

Commit

Permalink
Expect a canary pod for each osd deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
sacharya committed Oct 16, 2019
1 parent 49735c4 commit 11eae9d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions pkg/deploy-manager/storagecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,29 +272,21 @@ func (t *DeployManager) waitOnStorageCluster() error {
lastReason = fmt.Sprintf("%d/%d expected OSDs are online", osdsOnline, MinOSDsCount)
}

// We expect a canary pod for each worker node to be online
// Label selector "app=rook-ceph-drain-canary" expect one for each worker node we labeled to have Phase = RUNNING
// We expect a canary pod for each osd deployment
pods, err := t.k8sClient.CoreV1().Pods(InstallNamespace).List(metav1.ListOptions{LabelSelector: "app=rook-ceph-drain-canary"})
if err != nil {
lastReason = fmt.Sprintf("%v", err)
return false, nil
}

nodes, err := t.k8sClient.CoreV1().Nodes().List(metav1.ListOptions{LabelSelector: "cluster.ocs.openshift.io/openshift-storage"})
if err != nil {
lastReason = fmt.Sprintf("%v", err)
return false, nil
}
storageNodes := len(nodes.Items)

canaryOnline := 0
for _, pod := range pods.Items {
if pod.Status.Phase == k8sv1.PodRunning {
canaryOnline++
}
}
if canaryOnline < storageNodes {
lastReason = fmt.Sprintf("Waiting on %d/%d canary pods to come online", canaryOnline, storageNodes)
if canaryOnline < MinOSDsCount {
lastReason = fmt.Sprintf("Waiting on %d/%d canary pods to come online", canaryOnline, MinOSDsCount)
return false, nil
}

Expand Down

0 comments on commit 11eae9d

Please sign in to comment.