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

[Bug]: k3s > 1.24.x will not start #6770

Closed
twuyts opened this issue Mar 9, 2023 · 4 comments · Fixed by #7677
Closed

[Bug]: k3s > 1.24.x will not start #6770

twuyts opened this issue Mar 9, 2023 · 4 comments · Fixed by #7677

Comments

@twuyts
Copy link

twuyts commented Mar 9, 2023

Module

K3S

Testcontainers version

1.17.6

Using the latest Testcontainers version?

Yes

Host OS

Ubuntu 20.04 on WSL2 on Windows 11

Host Arch

x86

Docker version

Client:
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.2
 Git commit:        20.10.12-0ubuntu2~20.04.1
 Built:             Wed Apr  6 02:14:38 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Desktop
 Engine:
  Version:          20.10.23
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.10
  Git commit:       6051f14
  Built:            Thu Jan 19 17:32:04 2023
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.6.18
  GitCommit:        2456e983eb9e37e47538f59ea18f2043c9a73640
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

What happened?

k3s testcontainer will not start. Log message:
for k3s 1.25.x

no-deploy flag is deprecated. Use --disable instead.

for k3s 1.26.x

flag provided but not defined: -no-deploy

I traced it back to this line

setCommand("server", "--no-deploy=traefik", "--tls-san=" + this.getHost());

see also https://docs.k3s.io/reference/server-config#deprecated-options

Workaround is to use k3s<=1.24.x

Relevant log output

No response

Additional Information

No response

@twuyts twuyts added the type/bug label Mar 9, 2023
@twuyts twuyts changed the title [Bug]: k3s >= 1.24.x will not start [Bug]: k3s > 1.24.x will not start Mar 9, 2023
@vcvitaly
Copy link
Contributor

vcvitaly commented Apr 4, 2023

It seems to be a matter of starting a container with another flag as per this docs page:
https://docs.k3s.io/faq#how-can-i-use-my-own-ingress-instead-of-traefik

@eddumelendez
Copy link
Member

Overriding withCommand should fix it. Still not sure how to fix it, we can use ComparableVersion but we can reach out the point of abusing of it at certain point.

@deftfitf
Copy link

In my case, it worked with withCommand as follows.

DockerImageName
    .parse("rancher/k3s:v1.25.10-k3s1"))
    .withLogConsumer(Slf4jLogConsumer(logger))
    .withCommand(
        "server",
        "--disable=traefik",
        "--tls-san=${DockerClientFactory.instance().dockerHostIpAddress()}")

@tgeens
Copy link
Contributor

tgeens commented Oct 16, 2023

The flag --no-deploy was deprecated and replaced by --disable, many years ago (somewhere in k3s:v1.17.x ?).
The flag was finally removed in v1.25.0, more than a year ago.

https://docs.k3s.io/cli/server#deprecated-options

That means this module is broken out of the box for more than a year.

Switching to the --disable flag is the less surprising thing to do: it works from the current k3s:v1.25.14 and all the way back to k3s:v1.17.17 (from 3 years ago).

eddumelendez added a commit that referenced this issue Oct 24, 2023
Replace `--no-deploy` and use `--disable` instead.

Fixes #6770

---------

Co-authored-by: Eddú Meléndez <eddu.melendez@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants