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

Latest zarf version (0.26.3 as well) cannot deploy package without k8s present #1723

Closed
WeaponX314 opened this issue May 17, 2023 · 3 comments · Fixed by #1724
Closed

Latest zarf version (0.26.3 as well) cannot deploy package without k8s present #1723

WeaponX314 opened this issue May 17, 2023 · 3 comments · Fixed by #1724
Labels
bug 🐞 Something isn't working

Comments

@WeaponX314
Copy link
Contributor

Environment

Device and OS: Linux (RHEL 8)
App version: 0.26.4
Kubernetes distro being used: k3s
Other:

Steps to reproduce

  1. Create the package (which only contains actions and files) using either zarf 0.26.1 or 0.26.4
  2. Deploy on a server in which no zarf init or k3s environment exists (yet)

Expected result

Package deploys successfully

Actual Result

Running on the same exact package:
Zarf 0.26.1, package deploys successfully and doesn't need to contact k8s api
Zarf 0.26.4, package stops before even listing preview indicating it can't conect to https://127.0.0.1:6443/api/v1/nodes

There are no action in this zarf package that make usage of kubectl or need to query the k8s api server. The very last action is to systemctl start k3s-agent.

Visual Proof (screenshots, videos, text, etc)

Working:
Working

Not Working:
not_working

Severity/Priority

Additional Context

This seems like a new behavior and not sure if this is intended. We would like to be able to run this without a k3s server since this is meant to stand up a k3s agent.
Here is a trace dump as well of the non-working:

Saving log file to /tmp/zarf-2023-05-17-14-46-23-1146873762.log
  DEBUG   2023-05-17T14:46:23-04:00  -  json: unsupported type: func(context.Context, v1.Descriptor) error ERROR marshalling json
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:238)
  DEBUG   2023-05-17T14:46:23-04:00  -  json: unsupported type: func(context.Context, v1.Descriptor) error ERROR marshalling json
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:238)
  DEBUG   2023-05-17T14:46:23-04:00  -  packager.New()
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:23-04:00  -  packager.New()
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:23-04:00  -  packager.createPaths()
└ (/home/runner/work/zarf/zarf/src/pkg/packager/common.go:173)
  DEBUG   2023-05-17T14:46:23-04:00  -  packager.createPaths()
└ (/home/runner/work/zarf/zarf/src/pkg/packager/common.go:173)
  DEBUG   2023-05-17T14:46:23-04:00  -  Using temp path: '/tmp/zarf-2967071962'
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:23-04:00  -  Using temp path: '/tmp/zarf-2967071962'
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)

  DEBUG   2023-05-17T14:46:23-04:00  -  packager.Deploy()
└ (/home/runner/work/zarf/zarf/src/pkg/packager/deploy.go:39)
  DEBUG   2023-05-17T14:46:23-04:00  -  packager.Deploy()
└ (/home/runner/work/zarf/zarf/src/pkg/packager/deploy.go:39)
  DEBUG   2023-05-17T14:46:23-04:00  -  packager.handlePackagePath()
└ (/home/runner/work/zarf/zarf/src/pkg/packager/network.go:31)
  DEBUG   2023-05-17T14:46:23-04:00  -  packager.handlePackagePath()
└ (/home/runner/work/zarf/zarf/src/pkg/packager/network.go:31)
  DEBUG   2023-05-17T14:46:23-04:00  -  Provided package path is not a URL, skipping download
└ (/home/runner/work/zarf/zarf/src/pkg/packager/network.go:38)
  DEBUG   2023-05-17T14:46:23-04:00  -  Provided package path is not a URL, skipping download
└ (/home/runner/work/zarf/zarf/src/pkg/packager/network.go:38)
  DEBUG   2023-05-17T14:46:23-04:00  -  Checking for partial package: zarf-package-k3s-amd64-0.3.0-v1.27.1+k3s1.tar.zst                                   
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:23-04:00  -  Checking for partial package: zarf-package-k3s-amd64-0.3.0-v1.27.1+k3s1.tar.zst
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:23-04:00  -  No partial package detected                                                                                       
└ (/home/runner/work/zarf/zarf/src/pkg/packager/common.go:289)
  DEBUG   2023-05-17T14:46:23-04:00  -  No partial package detected
└ (/home/runner/work/zarf/zarf/src/pkg/packager/common.go:289)
  DEBUG   2023-05-17T14:46:24-04:00  -  Loading zarf config /tmp/zarf-2967071962/zarf.yaml                                                                
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:24-04:00  -  Loading zarf config /tmp/zarf-2967071962/zarf.yaml
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:24-04:00  -  config.isCompatibleComponent(k3s, true)                                                                           
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:24-04:00  -  config.isCompatibleComponent(k3s, true)
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  ✔  All of the checksums matched!                                                                                                                        
  ✔  Loading Zarf Package zarf-package-k3s-amd64-0.3.0-v1.27.1+k3s1.tar.zst                                                                               
  DEBUG   2023-05-17T14:46:25-04:00  -  k8s.NewK8sClient()
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:25-04:00  -  k8s.NewK8sClient()
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:25-04:00  -  &v1.NodeList{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ListMeta:v1.ListMeta{SelfLink:"", ResourceVersion:"", Continue:"", RemainingItemCount:(*int64)(nil)}, Items:[]v1.Node(nil)}
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:25-04:00  -  &v1.NodeList{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ListMeta:v1.ListMeta{SelfLink:"", ResourceVersion:"", Continue:"", RemainingItemCount:(*int64)(nil)}, Items:[]v1.Node(nil)}
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:118)
  DEBUG   2023-05-17T14:46:25-04:00  -  Get "https://127.0.0.1:6443/api/v1/nodes": dial tcp 127.0.0.1:6443: connect: connection refused
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:154)
  DEBUG   2023-05-17T14:46:25-04:00  -  Get "https://127.0.0.1:6443/api/v1/nodes": dial tcp 127.0.0.1:6443: connect: connection refused
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:154)
     ERROR:  Failed to deploy package: Get "https://127.0.0.1:6443/api/v1/nodes": dial tcp 127.0.0.1:6443:
             connect: connection refused
