Commit Graph

18 Commits

Author SHA1 Message Date
Wei Fu
4ce334aa49 reload cni network config if has fs change events
With go RWMutex design, no goroutine should expect to be able to
acquire a read lock until the read lock has been released, if one
goroutine call lock.

The original design is to reload cni network config on every single
Status CRI gRPC call. If one RunPodSandbox request holds read lock
to allocate IP for too long, all other RunPodSandbox/StopPodSandbox
requests will wait for the RunPodSandbox request to release read lock.
And the Status CRI call will fail and kubelet becomes NOTReady.

Reload cni network config at every single Status CRI call is not
necessary and also brings NOTReady situation. To lower the possibility
of NOTReady, CRI will reload cni network config if there is any valid fs
change events from the cni network config dir.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2020-04-03 12:28:58 +08:00
Lantao Liu
50c73e6dc5 Move unix specific logic into _unix.go
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-03 16:23:42 -07:00
Justin Terry (VM)
193918b702 Switch to containerd/log package
Moves to the containerd/log package over logrus directly. This benefits the
traces because if using any log context such as OpenCensus on the entry gRPC
API all traces for that gRPC method will now contain the appropriate TraceID,
SpanID for easy correlation.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-08-07 12:18:18 -07:00
Lantao Liu
ba8788c6b9 Update kubernetes dependency to 1.15.0.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-07-31 23:52:03 -07:00
Mike Brown
b87c0d74a5 adds cni config data to the cri status/info
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2019-06-05 16:39:45 -05:00
Abhinandan Prativadi
263b0b99d0 Change to keep in sync with latest cni config
This commit contains change to pick the latest cni config
from the configured CNIConfDir.
With this change any changes made to the cni config file will
be picked up on the kubelet's runtime status check call.
Ofcourse this would lead to undefined behavior when the cni config
change is made in parallel during pod creation. However its
reasonable to assume that the operator is aware of the need to
drain the nodes of pods before making cni configuration change.
The behavior is currently not defined in kubernetes. However
I see that similar approach being adopted in the upstream kubernetes
with dockershim. Keeping the behavior consistent for now.

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2018-06-21 20:43:38 +00:00
Lantao Liu
387da59ee5 Rename all variables to remove "cricontainerd".
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-19 21:59:32 +00:00
abhi
92110e1d74 Moving to use go-cni library from containerd
This fix aims to use the cni library form containerd.
The library avoid usage of nsenter.

Signed-off-by: abhi <abhi@docker.com>
2018-03-14 19:25:54 -07:00
Lantao Liu
f0a500a390 Use direct function call.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-13 04:51:19 +00:00
Lantao Liu
605b4a7b6a Update imports
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-02-08 02:45:44 +00:00
Lantao Liu
7ddd9255b6 Add golang version in Status info.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-02-01 20:10:39 +00:00
Yanqiang Miao
9b71208be9 "Status" function return cri-containerd config in json format
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-11-03 09:23:05 +08:00
Lantao Liu
195b52500f Add instrumented service.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-08-23 07:02:12 +00:00
Abhinandan Prativadi
32e0313418 Containerd client integration
This commit:
1) Replaces the usage of containerd GRPC APIs with the containerd client for all operations related to containerd.
2) Updated containerd to v1.0alpha4+
3) Updated runc to v1.0.0

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-08-16 14:43:22 -07:00
Lantao Liu
862d00a21c Update CRI to d779e9c9561b732adf06263c5424889e7564fdbd.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-06-21 01:56:13 +00:00
Lantao Liu
7c1a4c1fc1 Add Version, UpdateRuntimeConfig and Status.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-05-31 19:11:56 +00:00
Crazykev
49e7ef2153 update kubernetes vendor for new CRI change
Signed-off-by: Crazykev <crazykev@zju.edu.cn>
2017-05-24 10:25:55 +08:00
Random-Liu
f2925f58ac Add initial code framework 2017-04-14 19:04:26 -07:00