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
f8e80e45
Commit
f8e80e45
authored
Sep 04, 2018
by
Renaud Gaubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create pkg/kubelet/apis/pluginregistration/v1beta1 directory
parent
7548764f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
109 additions
and
13 deletions
+109
-13
.golint_failures
hack/.golint_failures
+1
-0
update-generated-kubelet-plugin-registration-dockerized.sh
...pdate-generated-kubelet-plugin-registration-dockerized.sh
+4
-2
verify-generated-kubelet-plugin-registration.sh
hack/verify-generated-kubelet-plugin-registration.sh
+16
-5
api.proto
pkg/kubelet/apis/pluginregistration/v1alpha1/api.proto
+6
-6
api.proto
pkg/kubelet/apis/pluginregistration/v1beta1/api.proto
+60
-0
constants.go
pkg/kubelet/apis/pluginregistration/v1beta1/constants.go
+22
-0
No files found.
hack/.golint_failures
View file @
f8e80e45
...
@@ -185,6 +185,7 @@ pkg/kubelet/apis/cri/testing
...
@@ -185,6 +185,7 @@ pkg/kubelet/apis/cri/testing
pkg/kubelet/apis/deviceplugin/v1alpha
pkg/kubelet/apis/deviceplugin/v1alpha
pkg/kubelet/apis/deviceplugin/v1beta1
pkg/kubelet/apis/deviceplugin/v1beta1
pkg/kubelet/apis/pluginregistration/v1alpha1
pkg/kubelet/apis/pluginregistration/v1alpha1
pkg/kubelet/apis/pluginregistration/v1beta1
pkg/kubelet/cadvisor
pkg/kubelet/cadvisor
pkg/kubelet/cadvisor/testing
pkg/kubelet/cadvisor/testing
pkg/kubelet/checkpoint
pkg/kubelet/checkpoint
...
...
hack/update-generated-kubelet-plugin-registration-dockerized.sh
View file @
f8e80e45
...
@@ -19,11 +19,13 @@ set -o nounset
...
@@ -19,11 +19,13 @@ set -o nounset
set
-o
pipefail
set
-o
pipefail
KUBE_ROOT
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../"
&&
pwd
-P
)
"
KUBE_ROOT
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../"
&&
pwd
-P
)
"
KUBELET_PLUGIN_REGISTRATION_ROOT
=
"
${
KUBE_ROOT
}
/pkg/kubelet/apis/pluginregistration/v1alpha1/"
KUBELET_PLUGIN_REGISTRATION_V1ALPHA
=
"
${
KUBE_ROOT
}
/pkg/kubelet/apis/pluginregistration/v1alpha1/"
KUBELET_PLUGIN_REGISTRATION_V1BETA
=
"
${
KUBE_ROOT
}
/pkg/kubelet/apis/pluginregistration/v1beta1/"
KUBELET_EXAMPLE_PLUGIN_V1BETA1
=
"
${
KUBE_ROOT
}
/pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta1/"
KUBELET_EXAMPLE_PLUGIN_V1BETA1
=
"
${
KUBE_ROOT
}
/pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta1/"
KUBELET_EXAMPLE_PLUGIN_V1BETA2
=
"
${
KUBE_ROOT
}
/pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta2/"
KUBELET_EXAMPLE_PLUGIN_V1BETA2
=
"
${
KUBE_ROOT
}
/pkg/kubelet/util/pluginwatcher/example_plugin_apis/v1beta2/"
source
"
${
KUBE_ROOT
}
/hack/lib/protoc.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/protoc.sh"
kube::protoc::generate_proto
${
KUBELET_PLUGIN_REGISTRATION_ROOT
}
kube::protoc::generate_proto
${
KUBELET_PLUGIN_REGISTRATION_V1ALPHA
}
kube::protoc::generate_proto
${
KUBELET_PLUGIN_REGISTRATION_V1BETA
}
kube::protoc::generate_proto
${
KUBELET_EXAMPLE_PLUGIN_V1BETA1
}
kube::protoc::generate_proto
${
KUBELET_EXAMPLE_PLUGIN_V1BETA1
}
kube::protoc::generate_proto
${
KUBELET_EXAMPLE_PLUGIN_V1BETA2
}
kube::protoc::generate_proto
${
KUBELET_EXAMPLE_PLUGIN_V1BETA2
}
hack/verify-generated-kubelet-plugin-registration.sh
View file @
f8e80e45
...
@@ -20,20 +20,31 @@ set -o pipefail
...
@@ -20,20 +20,31 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
ERROR
=
"Kubelet Plugin Registration api is out of date. Please run hack/update-generated-kubelet-plugin-registration.sh"
ERROR
=
"Kubelet Plugin Registration api is out of date. Please run hack/update-generated-kubelet-plugin-registration.sh"
KUBELET_PLUGIN_REGISTRATION_ROOT
=
"
${
KUBE_ROOT
}
/pkg/kubelet/apis/pluginregistration/v1alpha1/"
KUBELET_PLUGIN_REGISTRATION_V1ALPHA
=
"
${
KUBE_ROOT
}
/pkg/kubelet/apis/pluginregistration/v1alpha1/"
KUBELET_PLUGIN_REGISTRATION_V1BETA
=
"
${
KUBE_ROOT
}
/pkg/kubelet/apis/pluginregistration/v1beta1/"
source
"
${
KUBE_ROOT
}
/hack/lib/protoc.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/protoc.sh"
kube::golang::setup_env
kube::golang::setup_env
function
cleanup
{
function
cleanup
{
rm
-rf
${
KUBELET_PLUGIN_REGISTRATION_ROOT
}
/_tmp/
rm
-rf
${
KUBELET_PLUGIN_REGISTRATION_V1ALPHA
}
/_tmp/
rm
-rf
${
KUBELET_PLUGIN_REGISTRATION_V1BETA
}
/_tmp/
}
}
trap
cleanup EXIT
trap
cleanup EXIT
mkdir
-p
${
KUBELET_PLUGIN_REGISTRATION_
ROOT
}
/_tmp
mkdir
-p
${
KUBELET_PLUGIN_REGISTRATION_
V1ALPHA
}
/_tmp
cp
${
KUBELET_PLUGIN_REGISTRATION_ROOT
}
/api.pb.go
${
KUBELET_PLUGIN_REGISTRATION_ROOT
}
/_tmp/
mkdir
-p
${
KUBELET_PLUGIN_REGISTRATION_V1BETA
}
/_tmp
cp
${
KUBELET_PLUGIN_REGISTRATION_V1ALPHA
}
/api.pb.go
${
KUBELET_PLUGIN_REGISTRATION_V1ALPHA
}
/_tmp/
cp
${
KUBELET_PLUGIN_REGISTRATION_V1BETA
}
/api.pb.go
${
KUBELET_PLUGIN_REGISTRATION_V1BETA
}
/_tmp/
# Check V1Alpha
KUBE_VERBOSE
=
3
"
${
KUBE_ROOT
}
/hack/update-generated-kubelet-plugin-registration.sh"
kube::protoc::diff
"
${
KUBELET_PLUGIN_REGISTRATION_V1ALPHA
}
/api.pb.go"
"
${
KUBELET_PLUGIN_REGISTRATION_V1ALPHA
}
/_tmp/api.pb.go"
${
ERROR
}
echo
"Generated Kubelet Plugin Registration api is up to date."
# Check V1Beta
KUBE_VERBOSE
=
3
"
${
KUBE_ROOT
}
/hack/update-generated-kubelet-plugin-registration.sh"
KUBE_VERBOSE
=
3
"
${
KUBE_ROOT
}
/hack/update-generated-kubelet-plugin-registration.sh"
kube::protoc::diff
"
${
KUBELET_PLUGIN_REGISTRATION_
ROOT
}
/api.pb.go"
"
${
KUBELET_PLUGIN_REGISTRATION_ROOT
}
/_tmp/api.pb.go"
${
ERROR
}
kube::protoc::diff
"
${
KUBELET_PLUGIN_REGISTRATION_
V1BETA
}
/api.pb.go"
"
${
KUBELET_PLUGIN_REGISTRATION_V1BETA
}
/_tmp/api.pb.go"
${
ERROR
}
echo
"Generated Kubelet Plugin Registration api is up to date."
echo
"Generated Kubelet Plugin Registration api is up to date."
pkg/kubelet/apis/pluginregistration/v1alpha1/api.proto
View file @
f8e80e45
...
@@ -22,12 +22,12 @@ message PluginInfo {
...
@@ -22,12 +22,12 @@ message PluginInfo {
// should follow the extended resource name convention.
// should follow the extended resource name convention.
// For CSI, this is the CSI driver registrar name.
// For CSI, this is the CSI driver registrar name.
string
name
=
2
;
string
name
=
2
;
// Optional endpoint location. If found set by Kubelet component,
// Optional endpoint location. If found set by Kubelet component,
// Kubelet component will use this endpoint for specific requests.
// Kubelet component will use this endpoint for specific requests.
// This allows the plugin to register using one endpoint and possibly use
// This allows the plugin to register using one endpoint and possibly use
// a different socket for control operations. CSI uses this model to delegate
// a different socket for control operations. CSI uses this model to delegate
// its registration external from the plugin.
// its registration external from the plugin.
string
endpoint
=
3
;
string
endpoint
=
3
;
// Plugin service API versions the plugin supports.
// Plugin service API versions the plugin supports.
// For DevicePlugin, this maps to the deviceplugin API versions the
// For DevicePlugin, this maps to the deviceplugin API versions the
// plugin supports at the given socket.
// plugin supports at the given socket.
...
...
pkg/kubelet/apis/pluginregistration/v1beta1/api.proto
0 → 100644
View file @
f8e80e45
// 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/v1beta1/constants.go
0 → 100644
View file @
f8e80e45
/*
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
=
"CSIPlugin"
DevicePlugin
=
"DevicePlugin"
)
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