Commit Graph

35 Commits

Author SHA1 Message Date
Antonio Ojea
9c2b333925 Revert "plumb context from CRI calls through kubelet"
This reverts commit f43b4f1b95.
2022-11-02 13:37:23 +00:00
Kubernetes Prow Robot
5899432f92
Merge pull request #113481 from rphillips/fixes/77063
kubelet: fix pod log line corruption when using timestamps and long lines
2022-11-01 19:59:50 -07:00
Ryan Phillips
ddae396ce3 kubelet: fix pod log line corruption when using timestamps and long lines 2022-11-01 09:22:30 -05:00
David Ashpole
f43b4f1b95
plumb context from CRI calls through kubelet 2022-10-28 02:55:28 +00:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Sascha Grunert
effbcd3a0a
Add support for CRI verbose fields
The remote runtime implementation now supports the `verbose` fields,
which are required for consumers like cri-tools to enable multi CRI
version support.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-02-10 17:12:26 +01:00
Sascha Grunert
de37b9d293
Make CRI v1 the default and allow a fallback to v1alpha2
This patch makes the CRI `v1` API the new project-wide default version.
To allow backwards compatibility, a fallback to `v1alpha2` has been added
as well. This fallback can either used by automatically determined by
the kubelet.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-11-17 11:05:05 -08:00
Ryan Phillips
d6f9df424a defer close the rotated log open 2021-11-12 08:13:24 -06:00
Krzysztof Gibuła
629d5ab213 Migrate pkg/kubelet/kuberuntime to structured logging 2021-03-17 01:53:44 +01:00
changshuchao
42eb85e4fb Made some optimizations, including modifying variable names, omitting unnecessary parentheses, and conflicting variable names and package names.
Signed-off-by: changshuchao <chang.shuchao1@zte.com.cn>
2021-01-16 17:24:08 +08:00
zhouya0
44c24758b0 [Flaky Test] Add limited lines to log when having tail option 2020-08-18 17:13:25 +08:00
iamchuckss
b5a02c4190 Fix log timestamps to be displayed in fixed width 2020-05-19 13:07:56 +08:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Davanum Srinivas
0c52ffe08f
make local copy of JSONLog
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-03-17 21:25:55 -04:00
xieyanker
4b775046d4
remove stateCheckPeriod
If exec logForceCheckPeriod, there is no need to exec stateCheckPeriod
2019-08-29 11:06:45 +08:00
Kubernetes Prow Robot
0e1bad3764
Merge pull request #81747 from Random-Liu/fix-windows-log-follow
Fix windows kubectl log -f.
2019-08-23 06:53:24 -07:00
Lantao Liu
7767ff3bb2 Fix windows kubectl log -f. 2019-08-21 15:44:20 -07:00
Tim Allclair
3f510c69f6 Remove dead code from pkg/kubelet/... 2019-08-21 10:40:21 -07:00
Giuseppe Scrivano
a561196bfe
logs: consume all file until EOF on exited container
If the container is not found, do not stop reading the log file
immediately but wait until we reach again EOF.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-30 17:42:21 +01:00
Giuseppe Scrivano
8f68b281e4
kubelet: force checking the log file every second
it seems fsnotify can miss some read events, blocking the kubelet to
receive more data from the log file.

If we end up waiting for events with fsnotify, force a read from the
log file every second so that are sure to not miss new data for longer
than that.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-30 17:42:20 +01:00
Giuseppe Scrivano
341c2c0d1f
kubelet: handle recreated log files
if the runtime is configured to rotate the log file, we might end up
watching the old fd where there are no more writes.

When a fsnotify event other than Write is received, reopen the log
file and recreate the watcher.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-30 17:42:20 +01:00
Giuseppe Scrivano
2c30eee92f
kubelet: read immediately after creating the watcher
if some events happen between the Read and while we set the watcher,
we might miss them.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-30 17:42:11 +01:00
Davanum Srinivas
33081c1f07
New staging repository for cri-api
Change-Id: I2160b0b0ec4b9870a2d4452b428e395bbe12afbb
2019-03-26 18:21:04 -04:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Jess Frazelle
dbf7186bee
update jsonlog path for updated vendor
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-08-30 11:40:05 -04:00
Yu-Ju Hong
390b158db9 kubelet: plumb context for log requests
This allows kubelets to stop the necessary work when the context has
been canceled (e.g., connection closed), and not leaking a goroutine
and inotify watcher waiting indefinitely.
2018-08-10 17:35:46 -07:00
Seth Jennings
5da3a1d514 kubelet: logs: do not wait on following terminated container 2018-04-26 16:53:54 -05:00
Seth Jennings
c58b0183f2 kuberuntime: logs: reduce logging level on waitLogs msg 2018-04-11 13:12:04 -05:00
Kubernetes Submit Queue
f05a065738
Merge pull request #59713 from hanxiaoshuai/fix0211
Automatic merge from submit-queue (batch tested with PRs 60208, 60084, 60183, 59713, 60096). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use SeekStart, SeekCurrent, and SeekEnd repalace of deprecated constant

**What this PR does / why we need it**:
Use SeekStart, SeekCurrent, and SeekEnd repalace of deprecated constant.
'''
// Deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.
const (
	SEEK_SET int = 0 // seek relative to the origin of the file
	SEEK_CUR int = 1 // seek relative to the current offset
	SEEK_END int = 2 // seek relative to the end
)

'''
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-22 23:17:38 -08:00
Di Xu
48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
hangaoshuai
7cfb94cbc5 Use SeekStart, SeekCurrent, and SeekEnd repalace of deprecated constant 2018-02-11 11:02:23 +08:00
Lee Verberne
e10042d22f Increment CRI version from v1alpha1 to v1alpha2
This also incorporates the version string into the package name so
that incompatibile versions will fail to connect.

Arbitrary choices:
- The proto3 package name is runtime.v1alpha2. The proto compiler
  normally translates this to a go package of "runtime_v1alpha2", but
  I renamed it to "v1alpha2" for consistency with existing packages.
- kubelet/apis/cri is used as "internalapi". I left it alone and put the
  public "runtimeapi" in kubelet/apis/cri/runtime.
2018-02-07 09:06:26 +01:00
Lantao Liu
de73e4596a Add constants in CRI. 2017-11-21 00:36:01 +00:00
Mrunal Patel
ccdf0ee9eb Parse the last partial line in CRI logs
Fixes part of https://github.com/kubernetes/kubernetes/issues/44976

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-11-13 10:32:44 -08:00
Pengfei Ni
2e6c57c6f7 Make CRI logs parsing to a library 2017-11-07 10:07:16 +08:00