我无法使用“aks命令调用”,因为https://store.policy.core.windows.net/kubernetes/container-no-privilege-escalation/v3/template.yaml的策略是防止权限升级。当我尝试时,我会得到以下错误
(KubernetesOperationError) Failed to run command in managed cluster due to kubernetes failure. details: admission webhook "validation.gatekeeper.sh" denied the request: [azurepolicy-k8sazurev3noprivilegeescalatio-adff37e713cffbf58639] Privilege escalation container is not allowed: init-command
[azurepolicy-k8sazurev3noprivilegeescalatio-adff37e713cffbf58639] Privilege escalation container is not allowed: user-command
Code: KubernetesOperationError
Message: Failed to run command in managed cluster due to kubernetes failure. details: admission webhook "validation.gatekeeper.sh" denied the request: [azurepolicy-k8sazurev3noprivilegeescalatio-adff37e713cffbf58639] Privilege escalation container is not allowed: init-command
[azurepolicy-k8sazurev3noprivilegeescalatio-adff37e713cffbf58639] Privilege escalation container is not allowed: user-command
这是否是将AKS内置于政策中的预期后果?
发布于 2022-09-26 12:22:37
如果应用了防止权限提升容器的策略,则预期az aks command invoke
将无法工作。
如果您有特定的Azure策略,这可能会导致az aks command invoke
失败,因为这可能不允许command-<ID>
荚的特定配置。
建议对不允许创建pod的相关Azure策略豁免aks-command
命名空间。
您可以通过访问Azure Portal ->策略->赋值( -> )、标识赋值并访问它们、编辑分配->参数(取消选中“仅显示需要输入或检查的参数”框->,在“名称空间排除”下添加“accessing”)来实现这一点。
或者,您可以检查“命令-”荚的配置,并相应地调整策略(如果不是内置的)。
https://stackoverflow.com/questions/73831641
复制相似问题