需要您在执行 Kubernetes YAML 文件时就某个问题提供指导。我的kubectl版本如下:
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0", GitCommit:"af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38", GitTreeState:"clean", BuildDate:"2020-12-08T17:59:43Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.14", GitCommit:"89182bdd065fbcaffefec691908a739d161efc03", GitTreeState:"clean", BuildDate:"2020-12-18T12:02:35Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Run Code Online (Sandbox Code Playgroud)
这是从 Kubernetes 站点https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-windows下载的最新版本
YAML 有 apiVersion:networking.k8s.io/v1 kind: Ingress 和运行 YAML 的错误是
no matches for kind "Ingress" in version "networking.k8s.io/v1"
Run Code Online (Sandbox Code Playgroud)
Kubernetes 问题https://github.com/kubernetes/kubernetes/issues/90077提到
networking.k8s.io/v1beta1 == 1.14 to 1.18
networking.k8s.io/v1 = 1.19+
Run Code Online (Sandbox Code Playgroud)
所以我想它应该可以正常工作吗?
我已将 API 版本更改为
apiVersion: extensions/v1beta1 or
apiVersion: networking.k8s.io/v1beta1
Run Code Online (Sandbox Code Playgroud)
但在 YAML 的另一部分失败
backend:
service:
name: {{ template "fullname" $ }}-srv
port: …Run Code Online (Sandbox Code Playgroud)