Commit Graph

804 Commits

Author SHA1 Message Date
Sargun Dhillon
12625131b5 Solve the notification on startup pod status notification race condition
This solves the race condition as described in
https://github.com/virtual-kubelet/virtual-kubelet/issues/836.

It does this by checking two conditions when the possible race condition
is detected.

If we receive a pod notification from the provider, and it is not
in our known pods list:
1. Is our cache in-sync?
2. Is it known to our pod lister?

The first case can happen because of the order we start the
provider and sync our caches. The second case can happen because
even if the cache returns synced, it does not mean all of the call
backs on the informer have quiesced.

This slightly changes the behaviour of notifyPods to that it
can block (especially at startup). We can solve this later
by using something like a fair (ticket?) lock.
2020-07-22 18:57:27 -07:00
Brian Goff
ee7f5fa3ef Merge pull request #852 from cpuguy83/fix_running_pods_npe
Fix running pods handler on nil lister
2020-07-14 19:04:50 -07:00
Brian Goff
bcb5dfa11c Fix running pods handler on nil lister
This follows suit with other hanlders and returns a NotImplemented
http.HandlerFunc when the lister is nil.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-07-14 15:33:59 -07:00
Brian Goff
b7c19cb5a1 Merge pull request #850 from cwdsuzhou/add_website
Add tensile kube to website
2020-07-09 15:50:10 -07:00
wadecai
2f989f5278 Add tensile kube to web site 2020-07-09 11:28:54 +08:00
Brian Goff
5455f290a4 Merge pull request #844 from adrienjt/upgrade-k8s-1-18 2020-07-08 15:02:00 -07:00
Adrien Trouillaud
9c6b48c1c3 rm obsolete doc 2020-07-07 21:00:56 -07:00
Adrien Trouillaud
e00e4c2bba make e2e test compatible with go1.13 2020-07-07 21:00:56 -07:00
Adrien Trouillaud
72a0be3f45 upgrade to go 1.13
required by k8s libs at 1.18
2020-07-07 21:00:56 -07:00
Adrien Trouillaud
845b4cd409 upgrade k8s libs to 1.18.4 2020-07-07 21:00:56 -07:00
Brian Goff
f934ded4a2 Merge pull request #838 from sargun/threeway-patch
Introduce three-way patch for proper handling of updates
2020-07-07 12:52:14 -07:00
Brian Goff
364d7a9a74 Merge pull request #848 from cwdsuzhou/add_tensile-kube
Add tensile kube to README
2020-07-06 11:13:44 -07:00
Sargun Dhillon
e805cb744a Introduce three-way patch for proper handling of out-of-band status updates
As described in the patch itself, there is a case that if a node is updated out of
band (e.g. node-problem-detector (https://github.com/kubernetes/node-problem-detector)),
we will overwrite the patch in our typicaly two-way strategic patch for node status
updates.

The reason why the standard kubelet can do this is because the flow goes:
apiserver->kubelet: Fetch current node
kubelet->kubelet: Update apiserver's snapshot with local state changes
kubelet->apiserver: patch

We don't have this luxury, as we rely on providers making a callback into us
in order to get the most recent pod status. They do not have a way
to do that merge operation themselves, and a two-way merge doesn't
give us enough metadata.

In order to work around this, we perform a three-way merge on behalf of
the user. We do this by stashing the contents of the last update inside
of it. We then fetch that status back, and use that for the future
update itself.

In the upgrade case, or the case where the VK has been created by
"someone else", we do not know which attributes were created by
or written by us, so we cannot generate a three way patch.

In this case, we will do our best to avoid deleting any attributes,
and only overwrite them. We will consider all current api server
values written by "someone else", and not edit them. This is done
by considering the "old node" to be empty.
2020-07-06 11:10:32 -07:00
wadecai
56a39032e9 add_tensile_kube 2020-07-05 01:03:17 +08:00
Brian Goff
b50302b845 Merge pull request #847 from hustcat/tencent
Add Tencent Games to the adopters
2020-07-02 14:45:38 -07:00
dbyin(尹烨)
da1cb98b5d Add Tencent Games to the adopters 2020-07-02 12:13:48 +08:00
Brian Goff
5306173408 Merge pull request #846 from sargun/add-trace-to-updateStatus
Add instrumentation to node controller (tracing)
2020-07-01 12:53:27 -07:00
Sargun Dhillon
d6a38ca721 Merge pull request #845 from sargun/non-blocking-node-status-update
Make node status updates non-blocking
2020-07-01 12:46:56 -07:00
Sargun Dhillon
30aabe6fcb Add instrumentation to node controller (tracing)
This adds tracing in node controller in several sections where
it was missing.
2020-07-01 12:40:09 -07:00
Sargun Dhillon
1e8c16877d Make node status updates non-blocking
There's a (somewhat) common case we can get into where the node
status update loop is busy while a provider is trying to send
a node status update. Right now, we block the provider from
creating a notification in this case.
2020-07-01 12:32:54 -07:00
Brian Goff
bd977cb224 Merge pull request #841 from cwdsuzhou/June/support_queue_define 2020-06-29 15:52:28 -07:00
wadecai
ca417d5239 Expose the queue rate limiter 2020-06-26 10:45:41 +08:00
wadecai
fedffd6f2c Add parameters to support change work queue qps 2020-06-26 10:44:09 +08:00
Brian Goff
e72e31b0d8 Merge pull request #843 from virtual-kubelet/rbitia-zoom-link
Zoom link update
2020-06-24 13:03:12 -07:00
Ria Bhatia
a667c5113b Update README.md
Edit zoom link since we have a new cncf vk zoom account.
2020-06-24 12:51:17 -07:00
Sargun Dhillon
bfd3f51ff3 Merge pull request #842 from sargun/fix-validate
Fix kubernetes version dependency checking script
2020-06-23 09:12:48 -07:00
Sargun Dhillon
5f64eab109 Fix kubernetes version dependency checking script
We had locked to version v1.17.6 when this script was released. At the time,
it was also the current stable release, and what was presented by the
github API. It turns out the Github API does not present all tags. This
changes it to fetch the annotated tag from the upstream repo.
2020-06-22 22:53:27 -07:00
Weidong Cai
2398504d08 dedup in updatePodStatus (#830)
Co-authored-by: Brian Goff <cpuguy83@gmail.com>
2020-06-15 14:35:14 -07:00
Sargun Dhillon
05fc1a43be Merge pull request #835 from cwdsuzhou/June/avoid_enqueue
Avoid enqueue when status of k8s pods change
2020-06-15 12:25:23 -07:00
wadecai
3db9ab97c6 Avoid enqueue when status of k8s pods change 2020-06-13 13:19:55 +08:00
Sargun Dhillon
dfca10f0dc Merge pull request #834 from sargun/upgrade-to-1.17
Upgrade Kubernetes libraries to 1.17
2020-06-08 11:05:52 -07:00
Sargun Dhillon
ee93284f38 Bump version of kubernetes cluster 2020-06-04 16:41:58 -07:00
Sargun Dhillon
bef6eda40d Add versioning pinning checker and instructions
This ensures that the version pinning is setup correctly, so all the deps
are pointing at the right underlying versions.
2020-06-04 16:27:04 -07:00
Sargun Dhillon
b3213d6eb2 Update kubernetes dependencies to v1.17.6
This also locks golang.org/x/sys/unix as it's another transitive dep that
flaps.
2020-06-04 16:25:41 -07:00
Brian Goff
a67cfab42b Merge pull request #833 from cpuguy83/fix_stream_idle_timeout_break
Fix stream timeout defaults
2020-06-03 20:32:53 -07:00
Brian Goff
51b9a6c40d Fix stream timeout defaults
This was an unintentional breaking change in
0bdf742303

A timeout of 0 doesn't make any sense, so use the old values of 30s as a
default.
2020-06-03 10:01:34 -07:00
Brian Goff
8fc8b69d8f Merge pull request #806 from elotl/vilmos-followlogs
Add support for v1.PodLogOptions
2020-05-04 11:05:57 -07:00
Vilmos Nebehaj
3e0d03c833 Use errdefs.InvalidInputf() for formatting 2020-04-28 11:19:37 -07:00
Vilmos Nebehaj
7628c13aeb Add tests for parseLogOptions() 2020-04-28 11:19:37 -07:00
Vilmos Nebehaj
8308033eff Add support for v1.PodLogOptions 2020-04-28 11:19:37 -07:00
Brian Goff
d9193e2440 Merge pull request #824 from cwdsuzhou/March/check_pod_equal
Check pods status deep equal before update
2020-04-21 12:54:30 -07:00
wadecai
30e31c0451 Check pod status equal before enqueue 2020-04-21 10:42:29 +08:00
Brian Goff
70f1a93c6e Merge pull request #828 from EDGsheryl/master
Optimize Docs
2020-04-15 06:24:59 -07:00
EDGsheryl
063f1fcdbc Optimize Docs
Signed-off-by: EDGsheryl <edgsheryl@gmail.com>
2020-04-08 15:34:08 +08:00
Brian Goff
de8226751d Merge pull request #826 from elotl/elotl-kip
Add Elotl Kip as a provider
2020-03-23 10:31:31 -07:00
Vilmos Nebehaj
47a353897e Add Elotl Kip as a provider 2020-03-20 15:08:11 -07:00
Brian Goff
3ec3b14e49 Merge pull request #825 from sargun/add-pods-api
Add /pods HTTP endpoint
2020-03-20 14:28:02 -07:00
Sargun Dhillon
5ad12cd476 Add /pods HTTP endpoint 2020-03-20 12:04:00 -07:00
Brian Goff
230ebe1b29 Merge pull request #818 from guoliangshuai/master
add 'GET' method to pod exec handler, so it can support websocket
2020-03-09 13:30:47 -07:00
guoliangshuai
554d30a0b1 add 'GET' method to pod exec handler, so it can support websocket 2020-03-09 14:16:49 +08:00