Commit Graph

49 Commits

Author SHA1 Message Date
Kevin Klues 704590723f Update kubeletplugin API for DynamicResourceAllocation to v1alpha2
This PR makes the NodePrepareResources() and NodeUnprepareResource()
calls of the kubeletplugin API for DynamicResourceAllocation
symmetrical. It wasn't clear how one would use the set of CDIDevices
passed back in the NodeUnprepareResource() of the v1alpha1 API, and the
new API now passes back the full ResourceHandle that was originally
passed to the Prepare() call. Passing the ResourceHandle is strictly
more informative and a plugin could always (re)derive the set of
CDIDevice from it.

This is a breaking change, but this release is scheduled to break
multiple APIs for DynamicResourceAllocation, so it makes sense to do
this now instead of later.

Signed-off-by: Kevin Klues <kklues@nvidia.com>

Kubernetes-commit: 579295e727a12deadad9e084ff8efd2708707091
2023-03-13 21:38:56 +00:00
Moshe Levi 0ce2bcfd40 kubelet podresources: extend List to support Dynamic Resources and implement Get API
Signed-off-by: Moshe Levi <moshele@nvidia.com>

Kubernetes-commit: 2a568bcfc821edd46e43cd072ba2a23456c9605e
2023-03-14 01:34:54 +02:00
Tim Hockin 852ac9b509 Set proto go_package: kubelet plugin register API
This exposes that the hand-written code used the wrong package name.

This also creates some diff to the *.pb.go files to note that in the
"options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```

Kubernetes-commit: bc1103e45fc82682b62c02d1fcd65a46cea3f9d6
2023-01-14 10:37:06 -08:00
Tim Hockin 558a8ec0e0 Set proto go_package: kubelet deviceplugin API
This exposes that the hand-written code used the wrong package name.

This also creates some diff to the *.pb.go files to note that in the
"options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```

Kubernetes-commit: 22ddeb02c1e7245ad3e8ae6835f2bd9ac10c3497
2023-01-14 10:27:13 -08:00
Tim Hockin d0ffd0e221 Set proto go_package: kubelet dynamic resource API
This package was specifying the option, but wrongly.

This also creates some diff to the *.pb.go files to note that in the
"options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```

Kubernetes-commit: e4e26a7f0c30c669fa23186cbe5d2e41a6dc5b45
2023-01-14 10:30:08 -08:00
Tim Hockin 189da6f245 Set proto go_package: podresources API
This creates some diff to the *.pb.go files to note that
in the "options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```

Kubernetes-commit: a2603fdb81ab2160ec80f2063a258d18854e80e3
2023-01-14 10:22:56 -08:00
Tim Hockin 62e4faf81a Call update-proto-bindings from update-codegen
One script to bring them all ...

Kubernetes-commit: 4dae505d531e149881788dc36148602967419c75
2023-01-05 15:41:51 -08:00
Tim Hockin 16286abe1c Merge 5 fragile proto-bindings scripts into 1
Each of these scripts is basically identical, and all were too brittle.
Now they should be more resilient and easier to manage.  The script
still needs to be updated if we add new ones, which I do not love.

More cleanup to follow.

Kubernetes-commit: e0ecccff3f5148cc167117ac73233b4edc1640d8
2023-01-05 13:53:59 -08:00
Tim Hockin c1747f501f Fix kubelet-plugin-registration to add missing dir
include v1

This is far too manual for my tastes, which will be fixed subsequently.

Kubernetes-commit: 01e1da77e29d14b12c05cda6928fd55688f9b49f
2023-01-04 14:36:40 -08:00
Tim Hockin 5b9f32bd9e Fix generated-pod-resources to add missing dir
include v1alpha1

This is too manual - will be fixed subsequently

Kubernetes-commit: 4e48506245ede8cc427b35e2d4d0b39495799e2f
2023-01-04 14:42:32 -08:00
Ed Bartosh 94804a4df3 kubelet: add support for dynamic resource allocation
Dependencies need to be updated to use
github.com/container-orchestrated-devices/container-device-interface.

It's not decided yet whether we will implement Topology support
for DRA or not. Not having any toppology-related code
will help to avoid wrong impression that DRA is used as a hint
provider for the Topology Manager.

Kubernetes-commit: ae0f38437cbb5c2b515384cb9f7dea5d808b87c4
2022-07-15 14:28:18 +03:00
Dixita Narang f111908a77 Adding files generated from running make generate and update commands
Kubernetes-commit: 875920037a072ec9b34d598795a69f5c3ea8eaa3
2022-09-07 21:35:46 +00:00
Dixita Narang b08fd49123 Renaming usage of v1beta1 to v1, and adding API violation exceptions and
vendor module for v1

