-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4345 from vigh-m/neuron-poc-bob
Add support for kubernetes device-ownership-from-security-context
- Loading branch information
Showing
19 changed files
with
152 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...defaults/aws-k8s-1.24-nvidia/defaults.d/55-kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/kubernetes-device-ownership-default-false.toml |
1 change: 1 addition & 0 deletions
1
...ttings-defaults/aws-k8s-1.24/defaults.d/55-kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/kubernetes-device-ownership-default-false.toml |
1 change: 1 addition & 0 deletions
1
...defaults/aws-k8s-1.25-nvidia/defaults.d/55-kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/kubernetes-device-ownership-default-false.toml |
1 change: 1 addition & 0 deletions
1
...ttings-defaults/aws-k8s-1.25/defaults.d/55-kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/kubernetes-device-ownership-default-false.toml |
1 change: 1 addition & 0 deletions
1
...defaults/aws-k8s-1.26-nvidia/defaults.d/55-kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/kubernetes-device-ownership-default-false.toml |
1 change: 1 addition & 0 deletions
1
...ttings-defaults/aws-k8s-1.26/defaults.d/55-kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/kubernetes-device-ownership-default-false.toml |
1 change: 1 addition & 0 deletions
1
...defaults/aws-k8s-1.31-nvidia/defaults.d/55-kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/kubernetes-device-ownership-default-false.toml |
1 change: 1 addition & 0 deletions
1
...ttings-defaults/aws-k8s-1.31/defaults.d/55-kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/kubernetes-device-ownership-default-false.toml |
1 change: 1 addition & 0 deletions
1
...ings-defaults/metal-k8s-1.30/defaults.d/55-kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/kubernetes-device-ownership-default-false.toml |
1 change: 1 addition & 0 deletions
1
...ngs-defaults/vmware-k8s-1.31/defaults.d/55-kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/kubernetes-device-ownership-default-false.toml |
15 changes: 15 additions & 0 deletions
15
sources/settings-migrations/v1.30.0/kubernetes-device-ownership-metadata/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "kubernetes-device-ownership-metadata" | ||
version = "0.1.0" | ||
authors = ["Vighnesh Maheshwari <vighmah@amazon.com>"] | ||
license = "Apache-2.0 OR MIT" | ||
edition = "2021" | ||
publish = false | ||
# Don't rebuild crate just because of changes to README. | ||
exclude = ["README.md"] | ||
|
||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
migration-helpers.workspace = true |
21 changes: 21 additions & 0 deletions
21
sources/settings-migrations/v1.30.0/kubernetes-device-ownership-metadata/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use migration_helpers::common_migrations::AddSettingsMigration; | ||
use migration_helpers::{migrate, Result}; | ||
use std::process; | ||
|
||
/// We added a new setting, `settings.kubernetes.device-ownership-from-security-context` to allow containers to gain | ||
/// ownership of the requested device | ||
fn run() -> Result<()> { | ||
migrate(AddSettingsMigration(&[ | ||
"settings.kubernetes.device-ownership-from-security-context", | ||
])) | ||
} | ||
|
||
// Returning a Result from main makes it print a Debug representation of the error, but with Snafu | ||
// we have nice Display representations of the error, so we wrap "main" (run) and print any error. | ||
// https://github.com/shepmaster/snafu/issues/110 | ||
fn main() { | ||
if let Err(e) = run() { | ||
eprintln!("{}", e); | ||
process::exit(1); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
sources/settings-migrations/v1.30.0/kubernetes-device-ownership-settings/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "kubernetes-device-ownership-settings" | ||
version = "0.1.0" | ||
authors = ["Vighnesh Maheshwari <vighmah@amazon.com>"] | ||
license = "Apache-2.0 OR MIT" | ||
edition = "2021" | ||
publish = false | ||
# Don't rebuild crate just because of changes to README. | ||
exclude = ["README.md"] | ||
|
||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
migration-helpers.workspace = true |
22 changes: 22 additions & 0 deletions
22
sources/settings-migrations/v1.30.0/kubernetes-device-ownership-settings/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use migration_helpers::common_migrations::{AddMetadataMigration, SettingMetadata}; | ||
use migration_helpers::{migrate, Result}; | ||
use std::process; | ||
|
||
/// We added a new setting, `settings.kubernetes.device-ownership-from-security-context` to allow containers to gain | ||
/// ownership of the requested device | ||
fn run() -> Result<()> { | ||
migrate(AddMetadataMigration(&[SettingMetadata { | ||
metadata: &["affected-services"], | ||
setting: "settings.kubernetes.device-ownership-from-security-context", | ||
}])) | ||
} | ||
|
||
// Returning a Result from main makes it print a Debug representation of the error, but with Snafu | ||
// we have nice Display representations of the error, so we wrap "main" (run) and print any error. | ||
// https://github.com/shepmaster/snafu/issues/110 | ||
fn main() { | ||
if let Err(e) = run() { | ||
eprintln!("{}", e); | ||
process::exit(1); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
sources/shared-defaults/kubernetes-device-ownership-default-false.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[settings.kubernetes] | ||
device-ownership-from-security-context = false | ||
|
||
[metadata.settings.kubernetes.device-ownership-from-security-context] | ||
affected-services = ["containerd"] |