Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
843a67b2
Unverified
Commit
843a67b2
authored
Nov 14, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70559 from vladimirvivien/kubelet-plugin-watcher-ga
Graduate Kubelet plugin registration/watcher to GA
parents
726c07eb
f16d3c56
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
129 additions
and
10 deletions
+129
-10
kube_features.go
pkg/features/kube_features.go
+2
-2
BUILD
pkg/kubelet/BUILD
+1
-1
BUILD
pkg/kubelet/apis/BUILD
+1
-0
BUILD
pkg/kubelet/apis/pluginregistration/v1/BUILD
+34
-0
api.pb.go
pkg/kubelet/apis/pluginregistration/v1/api.pb.go
+0
-0
api.proto
pkg/kubelet/apis/pluginregistration/v1/api.proto
+60
-0
constants.go
pkg/kubelet/apis/pluginregistration/v1/constants.go
+24
-0
kubelet.go
pkg/kubelet/kubelet.go
+2
-2
BUILD
pkg/kubelet/util/pluginwatcher/BUILD
+2
-2
example_plugin.go
pkg/kubelet/util/pluginwatcher/example_plugin.go
+1
-1
plugin_watcher.go
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
+1
-1
plugin_watcher_test.go
pkg/kubelet/util/pluginwatcher/plugin_watcher_test.go
+1
-1
No files found.
pkg/features/kube_features.go
View file @
843a67b2
...
@@ -331,7 +331,7 @@ const (
...
@@ -331,7 +331,7 @@ const (
VolumeSubpathEnvExpansion
utilfeature
.
Feature
=
"VolumeSubpathEnvExpansion"
VolumeSubpathEnvExpansion
utilfeature
.
Feature
=
"VolumeSubpathEnvExpansion"
// owner: @vikaschoudhary16
// owner: @vikaschoudhary16
//
alpha: v1.11
//
GA: v1.13
//
//
//
//
// Enable probe based plugin watcher utility for discovering Kubelet plugins
// Enable probe based plugin watcher utility for discovering Kubelet plugins
...
@@ -444,7 +444,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
...
@@ -444,7 +444,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
BalanceAttachedNodeVolumes
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
BalanceAttachedNodeVolumes
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
PodReadinessGates
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
PodReadinessGates
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
VolumeSubpathEnvExpansion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeSubpathEnvExpansion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
KubeletPluginsWatcher
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
KubeletPluginsWatcher
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
ResourceQuotaScopeSelectors
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
ResourceQuotaScopeSelectors
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CSIBlockVolume
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
CSIBlockVolume
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
RuntimeClass
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
RuntimeClass
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
...
...
pkg/kubelet/BUILD
View file @
843a67b2
...
@@ -46,7 +46,7 @@ go_library(
...
@@ -46,7 +46,7 @@ go_library(
"//pkg/kubelet/apis/config:go_default_library",
"//pkg/kubelet/apis/config:go_default_library",
"//pkg/kubelet/apis/cri:go_default_library",
"//pkg/kubelet/apis/cri:go_default_library",
"//pkg/kubelet/apis/cri/runtime/v1alpha2:go_default_library",
"//pkg/kubelet/apis/cri/runtime/v1alpha2:go_default_library",
"//pkg/kubelet/apis/pluginregistration/v1
alpha1
:go_default_library",
"//pkg/kubelet/apis/pluginregistration/v1:go_default_library",
"//pkg/kubelet/cadvisor:go_default_library",
"//pkg/kubelet/cadvisor:go_default_library",
"//pkg/kubelet/certificate:go_default_library",
"//pkg/kubelet/certificate:go_default_library",
"//pkg/kubelet/checkpointmanager:go_default_library",
"//pkg/kubelet/checkpointmanager:go_default_library",
...
...
pkg/kubelet/apis/BUILD
View file @
843a67b2
...
@@ -37,6 +37,7 @@ filegroup(
...
@@ -37,6 +37,7 @@ filegroup(
"//pkg/kubelet/apis/cri:all-srcs",
"//pkg/kubelet/apis/cri:all-srcs",
"//pkg/kubelet/apis/deviceplugin/v1alpha:all-srcs",
"//pkg/kubelet/apis/deviceplugin/v1alpha:all-srcs",
"//pkg/kubelet/apis/deviceplugin/v1beta1:all-srcs",
"//pkg/kubelet/apis/deviceplugin/v1beta1:all-srcs",
"//pkg/kubelet/apis/pluginregistration/v1:all-srcs",
"//pkg/kubelet/apis/pluginregistration/v1alpha1:all-srcs",
"//pkg/kubelet/apis/pluginregistration/v1alpha1:all-srcs",
"//pkg/kubelet/apis/pluginregistration/v1beta1:all-srcs",
"//pkg/kubelet/apis/pluginregistration/v1beta1:all-srcs",
"//pkg/kubelet/apis/stats/v1alpha1:all-srcs",
"//pkg/kubelet/apis/stats/v1alpha1:all-srcs",
...
...
pkg/kubelet/apis/pluginregistration/v1/BUILD
0 → 100644
View file @
843a67b2
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"api.pb.go",
"constants.go",
],
importpath = "k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1",
deps = [
"//vendor/github.com/gogo/protobuf/gogoproto:go_default_library",
"//vendor/github.com/gogo/protobuf/proto:go_default_library",
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/google.golang.org/grpc:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
pkg/kubelet/apis/pluginregistration/v1/api.pb.go
0 → 100644
View file @
843a67b2
This diff is collapsed.
Click to expand it.
pkg/kubelet/apis/pluginregistration/v1/api.proto
0 → 100644
View file @
843a67b2
// To regenerate api.pb.go run hack/update-generated-kubelet-plugin-registration.sh
syntax
=
'proto3'
;
package
pluginregistration
;
import
"github.com/gogo/protobuf/gogoproto/gogo.proto"
;
option
(
gogoproto.goproto_stringer_all
)
=
false
;
option
(
gogoproto.stringer_all
)
=
true
;
option
(
gogoproto.goproto_getters_all
)
=
true
;
option
(
gogoproto.marshaler_all
)
=
true
;
option
(
gogoproto.sizer_all
)
=
true
;
option
(
gogoproto.unmarshaler_all
)
=
true
;
option
(
gogoproto.goproto_unrecognized_all
)
=
false
;
// PluginInfo is the message sent from a plugin to the Kubelet pluginwatcher for plugin registration
message
PluginInfo
{
// Type of the Plugin. CSIPlugin or DevicePlugin
string
type
=
1
;
// Plugin name that uniquely identifies the plugin for the given plugin type.
// For DevicePlugin, this is the resource name that the plugin manages and
// should follow the extended resource name convention.
// For CSI, this is the CSI driver registrar name.
string
name
=
2
;
// Optional endpoint location. If found set by Kubelet component,
// Kubelet component will use this endpoint for specific requests.
// This allows the plugin to register using one endpoint and possibly use
// a different socket for control operations. CSI uses this model to delegate
// its registration external from the plugin.
string
endpoint
=
3
;
// Plugin service API versions the plugin supports.
// For DevicePlugin, this maps to the deviceplugin API versions the
// plugin supports at the given socket.
// The Kubelet component communicating with the plugin should be able
// to choose any preferred version from this list, or returns an error
// if none of the listed versions is supported.
repeated
string
supported_versions
=
4
;
}
// RegistrationStatus is the message sent from Kubelet pluginwatcher to the plugin for notification on registration status
message
RegistrationStatus
{
// True if plugin gets registered successfully at Kubelet
bool
plugin_registered
=
1
;
// Error message in case plugin fails to register, empty string otherwise
string
error
=
2
;
}
// RegistrationStatusResponse is sent by plugin to kubelet in response to RegistrationStatus RPC
message
RegistrationStatusResponse
{
}
// InfoRequest is the empty request message from Kubelet
message
InfoRequest
{
}
// Registration is the service advertised by the Plugins.
service
Registration
{
rpc
GetInfo
(
InfoRequest
)
returns
(
PluginInfo
)
{}
rpc
NotifyRegistrationStatus
(
RegistrationStatus
)
returns
(
RegistrationStatusResponse
)
{}
}
pkg/kubelet/apis/pluginregistration/v1/constants.go
0 → 100644
View file @
843a67b2
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
pluginregistration
const
(
// CSIPlugin identifier for registered CSI plugins
CSIPlugin
=
"CSIPlugin"
// DevicePlugin identifier for registered device plugins
DevicePlugin
=
"DevicePlugin"
)
pkg/kubelet/kubelet.go
View file @
843a67b2
...
@@ -59,7 +59,7 @@ import (
...
@@ -59,7 +59,7 @@ import (
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/features"
kubeletconfiginternal
"k8s.io/kubernetes/pkg/kubelet/apis/config"
kubeletconfiginternal
"k8s.io/kubernetes/pkg/kubelet/apis/config"
internalapi
"k8s.io/kubernetes/pkg/kubelet/apis/cri"
internalapi
"k8s.io/kubernetes/pkg/kubelet/apis/cri"
pluginwatcherapi
"k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1
alpha1
"
pluginwatcherapi
"k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1"
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
kubeletcertificate
"k8s.io/kubernetes/pkg/kubelet/certificate"
kubeletcertificate
"k8s.io/kubernetes/pkg/kubelet/certificate"
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager"
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager"
...
@@ -1378,7 +1378,7 @@ func (kl *Kubelet) initializeRuntimeDependentModules() {
...
@@ -1378,7 +1378,7 @@ func (kl *Kubelet) initializeRuntimeDependentModules() {
kl
.
containerLogManager
.
Start
()
kl
.
containerLogManager
.
Start
()
if
kl
.
enablePluginsWatcher
{
if
kl
.
enablePluginsWatcher
{
// Adding Registration Callback function for CSI Driver
// Adding Registration Callback function for CSI Driver
kl
.
pluginWatcher
.
AddHandler
(
"CSIPlugin"
,
pluginwatcher
.
PluginHandler
(
csi
.
PluginHandler
))
kl
.
pluginWatcher
.
AddHandler
(
pluginwatcherapi
.
CSIPlugin
,
pluginwatcher
.
PluginHandler
(
csi
.
PluginHandler
))
// Adding Registration Callback function for Device Manager
// Adding Registration Callback function for Device Manager
kl
.
pluginWatcher
.
AddHandler
(
pluginwatcherapi
.
DevicePlugin
,
kl
.
containerManager
.
GetPluginRegistrationHandler
())
kl
.
pluginWatcher
.
AddHandler
(
pluginwatcherapi
.
DevicePlugin
,
kl
.
containerManager
.
GetPluginRegistrationHandler
())
// Start the plugin watcher
// Start the plugin watcher
...
...
pkg/kubelet/util/pluginwatcher/BUILD
View file @
843a67b2
...
@@ -11,7 +11,7 @@ go_library(
...
@@ -11,7 +11,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/kubelet/util/pluginwatcher",
importpath = "k8s.io/kubernetes/pkg/kubelet/util/pluginwatcher",
visibility = ["//visibility:public"],
visibility = ["//visibility:public"],
deps = [
deps = [
"//pkg/kubelet/apis/pluginregistration/v1
alpha1
:go_default_library",
"//pkg/kubelet/apis/pluginregistration/v1:go_default_library",
"//pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta1:go_default_library",
"//pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta1:go_default_library",
"//pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta2:go_default_library",
"//pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta2:go_default_library",
"//pkg/util/filesystem:go_default_library",
"//pkg/util/filesystem:go_default_library",
...
@@ -28,7 +28,7 @@ go_test(
...
@@ -28,7 +28,7 @@ go_test(
srcs = ["plugin_watcher_test.go"],
srcs = ["plugin_watcher_test.go"],
embed = [":go_default_library"],
embed = [":go_default_library"],
deps = [
deps = [
"//pkg/kubelet/apis/pluginregistration/v1
alpha1
:go_default_library",
"//pkg/kubelet/apis/pluginregistration/v1:go_default_library",
"//vendor/github.com/stretchr/testify/require:go_default_library",
"//vendor/github.com/stretchr/testify/require:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
],
],
...
...
pkg/kubelet/util/pluginwatcher/example_plugin.go
View file @
843a67b2
...
@@ -28,7 +28,7 @@ import (
...
@@ -28,7 +28,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc"
"k8s.io/klog"
"k8s.io/klog"
registerapi
"k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1
alpha1
"
registerapi
"k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1"
v1beta1
"k8s.io/kubernetes/pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta1"
v1beta1
"k8s.io/kubernetes/pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta1"
v1beta2
"k8s.io/kubernetes/pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta2"
v1beta2
"k8s.io/kubernetes/pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta2"
)
)
...
...
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
View file @
843a67b2
...
@@ -30,7 +30,7 @@ import (
...
@@ -30,7 +30,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc"
"k8s.io/klog"
"k8s.io/klog"
registerapi
"k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1
alpha1
"
registerapi
"k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1"
utilfs
"k8s.io/kubernetes/pkg/util/filesystem"
utilfs
"k8s.io/kubernetes/pkg/util/filesystem"
)
)
...
...
pkg/kubelet/util/pluginwatcher/plugin_watcher_test.go
View file @
843a67b2
...
@@ -28,7 +28,7 @@ import (
...
@@ -28,7 +28,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"k8s.io/klog"
"k8s.io/klog"
registerapi
"k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1
alpha1
"
registerapi
"k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1"
)
)
var
(
var
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment