Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KO-285: Allow Operator operations with failed pods #257

Merged
merged 17 commits into from
Dec 4, 2023
Merged

KO-285: Allow Operator operations with failed pods #257

merged 17 commits into from
Dec 4, 2023

Conversation

abhishekdwivedi3060
Copy link
Collaborator

No description provided.

@@ -72,7 +72,13 @@ type AerospikeClusterSpec struct { //nolint:govet // for readability
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Seeds Finder Services"
SeedsFinderServices SeedsFinderServices `json:"seedsFinderServices,omitempty"`
// RosterNodeBlockList is a list of blocked nodeIDs from roster in a strong-consistency setup
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Roster NodeB lockList"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: check for extra space in "Roster NodeB lockList" after 'B'

@@ -60,6 +67,10 @@ spec:
cluster. Pods will be deployed in given racks based on given configuration
displayName: Rack Config
path: rackConfig
- description: RosterNodeBlockList is a list of blocked nodeIDs from roster
in a strong-consistency setup
displayName: Roster NodeB lockList
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same space thing

@@ -18,6 +18,7 @@ import (
"time"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/sets"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can skip changing existing implementation of sets, but for new use-case can we use golang-set? Or may be in some files we are already imported apimachinery sets and you don't want to import both, in that case it's fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

golang-set is only used in SC file for management-lib changes.
As discussed, we won't change existing code to golang-set in this PR, so adding new changes with golang-set was causing confusion. So kept everything on apimachinery set pkg and will move to golang-set in one go.

@@ -34,19 +35,19 @@ import (
// The ignorablePods list should be a list of failed or pending pods that are going to be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change comment as we have changed the variable name.

By("Scale up")
aeroCluster, err = getCluster(k8sClient, ctx, clusterNamespacedName)
Expect(err).ToNot(HaveOccurred())
aeroCluster.Spec.IgnorePodList = []string{ignorePodName}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason of setting it again after setting it at line 179? AFAIK only user can remove the name from IgnorePodList right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required.

@@ -124,6 +129,92 @@ func ScaleDownWithMigrateFillDelay(ctx goctx.Context) {
)
}

func clusterWithIgnorePodList(ctx goctx.Context) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a test after removing the name from list and make that pod running to check if updated config is correctly reflected on that pod as well?

RosterNodeBlockList []string `json:"rosterNodeBlockList,omitempty"`
// IgnorePodList is the list of pods which are ignored by the operator while checking the cluster stability and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// IgnorePodList is a list of pods that the operator will ignore while assessing cluster stability.
// Pods specified in this list are not considered part of the cluster. This is particularly useful when
// there are failed pods and the operator needs to perform certain operations on the cluster. Note that
// running pods included in this list will not be ignored.

for idx := range pods {
pod := pods[idx]
if ignorablePodNames.Has(pod.Name) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we calls getFailedAndActivePods at 4 places, at 2 places we make sure that there are no ignorable pods present in pods list passed to this function, and in other two places from reconcileRacks(), there are chances of having ignorable pods in pods list. Can we write it better and remove check if ignorablePodNames.Has(pod.Name) { from getFailedAndActivePods if possible.

@sud82 sud82 merged commit a8fba60 into master Dec 4, 2023
4 checks passed
@abhishekdwivedi3060 abhishekdwivedi3060 deleted the KO-285 branch December 27, 2023 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants