等待豆荚:apiserver卡住

时间:2019-03-14 07:56:08

标签: kubernetes

我正在尝试实施审核政策 我的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

如何应用额外配置?

1 个答案:

答案 0 :(得分: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