└ (/home/runner/work/zarf/zarf/src/cmd/package.go:96)
  DEBUG   2023-05-17T14:46:25-04:00  -  goroutine 1 [running]:
          runtime/debug.Stack()
                /opt/hostedtoolcache/go/1.19.9/x64/src/runtime/debug/stack.go:24 +0x65
          github.com/defenseunicorns/zarf/src/pkg/message.Fatal({0x3587540?, 0xc0007c2000?}, {0xc00050d780, 0x79})
                /home/runner/work/zarf/zarf/src/pkg/message/message.go:156 +0x18a
          github.com/defenseunicorns/zarf/src/pkg/message.Fatalf({0x3587540, 0xc0007c2000}, {0x3a50b0b?, 0x0?}, {0xc000b39d28?, 0x0?, 0x0?})
                /home/runner/work/zarf/zarf/src/pkg/message/message.go:163 +0x51
          github.com/defenseunicorns/zarf/src/cmd.glob..func15(0x729b9a0?, {0xc0007c3da0?, 0x3?, 0x3?})
                /home/runner/work/zarf/zarf/src/cmd/package.go:96 +0x19f
          github.com/spf13/cobra.(*Command).execute(0x729b9a0, {0xc0007c3ce0, 0x3, 0x3})
                /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x847
          github.com/spf13/cobra.(*Command).ExecuteC(0x729c520)
                /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
          github.com/spf13/cobra.(*Command).Execute(...)
                /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
          github.com/defenseunicorns/zarf/src/cmd.Execute()
                /home/runner/work/zarf/zarf/src/cmd/root.go:68 +0x25
          main.main()
                /home/runner/work/zarf/zarf/main.go:23 +0x6f
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:156)
  DEBUG   2023-05-17T14:46:25-04:00  -  goroutine 1 [running]:
          runtime/debug.Stack()
                /opt/hostedtoolcache/go/1.19.9/x64/src/runtime/debug/stack.go:24 +0x65
          github.com/defenseunicorns/zarf/src/pkg/message.Fatal({0x3587540?, 0xc0007c2000?}, {0xc00050d780, 0x79})
                /home/runner/work/zarf/zarf/src/pkg/message/message.go:156 +0x18a
          github.com/defenseunicorns/zarf/src/pkg/message.Fatalf({0x3587540, 0xc0007c2000}, {0x3a50b0b?, 0x0?}, {0xc000b39d28?, 0x0?, 0x0?})
                /home/runner/work/zarf/zarf/src/pkg/message/message.go:163 +0x51
          github.com/defenseunicorns/zarf/src/cmd.glob..func15(0x729b9a0?, {0xc0007c3da0?, 0x3?, 0x3?})
                /home/runner/work/zarf/zarf/src/cmd/package.go:96 +0x19f
          github.com/spf13/cobra.(*Command).execute(0x729b9a0, {0xc0007c3ce0, 0x3, 0x3})
                /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x847
          github.com/spf13/cobra.(*Command).ExecuteC(0x729c520)
                /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
          github.com/spf13/cobra.(*Command).Execute(...)
                /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
          github.com/defenseunicorns/zarf/src/cmd.Execute()
                /home/runner/work/zarf/zarf/src/cmd/root.go:68 +0x25
          main.main()
                /home/runner/work/zarf/zarf/main.go:23 +0x6f
└ (/home/runner/work/zarf/zarf/src/pkg/message/message.go:156)
@Racer159
Copy link
Contributor

Racer159 commented May 17, 2023

Will get a PR up for this asap - as a workaround though you can rename your ~/.kube/config file or remove the clusters from it and Zarf should start working again - basically this sees a cluster is available and wants to gather some information about it to perform some architecture checks and fails to connect to that non-existent cluster. This should be a warning instead of an error.

@WeaponX314
Copy link
Contributor Author

WeaponX314 commented May 17, 2023

Yes, confirmed removing ~/.kube/config is a workaround! The package continues to deploy after doing that. Thanks for the suggestion, your super quick response, and the pending PR!

@Racer159
Copy link
Contributor

No problem! Submitted that PR and it should make it's way out in v0.27.0. Thanks for the report!

Racer159 added a commit that referenced this issue May 17, 2023
…1724)

## Description

This fixes an issue where an inaccessible cluster in a kube config can
prevent the arch check

## Related Issue

Fixes #1723 

## Type of change

- [X] 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

- [x] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants