Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14408 +/- ##
============================================
+ Coverage 20.92% 20.93% +0.01%
- Complexity 21142 21154 +12
============================================
Files 6057 6057
Lines 549556 549559 +3
Branches 73477 73477
============================================
+ Hits 114991 115052 +61
+ Misses 421116 421057 -59
- Partials 13449 13450 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pearl1594
left a comment
There was a problem hiding this comment.
code lgtm - havent tested this.
|
Tested this on a KVM lab with a private registry set. The control node came up with no SSH key and no Kubernetes: cloud-init dropped the whole cloud-config. Cause: cloud-init renders the template with The indent was already there on main, but the block never rendered ( Fix: put both tags at column 0 in {% if "{{ registry.enabled }}" == "true" %}
- path: /opt/bin/setup-containerd
...
{% endif %}With that change the rendered cloud-config parses again. Update: re-tested with the fix: the registry cluster reaches Running, containerd uses the registry as mirror on every node, and all images are pulled through it. A unit test that renders the template the way cloud-init does (trim_blocks) and parses the result as YAML would catch this. Smaller things in the same code path. They're older than this PR, so they may be better as follow-ups:
|
Fixes #11596
With a private registry set, a new CKS cluster stays in Starting. The control node setup script for the registry is wrapped in
{% if registry is defined %}, butregistryis never a cloud-init variable. The server fills in the registry details as plain text, so the check is never true and the script is never written. The server still swaps the line that writes the containerd config for a call to that script, so containerd keeps its default config with the image service off and kubeadm never runs. This keeps the jinja header and changes the check to{% if "{{ registry.enabled }}" == "true" %}, and the server fills in true or false when it builds the user data.Test:
Added unit tests for a cluster with and without a registry. The lab run below was on the first commit.
On a KVM lab with 2 hosts and
cloud.kubernetes.cluster.experimental.features.enabled=true, create a CKS cluster (v1.36.0, 1 control node, 1 worker) withdockerregistryurl=https://index.docker.io/v1/and a registry username and password.Before: the cluster stays in Starting. On the control node:
After: the cluster goes to Running and both nodes are Ready. On the control node: