【问题标题】:Kubernetes Dashboard unknown field "seccompProfile" and error 503Kubernetes 仪表板未知字段“seccompProfile”和错误 503
【发布时间】:2021-12-09 19:07:39
【问题描述】:

我是 Kubernetes 的初学者。我已从 Docker Destop 启用它,现在我想安装 Kubernetes Dashboard。

我点击了这个链接:

https://github.com/kubernetes/dashboard#getting-started

我以管理员身份在 Powershell 中执行了我的第一个命令:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml

我收到以下错误:

错误:验证错误 “https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml”: 错误验证数据: 验证错误(Deployment.spec.template.spec.securityContext): 未知字段“seccompProfile”在 io.k8s.api.core.v1.PodSecurityContext;如果你选择忽略这些 错误,使用 --validate=false 关闭验证

在这种情况下,我尝试使用带有 --validate=false 的相同命令。

然后它没有给出任何错误,当我执行时:

kubectl proxy

我通过以下方式获得了访问令牌:

kubectl describe secret -n kube-system   

我尝试访问指南中提供的链接:

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

我得到以下招摇的回应:

【问题讨论】:

    标签: kubernetes kubernetes-dashboard


    【解决方案1】:

    错误表明您的集群版本不兼容使用seccompProfile.type: RuntimeDefault。在这种情况下,您不会立即应用仪表板规范 (https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml),而是下载并在规范中注释以下行:

    ...
    spec:
      # securityContext:
      #   seccompProfile:
      #     type: RuntimeDefault
    ...
    

    然后你应用更新的规范kubectl apply -f recommended.yaml

    【讨论】:

      猜你喜欢
      • 2018-03-06
      • 2020-03-27
      • 2021-06-16
      • 2019-03-25
      • 2019-12-05
      • 2021-02-08
      • 1970-01-01
      • 2019-10-01
      • 2019-08-21
      相关资源
      最近更新 更多