how to delete/remove calico cni from my kubernetes cluster

12/4/2018

I have installed my kubernetes cluster(1master, 3worker)in the digital ocean.
The problem is I installed both flannel and calico in this cluster.
I want to remove the calico completely from my cluster or is it ok to have multiple CNI?

-- AATHITH RAJENDRAN
calico
digital-ocean
flannel
kubernetes

2 Answers

12/4/2018

Use following two commands to remove calico from your node:

kubectl delete -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
kubectl delete -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml
-- Prafull Ladha
Source: StackOverflow

12/4/2018

You should add these

https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml

and

https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml

to your ansible playbook file state as "absent" then when you run ansible playbook file i.e as below.

- name: Delete Calico (rbac-kdd.yaml) from cluster
  kubernetes:
    api_endpoint: 123.45.67.89
    insecure: true
    file_reference: /path/to/rbac-kdd.yaml
    state: absent

- name: Delete Calico (calico.yaml) from cluster
  kubernetes:
    api_endpoint: 123.45.67.89
    insecure: true
    file_reference: /path/to/calico.yaml
    state: absent

Please check your ansible playbook file for cluster installation and change/modify values according your needs.

For more details kubernetes with ansible you can see this: https://docs.ansible.com/ansible/2.5/modules/kubernetes_module.html

I hope it will be helpful for you

-- coolinuxoid
Source: StackOverflow