Skip to content

feat: add arch variable to variables #3935

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

a1994sc
Copy link
Contributor

@a1994sc a1994sc commented Jun 21, 2025

Description

This PR adds in the zarf variable ZARF_ARCHITECTURE, this helps with deploying the zarf package into a multi-arch cluster.

Related Issue

Relates to #3817

Checklist before merging

@a1994sc a1994sc requested review from a team as code owners June 21, 2025 21:07
Copy link

netlify bot commented Jun 21, 2025

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit b3293c8
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/687ff2c705d8c7000833270d

@a1994sc
Copy link
Contributor Author

a1994sc commented Jun 21, 2025

I need to add logic to the injector to use the arch of the package.

Added injector logic

Copy link

codecov bot commented Jul 1, 2025

Codecov Report

Attention: Patch coverage is 23.80952% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pkg/packager/deploy.go 0.00% 9 Missing ⚠️
src/internal/packager/helm/zarf.go 0.00% 7 Missing ⚠️
Files with missing lines Coverage Δ
src/pkg/cluster/injector.go 64.92% <100.00%> (+0.20%) ⬆️
src/internal/packager/helm/zarf.go 0.00% <0.00%> (ø)
src/pkg/packager/deploy.go 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@a1994sc a1994sc force-pushed the feature/arch branch 2 times, most recently from c715385 to 238956a Compare July 2, 2025 00:11
@a1994sc a1994sc marked this pull request as draft July 2, 2025 00:12
@a1994sc
Copy link
Contributor Author

a1994sc commented Jul 2, 2025

Hm, so I after reviewing the logs from the last e2e test I see that for the arch value was not being passed along correctly. I updated the logic such that the injector, docker registry, and gitea all get deployed.... however the agent gets deployed fine once, however during part of the make test-e2e-with-cluster ARCH=amd64 the agent pods get into a pending state because the kubernetes.io/arch is set to ""... any input would be super helpful

@a1994sc
Copy link
Contributor Author

a1994sc commented Jul 2, 2025

image

@a1994sc
Copy link
Contributor Author

a1994sc commented Jul 6, 2025

I updated this PR so now ZARF_ARCHITECTURE is only set for the life-cycle of the package deployment.

Edit:

Though, I am getting the following error when doing an end-2-end test:

4s          Warning   FailedCreate        replicaset/source-controller-869c75dd44             Error creating: Internal error occurred: failed calling webhook "agent-pod.zarf.dev": failed to call webhook: Post "https://agent-hook.zarf.svc:443/mutate/pod?timeout=10s": tls: failed to verify certificate: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "ca.private.zarf.dev")

@a1994sc a1994sc marked this pull request as ready for review July 7, 2025 16:42
@AustinAbro321
Copy link
Contributor

This seems like it'll be a huge value add for Zarf, thanks for the PR. Once CI is passing, I'll try to test locally and send you an updated eks.yaml which would let us spin up a multi-arch cluster so we can have a proper e2e test.

@a1994sc
Copy link
Contributor Author

a1994sc commented Jul 11, 2025

Yea no problem! This does not fully address having a truly multi-arch support, but is a step in that direction.

(A bit selfishly I would love to see zarf running a multi-arch cluster at home, RPI and intel NUC)

@a1994sc
Copy link
Contributor Author

a1994sc commented Jul 14, 2025

Todo: update the variable to ZARF_PKG_ARCHITECTURE per convo on slack channel

ref: https://kubernetes.slack.com/archives/C03B6BJAUJ3/p1752503299318649?thread_ts=1752502999.838289&cid=C03B6BJAUJ3

Copy link
Contributor

@AustinAbro321 AustinAbro321 left a comment

Choose a reason for hiding this comment

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

A few small notes, I will make it an action item on my side to get you a new eks.yaml that can properly test a multi-node cluster with Zarf

@AustinAbro321 AustinAbro321 mentioned this pull request Jul 17, 2025
2 tasks
@a1994sc a1994sc requested a review from AustinAbro321 July 17, 2025 23:54
Copy link
Contributor

@AustinAbro321 AustinAbro321 left a comment

Choose a reason for hiding this comment

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

@@ -263,6 +263,9 @@ func (c *Cluster) getInjectorImageAndNode(ctx context.Context, resReq *v1ac.Reso
if err != nil {
return "", "", err
}
if nodeDetails.Status.NodeInfo.Architecture != architecture {
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of an abundance of caution we should not continue if nodeDetails.Status.NodeInfo.Architecture=="". Hopefully that never happens, but I don't want to break anybody if they're on a cluster where this isn't set for some reason.

Copy link
Contributor Author

@a1994sc a1994sc Jul 22, 2025

Choose a reason for hiding this comment

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

So I believe that this is a result of using a bare-bones "cluster" for tests. I believe that a really node will always have an Architecture.... I will do some research to verify that though

Signed-off-by: Allen Conlon <[email protected]>
@a1994sc a1994sc requested a review from AustinAbro321 July 23, 2025 11:35
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.

2 participants