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

K0s vcluster ends up in crash loop if it ever fails #1400

Closed
ananace opened this issue Dec 7, 2023 · 3 comments · Fixed by #1409
Closed

K0s vcluster ends up in crash loop if it ever fails #1400

ananace opened this issue Dec 7, 2023 · 3 comments · Fixed by #1409
Assignees
Labels

Comments

@ananace
Copy link
Contributor

ananace commented Dec 7, 2023

What happened?

$ kubectl logs vcluster-0 
Defaulted container "syncer" out of: syncer, vcluster (init)
2023-12-07 15:33:42     INFO    setup/initialize.go:86  k0s config secret detected, syncer will ensure that it contains service CIDR    {"component": "vcluster"}
2023-12-07 15:33:42     INFO    k0s/k0s.go:58   Starting k0s    {"component": "vcluster", "args": "/k0s-binary/k0s controller --config=/etc/k0s/config.yaml --data-dir=/data/k0s --status-socket=/run/k0s/status.sock --disable-components=konnectivity-server,kube-scheduler,csr-approver,kube-proxy,coredns,network-provider,helm,metrics-server,kubelet-config"}
2023-12-07 15:33:43     INFO    setup/controller_context.go:221 couldn't retrieve virtual cluster version (Get "https://localhost:6443/version": dial tcp [::1]:6443: connect: connection refused), will retry in 1 seconds     {"component": "vcluster"}
2023-12-07 15:33:43     INFO    setup/controller_context.go:221 couldn't retrieve virtual cluster version (Get "https://localhost:6443/version": dial tcp [::1]:6443: connect: connection refused), will retry in 1 seconds     {"component": "vcluster"}
2023-12-07 15:33:44     INFO    loghelper/klog.go:24    Usage of deprecated component name      {"component": "vcluster", "component": "k0s", "time": "2023-12-07 15:33:44", "level": "warning"}
2023-12-07 15:33:44     INFO    loghelper/klog.go:24            {"component": "vcluster", "component": "k0s", "time": "2023-12-07 15:33:44", "level": "warning", "pre-flight-check": "os/NET", "property": "no kernel config found"}
2023-12-07 15:33:44     INFO    loghelper/klog.go:24    Error: failed to initialize runtime config: an instance of k0s is already running       {"component": "vcluster", "component": "k0s"}
2023-12-07 15:33:44     INFO    setup/controller_context.go:221 couldn't retrieve virtual cluster version (Get "https://localhost:6443/version": dial tcp [::1]:6443: connect: connection refused), will retry in 1 seconds     {"component": "vcluster"}
2023-12-07 15:33:44     INFO    setup/initialize.go:107 Error running k0s: exit status 1        {"component": "vcluster"}

You probably want to remove an existing k0s socket if one exists when starting.

What did you expect to happen?

An error should not leave the vcluster in a crash loop

How can we reproduce it (as minimally and precisely as possible)?

Run a 0.18.0 k0s vcluster, crash the cluster somehow

Anything else we need to know?

No response

Host cluster Kubernetes version

$ kubectl version
Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.25.11

Host cluster Kubernetes distribution

Bare-metal plain Kubernetes install

vlcuster version

$ vcluster --version
vcluster version 0.18.0

Vcluster Kubernetes distribution(k3s(default)), k8s, k0s)

k0s

OS and Arch

OS: Red Hat Enterprise Linux release 8.9 (Ootpa)
Arch: amd64
@FabianKramm
Copy link
Member

@ananace thanks a lot for creating this issue! We will take a look!

@ishankhare07 ishankhare07 self-assigned this Dec 11, 2023
@ananace
Copy link
Contributor Author

ananace commented Dec 11, 2023

As a temporary workaround - to keep our vclusters functioning - I've been patching the statefulset with;

containers:
  - name: syncer
    command:
      - /bin/sh
      - -c
      - |
        rm -rf /run/k0s/*
        /vcluster start $@

@FabianKramm
Copy link
Member

@ananace thanks for the workaround we have a fix on the way!

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