Skip to content

[BUG] No way to customize the cluster IP CIDR #707

@baprx

Description

@baprx

Describe the bug
The cluster struct has ClusterCidr field which cannot be provided from the command line:

❯ autok3s -d create \
    --provider native \
    --name k3s\
    --ssh-user ubuntu \
    --ssh-key-path ./infrastructure/oci/autok3s/id_ed25519 \
    --master-ips 10.0.1.201 \
    --server-config-file ./infrastructure/oci/autok3s/config.yml \
    --cluster-cidr 10.10.0.0/16 \
    --cluster
Error: unknown flag: --cluster-cidr

Since the value stays empty, the default CIDR is provided to the installation script:

if cluster.ClusterCidr != "" {
runArgs = append(runArgs, "--cluster-cidr="+cluster.ClusterCidr)
}

Even if we pass this flag using --master-extra-args '--cluster-cidr 10.10.0.0/16', the result is a duplicated entry in the env var: INSTALL_K3S_EXEC='server --advertise-address=10.0.1.201 --cluster-cidr=10.42.0.0/16 --cluster-init --node-external-ip=10.0.1.201 --tls-san=10.0.1.201 --cluster-cidr 10.10.0.0/16' leading to a k3s misconfiguration.

Expected behavior
A way to provide the cluster IP address (either from server-config-file or directly as an auto-k3s flag).

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentationto testNeed to test

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions