首页 > 解决方案 > Coredns 无法部署

问题描述

我已经安装了一个集群,但似乎无法配置 coredns 来运行。当我执行以下操作时,我收到以下消息kubectl describe replicaset -n kube-system:

Error creating: pods "coredns-7945fb857d-" is forbidden: unable to validate against any pod security policy: [pod.metadata.annotations[seccomp.security.alpha.kubernetes.io/pod]: Forbidden:  is not an allowed seccomp profile. Valid values are runtime/default pod.metadata.annotations[container.apparmor.security.beta.kubernetes.io/coredns]: Forbidden: AppArmor profile must be set pod.metadata.annotations[container.seccomp.security.alpha.kubernetes.io/coredns]: Forbidden:  is not an allowed seccomp profile. Valid values are runtime/default spec.containers[0].securityContext.capabilities.add: Invalid value: "NET_BIND_SERVICE": capability may not be added

谁能指出我正确的方向

标签: kubernetescoredns

解决方案


由于Pod 安全策略,可能甚至没有创建 coreDNS pod :

PodSecurityPolicies 是强制执行的(...),但在没有授权任何策略的情况下这样做会阻止在集群中创建任何 Pod。

在这种特定情况下,抱怨 Seccomp 注释中的配置文件无效:

[seccomp.security.alpha.kubernetes.io/pod]:禁止:不是允许的 seccomp 配置文件。

您可以在此处查看有效配置文件列表自定义配置文件示例


推荐阅读