Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubernetes audit log not generated #1029

Closed
chrissound opened this issue Aug 1, 2018 · 2 comments
Closed

Kubernetes audit log not generated #1029

chrissound opened this issue Aug 1, 2018 · 2 comments

Comments

@chrissound
Copy link

/kind bug

/var/log/kubernetes/audit remains empty even with new pods / deployments generated.

I've setup my own cluster in two vms using kubeadm with the following config:

apiVersion: kubeadm.k8s.io/v1alpha2
api:
  advertiseAddress: 192.168.0.33
  bindPort: 6443
networking:
  podSubnet: "10.244.0.0/16"
auditPolicy:
  logDir: /var/log/kubernetes/audit
  logMaxAge: 2
  path: ""

/var/log/kubernetes/audit exists and has 777 permissions.

kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:17:28Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
@neolit123
Copy link
Member

neolit123 commented Aug 1, 2018

@chrissound
thank your for the report!

are you passing --feature-gates=Auditing=true to kubeadm init?
Auditing is an alpha in 1.11.

something else you can do if you want more control, is to pass the --audit-... arguments directly to the api server using this:
https://kubernetes.io/docs/setup/independent/control-plane-flags/#apiserver-flags

also please mind that we are moving away from auditPolicy being a root item in the config.

@chrissound
Copy link
Author

Yup I think that was the issue. Thanks, I wish it were only better documented. But oh well...

For a full working example see here: https://stackoverflow.com/a/51639307/1663462

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants