0

My calico is configured to be associated with etcd, so I create a configfile to configure the etcd's ca certificate, certs and key, but when I apply the config file, notes me that didn't have this kind. This file is the template I copied from the official website. what should I do?

root@qhwk-k8s-master-0:/work/k8s/calico-v3.16.3# kubectl apply -f calico-apiConfig.yaml 
error: unable to recognize "calico-apiConfig.yaml": no matches for kind "CalicoAPIConfig" in version "projectcalico.org/v3"
root@qhwk-k8s-master-0:/work/k8s/calico-v3.16.3# cat calico-apiConfig.yaml 
apiVersion: projectcalico.org/v3
kind: CalicoAPIConfig
metadata:
spec:
  etcdEndpoints: https://10.58.221.192:2379,https://10.58.221.52:2379,https://10.58.221.153:2379
  etcdKeyFile: /etc/kubernetes/pki/etcd/server.key
  etcdCertFile: /etc/kubernetes/pki/etcd/server.crt
  etcdCACertFile: /etc/kubernetes/pki/etcd/ca.crt
root@qhwk-k8s-master-0:/work/k8s/calico-v3.16.3# 
Esc
  • 521
  • 13
  • 30
  • Could you try to use [calicotl apply](https://docs.projectcalico.org/reference/calicoctl/overview) instead of kubectl apply and check if it works? – Jakub Oct 19 '20 at 05:27
  • @Jakub here is the output: ``` root@qhwk-k8s-master-0:/work/k8s/calico-v3.16.3# calicoctl apply -f calico-apiConfig.yaml Failed to execute command: Unknown resource type (CalicoAPIConfig) and/or version (projectcalico.org/v3) ``` root@qhwk-k8s-master-0:/work/k8s/calico-v3.16.3# – Esc Oct 19 '20 at 06:38
  • I checked [here](https://gist.github.com/abhi/c5529649e0abcd188b76ebf543aea3d9) and it say's that `calicoctl by default looks at /etc/calico/calicoctl.cfg for the configuration.`. Could you try to change name of your file to `calicoctl.cfg` and put it in `/etc/calico/`? – Jakub Oct 22 '20 at 06:09

0 Answers0