-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Audit Logfile Not Created #1609
Comments
Can you ensure that these config options are actually getting set? There should be a log entry in It might be helpful to post the output of |
Thanks for the response! It looks like it could not find the option
It looks like LogOptions should be a valid field. https://godoc.org/k8s.io/apiserver/pkg/server/options#AuditOptions I do see a difference in the Audit's type in the struct: genericoptions vs kubeoptions of the Authorization. I don't know enough to guess if this is significant. Logs: minikubelogs.txt |
The tricky part here is that these structs have changed between 1.6 and 1.7. The docs are at HEAD, which is 1.7.0-beta, but minikube is still running kubernetes 1.6.4. You'll need to set the ones for the right version of kubernetes. We might be able to log more helpful error messages here or bubble them up. Without inspecting the actual code, I'm not sure if theres a good way to discover the options on these structs for past versions of kubernetes. |
I never would have figured that out, thanks! I will see if I can dig up the correct doc version. A more descriptive error message would be useful. If I discover an easy way to link back to a version of docs, I'll update this thread. |
The real source of truth for minikube will always be the vendored in code. You can see it the struct that we reflect on for the apiserver here And specifically for the audit options here So it looks like |
Thanks @r2d4! That resolved this for me. I will keep that vendoring tip in mind, that is much easier than looking through the tagged release on the kubernetes/kubernetes project For posterity (until the next version):
|
With some hints from @r2d4 I've figured out that you can do this:
Which puts the JSON logs direct on your laptop!
|
the following worked for me on a mac with xhyve:
|
@r2d4 @wallrj when I use the option
I'm using qinikube with kubernetes v1.9.3. I can see in the code that it's supposed to support this option but something goes wrong ... Here is the command I used to get this behavior
|
Is this a BUG REPORT or FEATURE REQUEST? : Bug report
Minikube version (use
minikube version
): minikube version: v0.19.0Environment:
OS (e.g. from /etc/os-release):
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.5
BuildVersion: 16F73
VM Driver (e.g.
cat ~/.minikube/machines/minikube/config.json | grep DriverName
):"DriverName": "virtualbox",
ISO version (e.g.
cat ~/.minikube/machines/minikube/config.json | grep -i ISO
orminikube ssh cat /etc/VERSION
):v0.18.0
Install tools:
Others:
What happened:
Started minikube with audit log options. Logs were not generated at the location specified.
What you expected to happen:
Audit log creation and output from server.
How to reproduce it (as minimally and precisely as possible):
minikube start --extra-config=apiserver.Authorization.Mode=RBAC --extra-config=apiserver.Audit.LogOptions.Path=/var/log/apiserver/audit.log --extra-config=apiserver.Audit.LogOptions.MaxAge=30 --extra-config=apiserver.Audit.LogOptions.MaxSize=100 --extra-config=apiserver.Audit.LogOptions.MaxBackups=5
kubectl get pods
minikube ssh cat /var/log/apiserver/audit.log
Anything else do we need to know:
I created pods that access the API service accounts to generate logs as well, with no success.
The text was updated successfully, but these errors were encountered: