I am trying to setup kubernetes master with ansible and one of the task showing . . .

Kalesha Gagguturu:
Actually when trying to create kube-flannel or weave networks we are getting rbac errors

resource mapping not found for name: "flannel" namespace: "" from "kube-flannel.yml": no matches for kind "ClusterRole" in version "<http://rbac.authorization.k8s.io/v1beta1|rbac.authorization.k8s.io/v1beta1>"
ensure CRDs are installed first
resource mapping not found for name: "flannel" namespace: "" from "kube-flannel.yml": no matches for kind "ClusterRoleBinding" in version "<http://rbac.authorization.k8s.io/v1beta1|rbac.authorization.k8s.io/v1beta1>"
ensure CRDs are installed first
resource mapping not found for name: "kube-flannel-ds-amd64" namespace: "kube-system" from "kube-flannel.yml": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first
resource mapping not found for name: "kube-flannel-ds-arm64" namespace: "kube-system" from "kube-flannel.yml": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first
resource mapping not found for name: "kube-flannel-ds-arm" namespace: "kube-system" from "kube-flannel.yml": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first
resource mapping not found for name: "kube-flannel-ds-ppc64le" namespace: "kube-system" from "kube-flannel.yml": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first
resource mapping not found for name: "kube-flannel-ds-s390x" namespace: "kube-system" from "kube-flannel.yml": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first

unnivkn:
Hi @Kalesha Gagguturu please try this: https://github.com/lima-vm/lima/issues/1034

Kalesha Gagguturu:
@unnivkn Thanks for your response
Actually there was issue with flannel yaml file which I was using https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml and https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml
Above both files didn’t work

I have used https://github.com/coreos/flannel/raw/master/Documentation/kube-flannel.yml file and it create the flannel network plugins

gkalesha@kubemaster[Sun Nov 27][07:06 PM]:~$sudo kubectl apply -f https://github.com/coreos/flannel/raw/master/Documentation/kube-flannel.yml

namespace/kube-flannel created
<http://clusterrole.rbac.authorization.k8s.io/flannel|clusterrole.rbac.authorization.k8s.io/flannel> created
<http://clusterrolebinding.rbac.authorization.k8s.io/flannel|clusterrolebinding.rbac.authorization.k8s.io/flannel> created
serviceaccount/flannel created
configmap/kube-flannel-cfg created
daemonset.apps/kube-flannel-ds created

Now cluster status showing as Ready, but coreDNS Pods are showing as creating from past 15 minutes and I can not see flannel pods also

gkalesha@kubemaster[Sun Nov 27][07:25 PM]:~$k get no
NAME         STATUS   ROLES           AGE     VERSION
kubemaster   Ready    control-plane   2d17h   v1.25.0
kubenode1    Ready    &lt;none&gt;          2d17h   v1.25.0
kubenode2    Ready    &lt;none&gt;          2d17h   v1.25.0
gkalesha@kubemaster[Sun Nov 27][07:29 PM]:~$k -n kube-system get po
NAME                                 READY   STATUS              RESTARTS      AGE
coredns-565d847f94-b84g4             0/1     ContainerCreating   0             2d17h
coredns-565d847f94-c92zm             0/1     ContainerCreating   0             2d17h
etcd-kubemaster                      1/1     Running             3 (14m ago)   2d17h
kube-apiserver-kubemaster            1/1     Running             3 (14m ago)   2d17h
kube-controller-manager-kubemaster   1/1     Running             3 (14m ago)   2d17h
kube-proxy-h48gq                     1/1     Running             2 (93m ago)   2d17h
kube-proxy-s7b6n                     1/1     Running             2 (94m ago)   2d17h
kube-proxy-wt982                     1/1     Running             3 (14m ago)   2d17h
kube-scheduler-kubemaster            1/1     Running             3 (14m ago)   2d17h

unnivkn:
since network CNI, is not present coredns is failing… once CNI is successfully installed DNS pod will come up.

Kalesha Gagguturu:
How to setup CNI?

unnivkn:
CNI is nothing but weave, flannel, calico etc.
https://kubernetes.io/fr/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#pod-network

Kalesha Gagguturu:
I have already used flannel, so we should use flannel cni configuration only right

Kalesha Gagguturu:
As per this document if i follow for flannel
I am getting below error

gkalesha@kubemaster[Sun Nov 27][07:36 PM]:~$sudo kubectl apply -f <https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml>
serviceaccount/flannel unchanged
configmap/kube-flannel-cfg unchanged
resource mapping not found for name: "flannel" namespace: "" from "<https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml>": no matches for kind "ClusterRole" in version "<http://rbac.authorization.k8s.io/v1beta1|rbac.authorization.k8s.io/v1beta1>"
ensure CRDs are installed first
resource mapping not found for name: "flannel" namespace: "" from "<https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml>": no matches for kind "ClusterRoleBinding" in version "<http://rbac.authorization.k8s.io/v1beta1|rbac.authorization.k8s.io/v1beta1>"
ensure CRDs are installed first
resource mapping not found for name: "kube-flannel-ds-amd64" namespace: "kube-system" from "<https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml>": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first
resource mapping not found for name: "kube-flannel-ds-arm64" namespace: "kube-system" from "<https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml>": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first
resource mapping not found for name: "kube-flannel-ds-arm" namespace: "kube-system" from "<https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml>": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first
resource mapping not found for name: "kube-flannel-ds-ppc64le" namespace: "kube-system" from "<https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml>": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first
resource mapping not found for name: "kube-flannel-ds-s390x" namespace: "kube-system" from "<https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml>": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first

Kalesha Gagguturu:
but if i use another file from github it shows its created

gkalesha@kubemaster[Sun Nov 27][07:40 PM]:~$sudo kubectl apply -f <https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml>
namespace/kube-flannel unchanged
<http://clusterrole.rbac.authorization.k8s.io/flannel|clusterrole.rbac.authorization.k8s.io/flannel> unchanged
<http://clusterrolebinding.rbac.authorization.k8s.io/flannel|clusterrolebinding.rbac.authorization.k8s.io/flannel> unchanged
serviceaccount/flannel unchanged
configmap/kube-flannel-cfg unchanged
daemonset.apps/kube-flannel-ds unchanged

Kalesha Gagguturu:
And your intial document with github also uses this same file

Kalesha Gagguturu:
But even though after using that file we are have same status for coredns and also not able to find flannel pods

unnivkn:
are you able to see your flannel pods?

Kalesha Gagguturu:
No

unnivkn:
k get po -A

Hi can you sent to me the playbook you used to deploy kuebernete