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

Add Calico CNI #469

Merged
merged 2 commits into from
Jun 6, 2024
Merged

Add Calico CNI #469

merged 2 commits into from
Jun 6, 2024

Conversation

bschimke95
Copy link
Contributor

@bschimke95 bschimke95 commented Jun 4, 2024

Adds the Calico helm chart and feature implementation. The current implementation of Gateway, Ingress and LB depend on Cilium, hence they are swapped out by a fake implementation for now.

CIDR assignment works as expected:

ubuntu@brisk-agouti:~/work/k8s-snap$ sudo k8s bootstrap --interactive
Which features would you like to enable? (network, dns, gateway, ingress, local-storage, load-balancer) [network, dns, gateway, local-storage]: 
Please set the Pod CIDR: [10.1.0.0/16]: 
Please set the Service CIDR: [10.152.183.0/24]: 

...
ubuntu@brisk-agouti:~/work/k8s-snap$ sudo k8s kubectl get pods -A -o wide
NAMESPACE          NAME                                       READY   STATUS    RESTARTS        AGE     IP             NODE           NOMINATED NODE   READINESS GATES
calico-apiserver   calico-apiserver-579db5845-2zht4           1/1     Running   0               7m27s   10.1.55.199    brisk-agouti   <none>           <none>
calico-apiserver   calico-apiserver-579db5845-7xcck           1/1     Running   0               7m27s   10.1.55.200    brisk-agouti   <none>           <none>
calico-system      calico-kube-controllers-5b47784fbb-cqpvr   1/1     Running   0               9m26s   10.1.55.197    brisk-agouti   <none>           <none>
calico-system      calico-node-nxmr7                          1/1     Running   0               9m26s   10.42.85.156   brisk-agouti   <none>           <none>
calico-system      calico-typha-74d789b777-kdqm6              1/1     Running   0               9m27s   10.42.85.156   brisk-agouti   <none>           <none>
calico-system      csi-node-driver-g7lhl                      2/2     Running   0               9m26s   10.1.55.195    brisk-agouti   <none>           <none>
kube-system        ck-storage-rawfile-csi-controller-0        2/2     Running   0               9m42s   10.1.55.194    brisk-agouti   <none>           <none>
kube-system        ck-storage-rawfile-csi-node-2rwwt          4/4     Running   0               9m42s   10.1.55.192    brisk-agouti   <none>           <none>
kube-system        coredns-7d4dffcffd-2txmx                   1/1     Running   0               9m42s   10.1.55.196    brisk-agouti   <none>           <none>
kube-system        metrics-server-6f66c6cc48-5wwrf            1/1     Running   1 (7m33s ago)   9m42s   10.1.55.193    brisk-agouti   <none>           <none>
kube-system        tigera-operator-76ff79f7fd-fkx6x           1/1     Running   0               9m42s   10.42.85.156   brisk-agouti   <none>           <none>

...
ubuntu@brisk-agouti:~/work/k8s-snap$ sudo k8s kubectl get services -A -o wide
NAMESPACE          NAME                                TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)         AGE     SELECTOR
calico-apiserver   calico-api                          ClusterIP   10.152.183.70    <none>        443/TCP         7m53s   apiserver=true
calico-system      calico-kube-controllers-metrics     ClusterIP   None             <none>        9094/TCP        8m4s    k8s-app=calico-kube-controllers
calico-system      calico-typha                        ClusterIP   10.152.183.29    <none>        5473/TCP        9m53s   k8s-app=calico-typha
default            kubernetes                          ClusterIP   10.152.183.1     <none>        443/TCP         10m     <none>
kube-system        ck-storage-rawfile-csi-controller   ClusterIP   None             <none>        <none>          10m     app.kubernetes.io/instance=ck-storage,app.kubernetes.io/name=rawfile-csi,component=controller
kube-system        ck-storage-rawfile-csi-node         ClusterIP   10.152.183.226   <none>        9100/TCP        10m     app.kubernetes.io/instance=ck-storage,app.kubernetes.io/name=rawfile-csi,component=node
kube-system        coredns                             ClusterIP   10.152.183.242   <none>        53/UDP,53/TCP   10m     app.kubernetes.io/instance=ck-dns,app.kubernetes.io/name=coredns,k8s-app=coredns
kube-system        metrics-server                      ClusterIP   10.152.183.91    <none>        443/TCP         10m     app.kubernetes.io/instance=metrics-server,app.kubernetes.io/name=metrics-server

Base automatically changed from KU-949/status-checks to main June 4, 2024 16:10
@bschimke95 bschimke95 marked this pull request as ready for review June 5, 2024 10:00
@bschimke95 bschimke95 requested a review from a team as a code owner June 5, 2024 10:00
Copy link
Member

@mateoflorido mateoflorido left a comment

Choose a reason for hiding this comment

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

Great work, Ben! I just have a question about the CheckNetwork function.

src/k8s/pkg/k8sd/features/calico/status.go Outdated Show resolved Hide resolved
@bschimke95 bschimke95 force-pushed the KU-972/calico-networking branch 3 times, most recently from 5b08693 to 9d313eb Compare June 5, 2024 12:49
Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

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

LGTM. I'm learning too. thanks @bschimke95

Copy link
Member

@mateoflorido mateoflorido left a comment

