1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | kubectl get nodes NAME STATUS ROLES AGE VERSION master NotReady control-plane 10h v1.26.2 node1 NotReady <none> 10h v1.26.2 node2 Ready <none> 8h v1.26.2 wget https: //raw .githubusercontent.com /projectcalico/calico/v3 .25.0 /manifests/tigera-operator .yaml wget https: //raw .githubusercontent.com /projectcalico/calico/v3 .25.0 /manifests/custom-resources .yaml kubectl apply -f tigera-operator.yaml The CustomResourceDefinition "installations.operator.tigera.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes metadata: annotations: controller-gen.kubebuilder.io /version : v0.3.0 name: installations.operator.tigera.io 对于大多数资源来说,这不是问题,但有些对象超过了 256kb 的限制,例如 kube-prometheus-stack Helm 图表中的 Prometheus CRD,其大小为 500kb。 在 Argo CD 中同步 Prometheus CRD 将运行 kubectl apply 并尝试添加它的 500kb JSON 表示作为注释。这将导致“Too long: must have at most 262144 bytes”错误,因为它超过了 256kb(或 262144 字节)的 Kubernetes 注释大小限制 解决方案是停止使用 Client Side Apply(运行 kubectl apply 时的当前默认设置),而是使用 Server Side Apply,它不会将 last-applied-configuration 注释添加到对象。 Server Side Apply 计划成为未来 Kubernetes 和 Argo CD 版本中的默认应用方法,但现在我们必须明确启用它。 在 Argo CD v2.5 中添加了对服务器端应用的支持,可以通过在应用程序资源的同步选项中设置它来启用: kubectl apply -f custom-resources.yaml [root@master calico] # kubectl apply -f custom-resources.yaml apiserver.operator.tigera.io /default unchanged error: resource mapping not found for name: "default" namespace: "" from "custom-resources.yaml" : no matches for kind "Installation" in version "operator.tigera.io/v1" 参考文档 https: //medium .com /pareture/kubectl-install-crd-failed-annotations-too-long-2ebc91b40c7d https: //www .arthurkoziel.com /fixing-argocd-crd-too-long-error/ kubectl create -f tigera-operator.yaml kubectl create -f custom-resources.yaml kubectl delete pods <pod> --grace-period=0 kubectl patch pod <pod> -p '{"metadata":{"finalizers":null}}' kubectl create -f https: //raw .githubusercontent.com /projectcalico/calico/v3 .25.0 /manifests/tigera-operator .yaml kubectl create -f https: //raw .githubusercontent.com /projectcalico/calico/v3 .25.0 /manifests/custom-resources .yaml 修改custom-resources.yaml cidr: 10.244.0.0 /16 kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE tigera-operator tigera-operator-54b47459dd-jdj8c 1 /1 Running 0 13m kubectl get pods -n calico-system NAME READY STATUS RESTARTS AGE calico-kube-controllers-6b7b9c649d-7w62w 0 /1 ContainerCreating 0 4m16s calico-node-9c2nw 0 /1 Init:1 /2 0 4m16s calico-node-pbshp 0 /1 PodInitializing 0 4m16s calico-typha-7f79b56575-wzmcf 1 /1 Running 0 4m16s csi-node-driver-lt8tp 0 /2 ContainerCreating 0 44s |
菜鸟的自白
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!