[BUG] Config file schema does not allow opening multiple ports
bug
## What did you do
I created a cluster with the following config file (_config.yaml_). Notice the multiple port definitions at the bottom:
```
apiVersion: k3d.io/v1alpha5
kind: Simple
volumes:
- volume: $HOME/k3d-containerd:/var/lib/rancher/k3s/agent/containerd/
nodeFilters:
- server:0
registries:
create:
image: ligfx/k3d-registry-dockerd:v0.8
proxy:
remoteURL: "*"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
options:
k3s:
extraArgs:
- arg: --disable=helm-controller
nodeFilters:
- server:*
- arg: --disable=traefik
nodeFilters:
- server:*
runtime:
ulimits:
- name: nofile
soft: 1048576
hard: 1048576
ports:
- port: 80:80
nodeFilters:
- loadbalancer
- port: 443:443
nodesFilters:
- loadbalancer
- port: 8080:80
nodeFilters:
- loadbalancer
```
This results in error:
```
k3d cluster create demo-cluster --config=config.yaml
FATA[0000] Schema Validation failed for config file config.yaml: - ports.1: Additional property nodesFilters is not allowed
```
## What did you expect to happen
I expected that a cluster would be created where the loadbalancer exposes ports 80, 443 and 8080 on the host machine. When I remove the `ports:` section from _config.yaml_ and save the file as _config-minus-ports.yaml_ and expose the ports via cli parameter the cluster is created as expected:
```
k3d cluster create demo-cluster -p "80:80@loadbalancer" -p "443:443@loadbalancer" -p "8080:80@loadbalancer" --config=config-minus-ports.yaml
```
results in docker container:
```
#> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5d6101fb8c2f ghcr.io/k3d-io/k3d-proxy:5.8.3 "/bin/sh -c nginx-pr…" 22 seconds ago Up 18 seconds 0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp, 0.0.0.0:8080->80/tcp, [::]:8080->80/tcp, 0.0.0.0:35057->6443/tcp k3d-demo-cluster-serverlb
```
## Screenshots or terminal output
See above:
## Which OS & Architecture
```
#> k3d runtime-info
arch: x86_64
cgroupdriver: systemd
cgroupversion: "2"
endpoint: /var/run/docker.sock
filesystem: UNKNOWN
infoname: pnp300-ThinkPad-X1-Carbon-Gen-11
name: docker
os: Ubuntu 24.04.3 LTS
ostype: linux
version: 28.3.3
```
## Which version of `k3d`
Problem exists in `v5.8.3` and `v5.9.0-rc.0`.
```
docker version
Client: Docker Engine - Community
Version: 28.3.3
API version: 1.51
Go version: go1.24.5
Git commit: 980b856
Built: Fri Jul 25 11:34:09 2025
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 28.3.3
API version: 1.51 (minimum version 1.24)
Go version: go1.24.5
Git commit: bea959c
Built: Fri Jul 25 11:34:09 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.27
GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da
runc:
Version: 1.2.5
GitCommit: v1.2.5-0-g59923ef
docker-init:
Version: 0.19.0
GitCommit: de40ad0
```
```
#> docker version
Client: Docker Engine - Community
Version: 28.3.3
API version: 1.51
Go version: go1.24.5
Git commit: 980b856
Built: Fri Jul 25 11:34:09 2025
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 28.3.3
API version: 1.51 (minimum version 1.24)
Go version: go1.24.5
Git commit: bea959c
Built: Fri Jul 25 11:34:09 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.27
GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da
runc:
Version: 1.2.5
GitCommit: v1.2.5-0-g59923ef
docker-init:
Version: 0.19.0
GitCommit: de40ad0
```
```
#> docker info
Client: Docker Engine - Community
Version: 28.3.3
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.26.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.39.1
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 12
Running: 3
Paused: 0
Stopped: 9
Images: 247
Server Version: 28.3.3
Storage Driver: overlayfs
driver-type: io.containerd.snapshotter.v1
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
runc version: v1.2.5-0-g59923ef
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.14.0-35-generic
Operating System: Ubuntu 24.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 20
Total Memory: 62.39GiB
Name: pnp300-ThinkPad-X1-Carbon-Gen-11
ID: 8e40279c-1b2d-4e32-9b14-47d10b5bedef
Docker Root Dir: /var/lib/docker
Debug Mode: false
Username: pvannierop
Experimental: false
Insecure Registries:
::1/128
127.0.0.0/8
Live Restore Enabled: false
```
0 条评论