Skip to content

Sign in

Sign up

https://github.com/k3d-io/k3d/issues/186

[HELP] changing service-node-port-range from default brings cluster in “stopped” state #186

Closed

vldvasi opened this issue Feb 7, 2020 · 3 comments

Closed

[HELP] changing service-node-port-range from default brings cluster in “stopped” state #186

vldvasi opened this issue Feb 7, 2020 · 3 comments

Comments

](https://github.com/vldvasi)

###

vldvasi commented Feb 7, 2020

edited

What did you do?
Created a k3d single nod cluster with altered node port ranges using the --server-arg option. Cluster was created successfully but it has a STOPPED state and cannot start it again.

  • How was the cluster created?
k3d create --server-arg --kube-apiserver-arg --server-arg --service-node-port-range=20618-20828
INFO[0000] Created cluster network with ID 351307df750188ad375f206da13ed63a02f2823e45ab057d4454583a3fc1dc88 
INFO[0000] Created docker volume  k3d-k3s-default-images 
INFO[0000] Creating cluster [k3s-default]               
INFO[0000] Creating server using docker.io/rancher/k3s:v1.17.2-k3s1... 
INFO[0000] Using registries definitions from "/home/vasilevlad/.k3d/registries.yaml"... 
INFO[0000] SUCCESS: created cluster [k3s-default]       
INFO[0000] You can now use the cluster with:

export KUBECONFIG="$(k3d get-kubeconfig --name='k3s-default')"
kubectl cluster-info 
  • What did you do afterwards?
    • k3d commands?
       export KUBECONFIG="$(k3d get-kubeconfig --name='k3s-default')"
       k3d l
       k3d start
       k3d delete
       k3d create --server-arg --kube-apiserver-arg --server-arg --service-node-port-range --server-arg 20618-20828  <--same STOPPED state
       k3d create --server-arg --kube-apiserver-arg --server-arg --service-node-port-range="20618-20828"   <--same STOPPED state
      
    • docker commands?
docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
96623dc797b7        registry:2          "/entrypoint.sh /etc…"   4 hours ago         Up 4 hours          0.0.0.0:5000->5000/tcp   registry.local
- OS operations (e.g. shutdown/reboot)?
 
  Rebooted the host, no change.

What did you expect to happen?
Have a running cluster with service nodeport range 20618-20828.

Screenshots or terminal output
image

Which OS & Architecture?

  • Ubuntu 18.04.4

Which version of k3d?

  • output of k3d --version
    k3d version v1.6.0

Which version of docker?

  • output of docker version
Client:
Version:           18.09.7
API version:       1.39
Go version:        go1.10.1
Git commit:        2d0083d
Built:             Fri Aug 16 14:20:06 2019
OS/Arch:           linux/amd64
Experimental:      false

Server:
 Engine:
  Version:          18.09.7
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.1
  Git commit:       2d0083d
  Built:            Wed Aug 14 19:41:23 2019
  OS/Arch:          linux/amd64
  Experimental:     false

](https://github.com/vldvasi) vldvasi added the bug label Feb 7, 2020

](https://github.com/iwilltry42)

Member

###

iwilltry42 commented Feb 10, 2020

Hi @vldvasi , thanks for opening this issue.
Fortunately, this is not a bug, but rather a misunderstanding in how the flags are being used.
With the command line that you used, you’ll get the following error log (see docker logs k3d-k3s-default-server): apiserver exited: bad flag syntax: ----service-node-port-range=20618-20828
-> --server-arg is a k3d flag which passes the parameter to the k3s server, so --kube-apiserver-arg='service-node-port-range=20618-20828' would be a single parameter for it to work.

Here’s the command line that works: k3d create --server-arg --kube-apiserver-arg='service-node-port-range=20618-20828'

](https://github.com/iwilltry42) iwilltry42 self-assigned this Feb 10, 2020

](https://github.com/iwilltry42)iwilltry42 added help not a bug labels Feb 10, 2020

](https://github.com/iwilltry42)iwilltry42 changed the title [BUG] changing service-node-port-range from default brings cluster in “stopped” state [HELP] changing service-node-port-range from default brings cluster in “stopped” state Feb 10, 2020

](https://github.com/vldvasi)

Author

###

vldvasi commented Feb 10, 2020

Thanks a million @iwilltry42, I confirm its working also if I found that if I pass parameters as below seem to be working:
k3d create --server-arg --kube-apiserver-arg --server-arg service-node-port-range=20618-20828

](https://github.com/vldvasi) vldvasi closed this as completed Feb 10, 2020

](https://github.com/iwilltry42)

Member

###

iwilltry42 commented Feb 10, 2020

Makes sense, since they’re just appended in k3d and passed on to k3s. It’s k3s that assumes that you’re not passing in the leading -- for flags passed on to the API-Server (same for kubelet, etc.).
Glad that it works now for you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Assignees

](https://github.com/iwilltry42)iwilltry42

Labels

bug help not a bug

Projects

None yet

Milestone

No milestone

Development

No branches or pull requests

2 participants

](https://github.com/iwilltry42)](https://github.com/vldvasi)

© 2024 GitHub, Inc.

Updated: