新手使用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/v1beta1andapps/v1beta2API 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 theCSINodeDrivererror you encountered. - That
CSINodeDrivererror is usually a side effect of using an old API version with a modern cluster, or a minor version mismatch between yourkubectlclient 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:
- Update your YAML to use
apiVersion: apps/v1—this is the stable, fully supported API version for Deployments in all modern Kubernetes clusters. - Check version compatibility (optional but good practice):
- Run
minikube versionto see your cluster's version - Run
kubectl version --shortto check your client version
Make sure the client and server versions are within one minor release of each other to avoid weird edge cases.
- Run
- 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
相关产品推荐
相关产品推荐

