-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Convert node level logging agents to v1beta3 #7274
Conversation
@@ -11,7 +14,7 @@ containers: | |||
mountPath: /var/lib/docker/containers | |||
- name: varlog | |||
mountPath: /varlog | |||
volumes: | |||
volumes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try kubectl create --validate?
Please read v1beta3 conversion tips:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/api.md#v1beta3-conversion-tips
volumes could be failing validation. source should be inlined and hostDir has been replaced by hostPath:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/api/v1beta3/types.go#L203
Also, please rename the file to .yaml.
Ref #5475 |
c6846f3
to
a0601c0
Compare
I can create the pods for node level logging manually:
and they go into the Running state. However they are not picked up during the manifest process. @zmerlynn -- any pointers on why this might be happening or what I can do to debug this? Thanks. |
@satnam6502 Did you fix the volume source for v1beta3? Enable -v 3 or higher on kubelet and look for the log messages from the reader: |
No. I will dig onto the log later perhaps. But for now I am trying to understand how to use
|
From http://kubernetes.io/third_party/swagger-ui/#!/v1beta3/replacePod I see it should be |
Looking at the kubelet logs on one of the nodes it seems that it still wants the old version of the manifest file?
|
So I suspect I need to change code in the kubelet to make it accept a regular pod specification. |
How about I do the following as a stepping stone towards depreciating the manifest mechanism. First, change the kubelet to just Then (a bit later) implement a one-per-node controller -- perhaps as a plug-in? -- @thockin -- and then just use this controller (from the config scripts rather than the kubelet) to place the v1beta3 replication controller for node level logging on each node. How does that sound @bgrant0607 ? Adding @dchen1107 for good measure. |
@satnam6502 There is supposed to be code in Kubelet to read pods, but it must be broken. We do need to fix it. It appears that file_test.go generates manifests and then reads them in. We need comparable code for writing pods using the specified API version (v1beta3, in particular). |
@bgrant0607 - this code already exists - see TestReadPodsFromFile case. IIUC, the problem is that we don't support yaml representation - @satnam6502 changing it to json should fix the problem |
I'd rather add YAML support because I would like to keep these pod spec as easy to read as possible for humans. |
This was a more general approach. Basically, yaml support has been removed in #5533. Basically the reason why it doesn't work for yaml is that pkg/conversion/decode.go doesn't support yaml (this support was explicitly removed in the PR I mentioned above). |
We do support yaml from the clients. It's converted to json on read. We used to support json in the kubelet, and I don't see it being difficult to support at kubelet the same way. |
It's only the api which doesn't support yaml directly. |
I've done as @wojtek-t suggests -- the v1beta3 pod specifications are in JSON now which seems to work.
|
I've checked that logs can be viewed with Kibana (by adding a certificate to Chrome) and this indeed works. Now checking Cloud Logging. |
Please file another issue for kubelet yaml support. |
Note, however:
|
Those references were from manifest decoding. We could do the same for pod decoding. |
I've verified that the JSON versions of these pod specifications work by observing log lines being ingested using Kibana (for Elasticsearch) and the Cloud Logging Console for cloud logging. I propose that we review/merge this change and if I get time I could adjust the kubelet to also accept YAML in which case I could revert these JSON files to their YAML equivalents. |
LGTM |
+1 The change overall LGTM - I will merge it. |
Convert node level logging agents to v1beta3
@lavalamp @bgrant0607 I can create these pods manually but they are not being picked up by the manifest process -- can you see what I might be doing wrong? Thanks.