Repository navigation
Description
General:
- [ yes] Have you removed all sensitive information, including but not limited to access keys and passwords?
- [ yes] Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?
This is a follow up to this earlier ticket: #250
Even though the earlier ticket is resolved, the CCM is still not publishing an external IP that can be used by an Ingress Nginx Controller. Here's my question:
I am trying to get ingress-nginx-controller to work in an unmanaged kubernetes system. I followed these guides:
https://www.linode.com/docs/guides/deploy-kubernetes-cluster-using-kubeadm/
https://github.com/linode/linode-cloud-controller-manager?tab=readme-ov-file#to-deploy-ccm-linode-run-the-following-command
https://www.linode.com/docs/guides/deploy-nginx-ingress-on-lke/
But the end result is always this:
$ kubectl logs ccm-linode-9s4fz -n kube-system
E1205 04:09:27.805891 1 controller.go:298] error processing service default/ingress-nginx-controller (retrying with exponential backoff): failed to ensure load balancer: [400] [configs[0].nodes[0].address] Must be in address:port format; [configs[1].nodes[0].address] Must be in address:port format
I1205 04:09:27.806132 1 event.go:376] "Event occurred" object="default/ingress-nginx-controller" fieldPath="" kind="Service" apiVersion="v1" type="Warning" reason="SyncLoadBalancerFailed" message="Error syncing load balancer: failed to ensure load balancer: [400] [configs[0].nodes[0].address] Must be in address:port format; [configs[1].nodes[0].address] Must be in address:port format"
$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-one ClusterIP 10.100.159.160 <none> 80/TCP 8m37s
hello-two ClusterIP 10.101.70.107 <none> 80/TCP 8m37s
ingress-nginx-controller LoadBalancer 10.106.208.134 <pending> 80:32595/TCP,443:30397/TCP 10m
ingress-nginx-controller-admission ClusterIP 10.107.157.208 <none> 443/TCP 10m
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 16m
Notice the ccm-linode-9s4fz gives an error. And my ingress-nginx-controller EXTERNAL-IP is always stuck in <pending>.
I made an 8 minute video showing and explaining step by step what I was doing:
To summarize what I did in the video, i performed these steps: (all *.sh files are attached here as *.txt files, so you can rename the extensions)
- Create 2 new linodes with Ubuntu 22.04 (i also tried Ubuntu 24.04 and it gave the same issue). I called them
kube1andkube2. - I ran the file
./install-k8-and-start.shon kube1 (for this *.sh, replace the IPs on line 6 with your machine IPs) - I ran the file
./install-k8.shon kube2 (for this *.sh, replace the IPs on line 6 with your machine IPs). - Make kube2 join kube1.
- I set the
--cloud-provider=externaland did asystemctl restart kubeleton both kube1 and kube2. - I ran
./install-helm-and-ccm.shon kube1. (make sure to replace the api token and region with yours) - I ran
helm install ingress-nginx ingress-nginx/ingress-nginx;on kube1.
Then I get the issues above where the ccm-linode-9s4fz pod gives an error, and the ingress-nginx-controller never gets an IP address.
EXPECTED BEHAVIOUR
the ingress-nginx-controller should get an external ip
install-helm-and-ccm.txt
install-k8.txt
install-k8-and-start.txt
Environment Specifications
Ubuntu 22.04 and Ubuntu 24.04
Activity
rahulait commentedon Dec 5, 2024
Hi @johnlai2004 , it looks like you are not using LKE and are trying to setup k8s on linode VMs. One of the requirements for using CCM with nodebalancers (k8s loadbalancers) is to have linode specific private ip assigned to the linode. The guide referenced is for LKE specifically which has the private subnet. Not sure if you have 192.168.XX subnet assigned to your linodes. We plan to deprecate this in future, but for now its a requirement. This option is available when a linode is getting provisioned for the first time, there is an option to assign private ip to it (create linode -> Add ons (private ip)). This private ip is used by CCM to configure backends in linode specific nodebalancer when its created. Can you try provisioning a linode with private ip selected as well and then installing kubeadm and CCM. Make sure once the linode comes up for the first time, it has both public and private ip's set on eth0.
I'll open a documentation ticket to add this requirement in the CCM install on unmanaged k8s clusters for using nodebalancers.
johnlai2004 commentedon Dec 5, 2024
Yes! This worked! So basically I only made 3 changes to my instructions:
/etc/hostsfile of each vm, I make sure there's an entry with the private IP (eg. 192.168.133.25 kube1, 192.168.133.2 kube2 etc...)sudo kubeadm init --pod-network-cidr=192.168.133.0/16 --cri-socket=unix:///var/run/cri-dockerd.sock;----> note the 192.168.133.0 is the subnet information based on the private ips given in steps 1 and 2@rahulait - you said you are deprecating "this" feature in the future. Can you clarify what "this" refers to?
I plan to create unmanaged K8 clusters with linode in the future, and i want to be able to use ingress-nginx. Will this still be possible in the future?
rahulait commentedon Dec 6, 2024
We plan to deprecate use of private ips as we move towards VPCs. Its not official if and when it will be deprecated, but might happen in few years as nodebalancer support without private ips is released.
Instead of manually setting up everything from scratch, another option you can look at is Cluster API Provider Linode (CAPL). It supports deploying unmanaged kubeadm, rke2 or k3s clusters on linode. Only requirement is to learn using cluster-api and have a management cluster deployed somewhere (laptop, remote VM, etc) which can then spin up and manage child k8s clusters on linode.