sandervanvugt / cka

394 stars 510 forks source link

Issue with cluster installation #17

Closed lovemasta41 closed 1 year ago

lovemasta41 commented 1 year ago

Hi Sander,

I was highly motivated to learn k8s from your course. I have 3 Ubuntu 22.04 instances running in AWS EC2 out of which on one of them I followed the steps mentioned in your course to set as control plane.

I used both the .sh files to install container runtime and Kube tools. After that I used sudo kubeadm init as mentioned in the video. Then performed steps to get cluster context. After that I simply did kubectl create -f cka/calico.yaml but my calico container is in crashloopbackoff state.

can you suggest if there are any changes I need to know to make it work ?

deepakjd2004 commented 1 year ago

I am also facing this issue.. Error is `2023-05-17T03:01:33.463004756Z stderr F 2023-05-17 03:01:33.462 [ERROR][1] cni-installer/ : Unable to create token for CNI kubeconfig error=serviceaccounts "calico-cni-plugin" is forbidden: User "system:serviceaccount:kube-system:calico-node" cannot create resource "serviceaccounts/token" in API group "" in the namespace "kube-system"

2023-05-17T03:01:33.463036966Z stderr F 2023-05-17 03:01:33.462 [FATAL][1] cni-installer/ : Unable to create token for CNI kubeconfig error=serviceaccounts "calico-cni-plugin" is forbidden: User "system:serviceaccount:kube-system:calico-node" cannot create resource "serviceaccounts/token" in API group "" in the namespace "kube-system"`

lovemasta41 commented 1 year ago

My issue has been resolved by using pod network cidr while initialising and updated same cidr in custom-resources.yml while adding network add-on. Now I’m able to join the nodes as well just make sure nodes are able to reach each other over network on 6443 port.

mihabez commented 1 year ago

Hi @lovemasta41 can you please share the solution? I have the same issue as you. Running Ubuntu 22.04 LTS on Virtualbox. Same issue on older Ubuntu 20.04 LTS

image

lovemasta41 commented 1 year ago

@mihabez : follow below steps :-

  1. curl https://raw.githubusercontent.com/projectcalico/calico/v3.25.1/manifests/custom-resources.yaml -o custom-resources.yaml - ON CONTROL NODE
  2. In downloaded custom-resources.yaml , replace cidr: 192.168.0.0/16 with cidr: 10.10.0.0/16 or something of your choice.
  3. kubectl create -f custom-resources.yaml
starlocke commented 1 year ago

The README.md file was updated with this helpful note just 3 days ago:

JUNE 2023 NOTE: The Calico network plugin has been changing a lot lately. I recommend using the following command to install it:

kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/calico.yaml

The videos aren't likely to have been updated yet as of this writing.

In summary:

  1. Video will instruct:
    • sudo kubeadm init + (the 3 extra commands to set up kubectl authentication)
  2. Instead of doing what the video suggests for installing Calico, do the new advice from the README:
    • kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/calico.yaml
  3. With Calico thus installed, the, coredns replicas will follow, going through their "ContainerCreating" and eventually hit their "Running" states.
    • kubectl get all -A was helpful for me to watch the life stages changing and becoming ready.