等待豆荚:apiserver卡住了

问题描述 投票:1回答:1

我正在努力实施审计政策我的yaml

~/.minikube/addons$ cat audit-policy.yaml 
# Log all requests at the Metadata level.
apiVersion: audit.k8s.io/v1beta1
kind: Policy
rules:
- level: Metadata

豆荚卡住了

minikube start  --extra-config=apiserver.Authorization.Mode=RBAC --extra-config=apiserver.Audit.LogOptions.Path=/var/logs/audit.log   --extra-config=apiserver.Audit.PolicyFile=/etc/kubernetes/addons/audit-policy.yaml
😄  minikube v0.35.0 on linux (amd64)
💡  Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
🔄  Restarting existing virtualbox VM for "minikube" ...
⌛  Waiting for SSH access ...
📶  "minikube" IP address is 192.168.99.101
🐳  Configuring Docker as the container runtime ...
✨  Preparing Kubernetes environment ...
    ▪ apiserver.Authorization.Mode=RBAC
    ▪ apiserver.Audit.LogOptions.Path=/var/logs/audit.log
    ▪ apiserver.Audit.PolicyFile=/etc/kubernetes/addons/audit-policy.yaml
🚜  Pulling images required by Kubernetes v1.13.4 ...
🔄  Relaunching Kubernetes v1.13.4 using kubeadm ... 
⌛  Waiting for pods: apiserver

为什么?

我可以做这个

minkub start

然后我去minikube ssh

$ sudo bash
$ cd /var/logs
bash: cd: /var/logs: No such file or directory
ls
cache  empty  lib  lock  log  run  spool  tmp

如何申请extra-config?

kubernetes
1个回答
1
投票

我没有好消息。虽然你在/var/logs上犯了一些错误但在这种情况下无关紧要,因为在Minikube中似乎没有办法实施审计政策(我的意思是,至少有几种方法,但它们似乎都失败了)。

您可以尝试在GitHub问题和我将提供的其他链接中提供的几种方式,但我尝试了所有这些方法,但它们不适用于当前的Minikube版本。您可能会尝试使用早期版本,因为在某些情况下,您可能会按照您在问题中提供的方式进行操作,但现在在更新版本中它不是。无论如何,我花了一些时间尝试从链接和我自己的想法的方式,但没有成功,也许你将能够找到丢失的一块。

您可以在此文档中找到更多信息:

Audit Logfile Not Created

Service Accounts and Auditing in Kubernetes

fails with -extra-config=apiserver.authorization-mode=RBAC and audit logging: timed out waiting for kube-proxy

How do I enable an audit log on minikube?

Enable Advanced Auditing Webhook Backend Configuration

© www.soinside.com 2019 - 2024. All rights reserved.