请帮我找出kubectl apply失败原因。当我尝试运行
kubectl apply -k k8s/overlays/dev
时,会出现错误信息:“error: rawResources failed to read Resources: Load from path ../../base failed: '../../base' must be a file”。但是,如果我运行kustomize build k8s/overlays/dev
则可以正常工作。文件夹结构。|____k8s
| |____overlays
| | |____dev
| | | |____kustomization.yaml
| |____base
| | |____deployment.yaml
| | |____kustomization.yaml
k8s/base/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 1
template:
spec:
containers:
- name: my-app
image: my-app:v1
ports:
- containerPort: 8080
protocol: TCP
k8s/base/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
commonLabels:
app: my-app
k8s/overlays/dev/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base