Kubernetes-commit: 977a8ebb3a4be17d14c11476c27bd77a80e8ef32
2022-08-01 19:21:30 +00:00
Dixita Narang be0bf1c6ed Copying over credentialprovider v1beta1 packages to v1
Kubernetes-commit: 87f1102ee92a0a37bc6ffaba0d2b68a6689f980d
2022-08-01 18:18:02 +00:00
Davanum Srinivas 279c758121 Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: a9593d634c6a053848413e600dadbf974627515f
2022-07-19 20:54:13 -04:00
Kubernetes Prow Robot f260aecdca Merge pull request #105585 from fengzixu/improvement-volume-health
add volume kubelet_volume_stats_health_abnormal to kubelet

Kubernetes-commit: 5cb6fab8f6336990cc58f7cb6abffc6ad178121b
2022-03-15 05:58:11 -07:00
Aditi Sharma f53431b6d9 Move feature flag credential provider to beta
Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>

Kubernetes-commit: ed16ef22061a8246236e0049a34d7cf305462e34
2022-03-21 17:55:07 +05:30
Maciej Borsz d4cbffc87a Revert "add volume kubelet_volume_stats_health_abnormal to kubelet"
Kubernetes-commit: aa955139822408eb00d94f9a3f9a837ebaf40eb8
2022-03-16 13:44:09 +01:00
fengzixu aeed20c105 add volumeHealth label to metrics
Kubernetes-commit: ed7fd0ced579b6feec7bde79b0981309020ef911
2021-11-26 10:50:24 +09:00
fengzixu e01e1fdf18 add volume kubelet_volume_stats_health_abnormal to kubelet
Kubernetes-commit: d71e21e01eca04b137b452bbcd6147a050a2f690
2021-10-09 15:37:43 +09:00
Eric Lin 958d2c6f3e Consider threads-max when deciding MaxPID.
Fixes kubernetes#107111

Kubernetes-commit: fea15977c865c4c00cedbcad647890c71c8c1cca
2021-12-17 20:56:23 +00:00
Davanum Srinivas e94dab0e48 OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9682b7248fb69733c2a0ee53618856e87b067f16
2022-01-03 10:59:47 -05:00
Davanum Srinivas 00d6744c8e Cleanup OWNERS files (No Activity in the last year)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 497e9c1971c9e7d0193bc6d11503ec4ad527f1d5
2021-12-10 15:18:50 -05:00
Davanum Srinivas 7a49d3b22e Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9405e9b55ebcd461f161859a698b949ea3bde31d
2021-12-09 21:31:26 -05:00
Stephen Augustus 6036977e4a generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 481cf6fbe753b9eb2a47ced179211206b0a99540
2021-08-12 17:13:11 -04:00
Artyom Lukianov 93cd3d97e3 Extend pod resource API response to return the memory manager information
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>

Kubernetes-commit: 24023f9fcc7a2031d81a53add1e0054319f0b0f0
2021-04-05 17:15:36 +03:00
Angus Lees bcb28af0cf Rename deviceIDs -> device_ids to follow protobuf naming conventions
The protocol buffer [styleguide] says field names should use
underscore_separated_names.