Choose a reason for hiding this comment

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

Great work, LGTM!

Copy link
Contributor

@louiseschmidtgen louiseschmidtgen left a comment

Choose a reason for hiding this comment

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

LGTM, I particularly like the CIDR getting moved to utils and the added test cases!

@bschimke95
Copy link
Contributor Author

Small update after approvals: I moved the deployment of the tigera-operator into its own namespace. We don't want the operator to have access to all resources in kube-system.
I did not use tigera-system as namespace name as the operator does not allow that:

2024/06/06 08:00:18 [ERROR] Operator must not be run within a Namespace managed by the operator, please select a different namespace
2024/06/06 08:00:18 [ERROR] The following namespaces cannot be used: [calico-system calico-apiserver tigera-system tigera-elasticsearch tigera-compliance tigera-intrusion-detection tigera-dpi tigera-eck-operator tigera-fluentd calico-system tigera-manager]

I promise, stuff still works!

ubuntu@brisk-agouti:~/work/k8s-snap$ sudo k8s kubectl get all -A
NAMESPACE          NAME                                           READY   STATUS    RESTARTS   AGE
calico-apiserver   pod/calico-apiserver-54d9bb8945-m9kmt          1/1     Running   0          14s
calico-apiserver   pod/calico-apiserver-54d9bb8945-n4sr4          1/1     Running   0          14s
calico-system      pod/calico-kube-controllers-6547988668-6sdkc   1/1     Running   0          89s
calico-system      pod/calico-node-xpffg                          1/1     Running   0          89s
calico-system      pod/calico-typha-798489df8c-cs8zz              1/1     Running   0          89s
calico-system      pod/csi-node-driver-rxhd2                      2/2     Running   0          89s
kube-system        pod/ck-storage-rawfile-csi-controller-0        2/2     Running   0          101s
kube-system        pod/ck-storage-rawfile-csi-node-bvn6v          4/4     Running   0          102s
kube-system        pod/coredns-7d4dffcffd-clfbz                   0/1     Running   0          100s
kube-system        pod/metrics-server-6f66c6cc48-nsrjt            1/1     Running   0          101s
tigera-operator    pod/tigera-operator-76ff79f7fd-s2szb           1/1     Running   0          101s

NAMESPACE          NAME                                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)         AGE
calico-apiserver   service/calico-api                          ClusterIP   10.152.183.124   <none>        443/TCP         15s
calico-system      service/calico-kube-controllers-metrics     ClusterIP   None             <none>        9094/TCP        35s
calico-system      service/calico-typha                        ClusterIP   10.152.183.127   <none>        5473/TCP        90s
default            service/kubernetes                          ClusterIP   10.152.183.1     <none>        443/TCP         110s
kube-system        service/ck-storage-rawfile-csi-controller   ClusterIP   None             <none>        <none>          108s
kube-system        service/ck-storage-rawfile-csi-node         ClusterIP   10.152.183.200   <none>        9100/TCP        108s
kube-system        service/coredns                             ClusterIP   10.152.183.36    <none>        53/UDP,53/TCP   109s
kube-system        service/metrics-server                      ClusterIP   10.152.183.126   <none>        443/TCP         109s

NAMESPACE       NAME                                         DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR            AGE
calico-system   daemonset.apps/calico-node                   1         1         1       1            1           kubernetes.io/os=linux   89s
calico-system   daemonset.apps/csi-node-driver               1         1         1       1            1           kubernetes.io/os=linux   89s
kube-system     daemonset.apps/ck-storage-rawfile-csi-node   1         1         1       1            1           <none>                   108s

NAMESPACE          NAME                                      READY   UP-TO-DATE   AVAILABLE   AGE
calico-apiserver   deployment.apps/calico-apiserver          2/2     2            2           15s
calico-system      deployment.apps/calico-kube-controllers   1/1     1            1           89s
calico-system      deployment.apps/calico-typha              1/1     1            1           89s
kube-system        deployment.apps/coredns                   0/1     1            0           109s
kube-system        deployment.apps/metrics-server            1/1     1            1           108s
tigera-operator    deployment.apps/tigera-operator           1/1     1            1           105s

NAMESPACE          NAME                                                 DESIRED   CURRENT   READY   AGE
calico-apiserver   replicaset.apps/calico-apiserver-54d9bb8945          2         2         2       15s
calico-system      replicaset.apps/calico-kube-controllers-6547988668   1         1         1       89s
calico-system      replicaset.apps/calico-typha-798489df8c              1         1         1       89s
kube-system        replicaset.apps/coredns-7d4dffcffd                   1         1         0       101s
kube-system        replicaset.apps/metrics-server-6f66c6cc48            1         1         1       101s
tigera-operator    replicaset.apps/tigera-operator-76ff79f7fd           1         1         1       101s

NAMESPACE     NAME                                                 READY   AGE
kube-system   statefulset.apps/ck-storage-rawfile-csi-controller   1/1     108s

@bschimke95 bschimke95 merged commit 15f64ea into main Jun 6, 2024
15 checks passed
@bschimke95 bschimke95 deleted the KU-972/calico-networking branch June 6, 2024 10:34
eaudetcobello pushed a commit that referenced this pull request Jun 6, 2024
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.

4 participants