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

Autodetect K3s cluster flavor #773

Merged
merged 2 commits into from
Apr 2, 2022
Merged

Autodetect K3s cluster flavor #773

merged 2 commits into from
Apr 2, 2022

Conversation

tklauser
Copy link
Member

The first commit removes an unnecessary always-nil error return when auto-detecting the cluster flavor. The second commit add support for auto-detecting K3s clusters. Example cilium install output:

$ cilium install
🔮 Auto-detected Kubernetes kind: K3s
ℹ️  using Cilium version "v1.11.2"
🔮 Auto-detected cluster name: default
🔮 Auto-detected IPAM mode: cluster-pool
ℹ️  helm template --namespace kube-system cilium cilium/cilium --version 1.11.2 --set cluster.name=default,ipam.mode=cluster-pool,kubeProxyReplacement=disabled,operator.replicas=1,serviceAccounts.cilium.name=cilium,serviceAccounts.operator.name=cilium-operator
🔑 Created CA in secret cilium-ca
🔑 Generating certificates for Hubble...
🚀 Creating Service accounts...
🚀 Creating Cluster roles...
🚀 Creating ConfigMap for Cilium version 1.11.2...
🚀 Creating Agent DaemonSet...
level=warning msg="spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[1].matchExpressions[0].key: beta.kubernetes.io/os is deprecated since v1.14; use \"kubernetes.io/os\" instead" subsys=klog
level=warning msg="spec.template.metadata.annotations[scheduler.alpha.kubernetes.io/critical-pod]: non-functional in v1.16+; use the \"priorityClassName\" field instead" subsys=klog
🚀 Creating Operator Deployment...
⌛ Waiting for Cilium to be installed and ready...
♻️  Restarting unmanaged pods...
♻️  Restarted unmanaged pod kube-system/helm-install-traefik-crd--1-gxtmd
♻️  Restarted unmanaged pod kube-system/helm-install-traefik--1-j9pr6
♻️  Restarted unmanaged pod kube-system/local-path-provisioner-84bb864455-v4z6f
♻️  Restarted unmanaged pod kube-system/metrics-server-ff9dbcb6c-6stf6
♻️  Restarted unmanaged pod kube-system/coredns-96cc4f57d-f7kcl
✅ Cilium was successfully installed! Run 'cilium status' to view installation health

@tklauser tklauser requested a review from a team March 30, 2022 12:43
@tklauser tklauser requested review from a team as code owners March 30, 2022 12:43
@tklauser tklauser requested review from sayboras and ldelossa March 30, 2022 12:43
@tklauser tklauser temporarily deployed to ci March 30, 2022 12:43 Inactive
The underlying (c *Client).AutodetectFlavor function always returns a
nil error.

Signed-off-by: Tobias Klauser <[email protected]>
Example output:

[...]
🔮 Auto-detected Kubernetes kind: K3s
[...]

Signed-off-by: Tobias Klauser <[email protected]>
@tklauser tklauser temporarily deployed to ci March 30, 2022 15:00 Inactive
@tklauser tklauser temporarily deployed to ci March 30, 2022 19:57 Inactive
@tklauser tklauser temporarily deployed to ci March 30, 2022 20:06 Inactive
Copy link
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tklauser tklauser merged commit 084aa4c into master Apr 2, 2022
@tklauser tklauser deleted the pr/k3-autodetect branch April 2, 2022 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants