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

feat: add scheduling logic to zarf injector #1731

Merged
merged 1 commit into from
May 18, 2023

Conversation

ragingpastry
Copy link
Contributor

@ragingpastry ragingpastry commented May 18, 2023

Description

Checks to ensure that a node does not have a NoSchedule taint before choosing that node/image for the Zarf injector pod

Related Issue

Fixes #1730
Fixes #905

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

Gave this a WAG. It seems to work locally, but am unsure if this is the direction you guys want to go. Let me know!

@netlify
Copy link

netlify bot commented May 18, 2023

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 2e5b5c9
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/646672fe4ca7c8000851f6c6

@ragingpastry ragingpastry force-pushed the zarf-injector-no-schedule branch from 108debd to 6dc6562 Compare May 18, 2023 16:20
src/pkg/k8s/images.go Outdated Show resolved Hide resolved
src/pkg/k8s/nodes.go Outdated Show resolved Hide resolved
@ragingpastry ragingpastry force-pushed the zarf-injector-no-schedule branch 2 times, most recently from 5c6ae3e to eb8de6d Compare May 18, 2023 17:03
src/pkg/k8s/images.go Outdated Show resolved Hide resolved
@ragingpastry ragingpastry force-pushed the zarf-injector-no-schedule branch from eb8de6d to 2935820 Compare May 18, 2023 17:12
Copy link
Contributor

@Racer159 Racer159 left a comment

Choose a reason for hiding this comment

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

I can't request it as a suggestion in this PR but one tiny thing after testing locally: Can you make the spinner for gathering images notify the user of the 5 minute timeout since they may hit that if all nodes have taints (similar to how waiting for cluster connection works)?

image
image

https://github.com/defenseunicorns/zarf/blob/main/src/internal/cluster/injector.go#L44

	// Get all the images from the cluster
	timeout := 5 * time.Minute
	spinner.Updatef("Getting the list of existing cluster images (%s timeout)", timeout.String())")
	if images, err = c.Kube.GetAllImages(timeout); err != nil {

https://github.com/defenseunicorns/zarf/blob/main/src/pkg/k8s/images.go#L22

func (k *K8s) GetAllImages(timeoutDuration time.Duration) (ImageNodeMap, error) {
	timeout := time.After(timeoutDuration)

@ragingpastry ragingpastry force-pushed the zarf-injector-no-schedule branch from 2935820 to 67397b1 Compare May 18, 2023 18:46
@ragingpastry ragingpastry force-pushed the zarf-injector-no-schedule branch from 67397b1 to 2e5b5c9 Compare May 18, 2023 18:48
Copy link
Contributor

@Racer159 Racer159 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@Noxsios Noxsios left a comment

Choose a reason for hiding this comment

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

lgtm

@Racer159 Racer159 merged commit d7e0cfd into zarf-dev:main May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants