You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

新手使用Kubectl部署Deployment.yaml遇CSINodeDriver无效错误求助

Fixing Your Deployment Error in Minikube

Hey there, let's work through this issue step by step to get your Tomcat deployment up and running!

First, let's unpack why you're hitting this error:

  • The apps/v1beta1 and apps/v1beta2 API versions for Deployments are deprecated in newer Kubernetes versions (K8s 1.16+), which is almost certainly what your Minikube cluster is using. Relying on these outdated API versions can trigger schema mismatches—like the CSINodeDriver error you encountered.
  • That CSINodeDriver error is usually a side effect of using an old API version with a modern cluster, or a minor version mismatch between your kubectl client and the Minikube cluster itself.

Here's the corrected YAML file you need:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: tomcat-deployment
spec:
  selector:
    matchLabels:
      app: tomcat
  replicas: 1
  template:
    metadata:
      labels:
        app: tomcat
    spec:
      containers:
      - name: tomcat
        image: tomcat:9.0
        ports:
        - containerPort: 8080

Quick steps to resolve this:

  1. Update your YAML to use apiVersion: apps/v1—this is the stable, fully supported API version for Deployments in all modern Kubernetes clusters.
  2. Check version compatibility (optional but good practice):
    • Run minikube version to see your cluster's version
    • Run kubectl version --short to check your client version
      Make sure the client and server versions are within one minor release of each other to avoid weird edge cases.
  3. Re-run the deployment command:
    kubectl apply -f ./deployment.yaml
    

You should now see the exact output you're hoping for:

deployment "tomcat-deployment" created

内容的提问来源于stack exchange,提问作者Jaronloch

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 05:23:59