Code generation tools rely on this convention to split words and
generate language-specific accessors/properties in the local style
conventions (ie: it's more than just a style convention).  For
example, the previous `deviceIDs` name caused Rust proto tools to
generate field names like `device_i_ds` which is just weird.

[styleguide]: https://developers.google.com/protocol-buffers/docs/style#message-and-field-names

Rename `deviceIDs` field to `device_ids`, and use a gogo-specific
option to keep the existing `DeviceIDs` golang name (otherwise it
would generate `DeviceIds`).

Note this doesn't affect protocol buffer / gRPC wire encoding, which
uses numeric values.

Kubernetes-commit: 815dcd5b3174f9ccaa3789f1b688a809223ca860
2020-06-05 12:27:02 +10:00
Francesco Romani 5bb58afe54 node: podresources: add generated files
Signed-off-by: Francesco Romani <fromani@redhat.com>

Kubernetes-commit: 8b79ad65335d5f82822aba64ef436c519dcfdef3
2021-02-03 16:26:16 +01:00
Francesco Romani f73b3cd2cb node: podresources: add GetAllocatableResources API
Extend the podresources API adding the GetAllocatableResources endpoint,
as specified in the KEP
https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2043-pod-resource-concrete-assigments

Signed-off-by: Francesco Romani <fromani@redhat.com>

Kubernetes-commit: c44f8214dbd6072416acf3b3ad405838ccf4e93c
2020-11-11 10:30:58 +01:00
Michael Beaumont 4757857c4a Move pkg/kubelet/apis to k8s.io/kubelet/pkg/apis
Kubernetes-commit: a5a6762d33743521e1696113143ea66b3072a224
2021-02-09 19:47:42 +01:00
Nabarun Pal 916f97b0c2 update gogo/protobuf to v1.3.2
gogo/protobuf@v1.3.2 fixes https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3121

Ref: https://github.com/kubernetes/client-go/issues/927

Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>

Kubernetes-commit: 9cada2ec3ba793597606a1df1375ff8e8311ccf3
2021-01-27 18:01:27 +05:30
Carlos Panato a22c6a5382 [go1.15] updatestaging pb.go files using the hack scripts
Kubernetes-commit: 3dec5781ade54eb47cf8d1dc8428f33d8739f10b
2021-01-27 11:50:33 +01:00
Anthony ARNAUD 3f4a6a9389 Port deviceManager in windows container manager
Kubernetes-commit: 8bdc3d897018862c654a7fb0b4094abd7df45eb2
2020-07-21 12:35:49 +02:00
Andrew Sy Kim e1ef77d075 kubelet: add initial credentialprovider v1alpha1 APIs
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>

Kubernetes-commit: 2d0dd26252a91d8eccf460c41d6eff3f0462f2fa
2020-11-10 13:44:06 -05:00
Alexey Perevalov 77bc9b8ae4 Generate podresources API for TopologyInfo and cpu_ids
Signed-off-by: Alexey Perevalov <alexey.perevalov@huawei.com>

Kubernetes-commit: db0a515be0cfc3fe10ff6b48212dd56ea3bb50c2
2020-10-28 12:43:13 +03:00
Alexey Perevalov 8001f72d88 Add TopologyInfo and cpu_ids into podresources
Signed-off-by: Alexey Perevalov <alexey.perevalov@huawei.com>

Kubernetes-commit: ce921c039b933d4ec9ccb2c3db0aea3b9c56283a
2020-10-22 11:47:34 +03:00
Renaud Gaubert 3a7ef55e24 Update generated files
Kubernetes-commit: 68cf24c087752ace54fea33678d063196afd285e
2020-10-10 12:57:15 -07:00
Renaud Gaubert 8fadf102c0 Add podresources v1 API
Kubernetes-commit: a989bece009496c7d862d42fd32cab9eaf3a21f2
2020-10-10 12:54:21 -07:00
Marek Siarkowicz 21d52241c5 Move Kubelet Summary API to staging repo
Kubernetes-commit: 7d309e0104fedb57280b261e5677d919cb2a0e2d
2020-07-11 12:59:52 +02:00
Renaud Gaubert 86eb171868 Move podresources api to k8s.io/kubelet/pkg/apis
Signed-off-by: Renaud Gaubert <rgaubert@nvidia.com>

Kubernetes-commit: 60304452ffd0f6ce1e58d1806ab9fdc33cdefb17
2020-06-30 04:46:33 +00:00
David Ashpole c5a2be5f9e consistently use double quotes in proto files
Kubernetes-commit: 296f7c91bb52cd724ce6d6d120d5d41ed459d677
2020-09-03 13:50:03 -07:00
Jeremy Shih 96b39cb21c fix golint failures
some packages under staging/src/k8s.io/sample-apiserver/

Kubernetes-commit: a39f502fc058fbba8258a84617a6ed3700ee4343
2020-08-31 17:17:28 +08:00
Kevin Klues 83a091b032 Add GetPreferredAllocation() call to the device plugin api.proto
The details of this API can be found in:
https://github.com/kubernetes/enhancements/pull/1121

Kubernetes-commit: 202c4f0816be76ece0a9ba8b94192f458e55b35a
2020-07-02 15:15:46 +00:00
Kevin Klues 4e51df3aae Update whitespace in device plugin api.proto
Kubernetes-commit: 9c4198952413685106fa4aef0537154a08e900fd
2020-07-02 15:15:41 +00:00
drfish 97d98d762a Fix typo from reseting to resetting
Kubernetes-commit: 5a44cd65fd9687410003a5933203f01ff9299ea1
2020-01-10 21:35:06 +08:00
Davanum Srinivas b929782e22 update generated files
Kubernetes-commit: b3853138a4f1a0637ec3c38a5c59f8228765b261
2020-01-13 17:56:56 -05:00
chenyaqi01 76f250ec4d Fix device plugin generator script
Kubernetes-commit: fa9a55617bbbbe274195f9f2915e7364c1cb3de5
2019-11-20 12:53:09 +08:00
chenyaqi01 56e9dcaef1 fix inconsistent comment in device plugin api
Kubernetes-commit: f8d3c45d1a9fb25ab3df697a0a59c05c7d60d586
2019-10-11 10:26:19 +08:00
Davanum Srinivas 4398d8f461 Move pkg/kubelet/pluginregistration and deviceplugin
Change-Id: I06adcb43bd278b430ffad2010869e1524c8cc4ff

Kubernetes-commit: d30c489c54c5e6d41ae3a1e1fcd96d24dba4fc51
2019-10-06 15:24:24 -04:00