Merge pull request #53031 from vishh/device-id

Automatic merge from submit-queue. 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>.

Make AllocateResponse artifacts global across all devices per container in device plugin API

The current version of Device plugins returns artifacts (env vars, mounts, devices) per device, per container. This is not necessary and results in complex merging issues on kubelet side

There can still be a conflict if the artifacts returned by device plugin conflicts with the pod spec. In that case, I'd recommend failing pods in kubelet. This is yet to be addressed.

The go package name for device plugin apis is updated from `pkg/kubelet/apis/deviceplugin/v1alpha1` to `pkg/kubelet/apis/deviceplugin/v1alpha` (sub-version dropped) because we expect the alpha version to change until it graduates to beta and changing the go package everytime the actual alpha version changes is too tedious.

```release-note
Device plugin Alpha API no longer supports returning artifacts per device as part of AllocateResponse.
```

TODO:
- [x] Bump kubelet side API version
- [X] Post an updated device plugin image that works with the new API version
- [ ] Stabilize e2es (This PR needs to be merged since there is a dependency on the plugin side for vendoring)
This commit is contained in:
Kubernetes Submit Queue
2017-10-19 12:43:52 -07:00
committed by GitHub
22 changed files with 140 additions and 340 deletions

View File

@@ -209,7 +209,7 @@ pkg/kubelet
pkg/kubelet/apis
pkg/kubelet/apis/cri/testing
pkg/kubelet/apis/cri/v1alpha1/runtime
pkg/kubelet/apis/deviceplugin/v1alpha1
pkg/kubelet/apis/deviceplugin/v1alpha
pkg/kubelet/apis/kubeletconfig
pkg/kubelet/apis/kubeletconfig/v1alpha1
pkg/kubelet/cadvisor

View File

@@ -19,8 +19,7 @@ set -o nounset
set -o pipefail
KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE}")/../" && pwd -P)"
DEVICE_PLUGIN_ROOT="${KUBE_ROOT}/pkg/kubelet/apis/deviceplugin/v1alpha1/"
DEVICE_PLUGIN_ROOT="${KUBE_ROOT}/pkg/kubelet/apis/deviceplugin/v1alpha/"
source "${KUBE_ROOT}/hack/lib/protoc.sh"
kube::protoc::generate_proto ${DEVICE_PLUGIN_ROOT}

View File

@@ -19,8 +19,8 @@ set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
DEVICE_PLUGIN_ROOT="${KUBE_ROOT}/pkg/kubelet/apis/deviceplugin/v1alpha1/"
ERROR="Device plugin api is out of date. Please run hack/update-generated-device-plugin.sh"
DEVICE_PLUGIN_ROOT="${KUBE_ROOT}/pkg/kubelet/apis/deviceplugin/v1alpha/"
source "${KUBE_ROOT}/hack/lib/protoc.sh"
kube::golang::setup_env