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

Zarf silently fails when init package architecture doesn't match cluster architecture #1491

Closed
lucasrod16 opened this issue Mar 27, 2023 · 2 comments · Fixed by #1495
Closed
Assignees
Labels

Comments

@lucasrod16
Copy link
Contributor

Environment

Device and OS: M1 Mac
App version: v0.25.0
Kubernetes distro being used: k3s
Other: Assumption is that this is agnostic to device/OS and k8s distro. This would likely occur on any mismatch between zarf init package architecture and target cluster architecture.

Steps to reproduce

  1. From an arm64 machine, run zarf init
  2. If you don't already have an init package in your local ~/.zarf-cache directory, zarf will prompt you to download an init package with the same architecture of the machine you're on (which may or may not be the same architecture of the target cluster). If it finds one already in the local cache, it's likely that most of the time this package is the same architecture as the machine you're on.
  3. Initialize your cluster with zarf init that uses a different architecture for the init package than the target cluster. In this case use an arm64 init package to initialize an amd64 target cluster.
  4. zarf hangs on opening a port-forwarding tunnel for the zarf injector service

Expected result

Zarf performs pre-flight checks and lets me know that I can't initialize a cluster with an init package that has a different architecture

Actual Result

Zarf hangs on the init stage, and doesn't produce any information that lets you know why

Visual Proof (screenshots, videos, text, etc)

Screenshot 2023-03-27 at 1 29 57 PM

Screenshot 2023-03-27 at 1 33 51 PM

Severity/Priority

This isn't happening in a production environment, but arm64 machines for local dev are becoming more commonly used (thanks Apple), so I would consider this a medium priority.

Additional Context

@runyontr
Copy link
Contributor

@laurenmengert I think this was your issue this weekend

@lucasrod16
Copy link
Contributor Author

lucasrod16 commented Mar 27, 2023

Could possibly use the kubernetes.io/arch label on nodes to query for the cluster architecture. It is technically possible to have nodes of different architectures in the same cluster, so I am not sure how or if we need to be able to handle that scenario.

Edit: I didn't realize that zarf already has a helper function for getting the architecture of a cluster's nodes:

https://github.com/defenseunicorns/zarf/blob/43f0a06c2a219e6d28f2bf0c39d7acf272d68ec0/src/pkg/k8s/distro.go#L117

@jeff-mccoy You're making this too easy! 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants