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

Cannot use ipv6 literal as system-default-registry #9924

Closed
brandond opened this issue Apr 11, 2024 · 2 comments
Closed

Cannot use ipv6 literal as system-default-registry #9924

brandond opened this issue Apr 11, 2024 · 2 comments
Assignees
Milestone

Comments

@brandond
Copy link
Member

brandond commented Apr 11, 2024

Environmental Info:
K3s Version: v1.29.3+k3s1

Node(s) CPU architecture, OS, and Version:
n/a

Cluster Configuration:
n/a

Describe the bug:
Cannot use ipv6 literal as system-default-registry

Steps To Reproduce:
start k3s with ipv6 address as system-default-registry, for example:
k3s server --system-default-registry=[fd7c:53a5:aef5::242:ac11:7]

Expected behavior:
works

Actual behavior:
Errors in logs due to image name in pod spec not being quoted:
I0411 08:38:18.324145 54 event.go:376] "Event occurred" object="kube-system/coredns" fieldPath="" kind="Addon" apiVersion="k3s.cattle.io/v1" type="Warning" reason="ParseManifestFailed" message="Parse manifest at \"/var/lib/rancher/k3s/server/manifests/coredns.yaml\" failed: yaml: line 44: did not find expected key"

root@k3s-server-1:/# grep image: /var/lib/rancher/k3s/server/manifests/coredns.yaml
        image: [fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-coredns-coredns:1.10.1

The image value should be quoted, otherwise the square brackets are invalid yaml.

Additional context / logs:

@brandond brandond self-assigned this Apr 11, 2024
@brandond brandond added this to the v1.29.4+k3s1 milestone Apr 11, 2024
@brandond
Copy link
Member Author

I need this for testing IPv6-only clusters, as I don't have external ipv6 connectivity in my environment :/

@aganesh-suse
Copy link

aganesh-suse commented Apr 16, 2024

Validated on master branch with commit 06b6444

Environment Details

Infrastructure

  • Cloud
  • Hosted

Node(s) CPU architecture, OS, and Version:

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"

$ uname -m
x86_64

Cluster Configuration:

HA: 3 server/ 1 agent

Config.yaml:

token: xxxx
cluster-init: true
system-default-registry: "[fd7c:53a5:aef5::242:ac11:7]"
write-kubeconfig-mode: "0644"
node-external-ip: 1.1.1.1
node-label:
- k3s-upgrade=server

Testing Steps

  1. Copy config.yaml
$ sudo mkdir -p /etc/rancher/k3s && sudo cp config.yaml /etc/rancher/k3s
  1. Install k3s
curl -sfL https://get.k3s.io | sudo INSTALL_K3S_COMMIT='06b6444904294c415b314c78c41cf424e7e749d6' sh -s - server
  1. Check the image is with double quotes for ipv6 in all yaml files and that there are no parse manifest errors:
$ sudo journalctl -xeu k3s | grep coredns | grep ParseManifestFailed
$ sudo grep image: /var/lib/rancher/k3s/server/manifests/coredns.yaml
$ sudo grep -rni image: /var/lib/rancher/k3s/server/manifests

Replication Results:

  • k3s version used for replication:
$ k3s -v
k3s version v1.29.3+k3s1 (8aecc26b)
go version go1.21.8
 $ sudo journalctl -xeu k3s | grep coredns | grep ParseManifestFailed 
Apr 16 19:34:41 ip-172-31-21-32 k3s[66038]: I0416 19:34:41.361395   66038 event.go:376] "Event occurred" object="kube-system/coredns" fieldPath="" kind="Addon" apiVersion="k3s.cattle.io/v1" type="Warning" reason="ParseManifestFailed" message="Parse manifest at \"/var/lib/rancher/k3s/server/manifests/coredns.yaml\" failed: yaml: line 44: did not find expected key"
 $ sudo grep image: /var/lib/rancher/k3s/server/manifests/coredns.yaml 
        image: [fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-coredns-coredns:1.10.1
 $ sudo grep -rni image: /var/lib/rancher/k3s/server/manifests
/var/lib/rancher/k3s/server/manifests/metrics-server/metrics-server-deployment.yaml:47:        image: [fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-metrics-server:v0.7.0
/var/lib/rancher/k3s/server/manifests/local-storage.yaml:70:        image: [fd7c:53a5:aef5::242:ac11:7]/rancher/local-path-provisioner:v0.0.26
/var/lib/rancher/k3s/server/manifests/local-storage.yaml:158:        image: [fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-library-busybox:1.36.1
/var/lib/rancher/k3s/server/manifests/traefik.yaml:28:    image:
/var/lib/rancher/k3s/server/manifests/coredns.yaml:123:        image: [fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-coredns-coredns:1.10.1

Validation Results:

  • k3s version used for validation:
$ k3s -v
k3s version v1.29.3+k3s-06b64449 (06b64449)
go version go1.21.8
$ sudo journalctl -xeu k3s | grep coredns | grep ParseManifestFailed
 $ sudo grep image: /var/lib/rancher/k3s/server/manifests/coredns.yaml
        image: "[fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-coredns-coredns:1.10.1"
 $ sudo grep -rni image: /var/lib/rancher/k3s/server/manifests
/var/lib/rancher/k3s/server/manifests/metrics-server/metrics-server-deployment.yaml:47:        image: "[fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-metrics-server:v0.7.0"
/var/lib/rancher/k3s/server/manifests/local-storage.yaml:70:        image: "[fd7c:53a5:aef5::242:ac11:7]/rancher/local-path-provisioner:v0.0.26"
/var/lib/rancher/k3s/server/manifests/local-storage.yaml:159:        image: "[fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-library-busybox:1.36.1"
/var/lib/rancher/k3s/server/manifests/traefik.yaml:29:    image:
/var/lib/rancher/k3s/server/manifests/coredns.yaml:123:        image: "[fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-coredns-coredns:1.10.1"

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

No branches or pull requests

2 participants