Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

models, kubernetes: add new provider-id setting #2192

Merged
merged 2 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ The following settings are optional and allow you to further configure your clus
* `settings.kubernetes.topology-manager-policy`: Specifies the topology manager policy. Possible values are `none`, `restricted`, `best-effort`, and `single-numa-node`. Defaults to `none`.
* `settings.kubernetes.topology-manager-scope`: Specifies the topology manager scope. Possible values are `container` and `pod`. Defaults to `container`. If you want to group all containers in a pod to a common set of NUMA nodes, you can set this setting to `pod`.
* `settings.kubernetes.pod-pids-limit`: The maximum number of processes per pod.
* `settings.kubernetes.provider-id`: This sets the unique ID of the instance that an external provider (i.e. cloudprovider) can use to identify a specific node.

You can also optionally specify static pods for your node with the following settings.
Static pods can be particularly useful when running in standalone mode.
Expand Down
3 changes: 2 additions & 1 deletion Release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,6 @@ version = "1.7.2"
"migrate_v1.8.0_etc-hosts.lz4",
"migrate_v1.8.0_etc-hosts-metadata.lz4",
"migrate_v1.8.0_cluster-dns-ip-list.lz4",
"migrate_v1.8.0_pki-affected-services.lz4"
"migrate_v1.8.0_pki-affected-services.lz4",
"migrate_v1.8.0_kubelet-provider-id.lz4"
]
3 changes: 3 additions & 0 deletions packages/kubernetes-1.19/kubelet-config
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ topologyManagerPolicy: {{settings.kubernetes.topology-manager-policy}}
{{#if settings.kubernetes.pod-pids-limit includeZero=true}}
podPidsLimit: {{settings.kubernetes.pod-pids-limit}}
{{/if}}
{{#if settings.kubernetes.provider-id}}
providerID: {{settings.kubernetes.provider-id}}
{{/if}}
resolvConf: "/etc/resolv.conf"
hairpinMode: hairpin-veth
readOnlyPort: 0
Expand Down
3 changes: 3 additions & 0 deletions packages/kubernetes-1.20/kubelet-config
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ topologyManagerPolicy: {{settings.kubernetes.topology-manager-policy}}
{{#if settings.kubernetes.pod-pids-limit includeZero=true}}
podPidsLimit: {{settings.kubernetes.pod-pids-limit}}
{{/if}}
{{#if settings.kubernetes.provider-id}}
providerID: {{settings.kubernetes.provider-id}}
{{/if}}
resolvConf: "/etc/resolv.conf"
hairpinMode: hairpin-veth
readOnlyPort: 0
Expand Down
3 changes: 3 additions & 0 deletions packages/kubernetes-1.21/kubelet-config
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ topologyManagerPolicy: {{settings.kubernetes.topology-manager-policy}}
{{#if settings.kubernetes.pod-pids-limit includeZero=true}}
podPidsLimit: {{settings.kubernetes.pod-pids-limit}}
{{/if}}
{{#if settings.kubernetes.provider-id}}
providerID: {{settings.kubernetes.provider-id}}
{{/if}}
resolvConf: "/etc/resolv.conf"
hairpinMode: hairpin-veth
readOnlyPort: 0
Expand Down
3 changes: 3 additions & 0 deletions packages/kubernetes-1.22/kubelet-config
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ topologyManagerPolicy: {{settings.kubernetes.topology-manager-policy}}
{{#if settings.kubernetes.pod-pids-limit includeZero=true}}
podPidsLimit: {{settings.kubernetes.pod-pids-limit}}
{{/if}}
{{#if settings.kubernetes.provider-id}}
providerID: {{settings.kubernetes.provider-id}}
{{/if}}
resolvConf: "/etc/resolv.conf"
hairpinMode: hairpin-veth
readOnlyPort: 0
Expand Down
3 changes: 3 additions & 0 deletions packages/kubernetes-1.23/kubelet-config
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ topologyManagerPolicy: {{settings.kubernetes.topology-manager-policy}}
{{#if settings.kubernetes.pod-pids-limit includeZero=true}}
podPidsLimit: {{settings.kubernetes.pod-pids-limit}}
{{/if}}
{{#if settings.kubernetes.provider-id}}
providerID: {{settings.kubernetes.provider-id}}
{{/if}}
resolvConf: "/etc/resolv.conf"
hairpinMode: hairpin-veth
readOnlyPort: 0
Expand Down
7 changes: 7 additions & 0 deletions sources/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ members = [
"api/migration/migrations/v1.8.0/etc-hosts-metadata",
"api/migration/migrations/v1.8.0/cluster-dns-ip-list",
"api/migration/migrations/v1.8.0/pki-affected-services",
"api/migration/migrations/v1.8.0/kubelet-provider-id",

"bottlerocket-release",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "kubelet-provider-id"
version = "0.1.0"
edition = "2018"
authors = ["Erikson Tung <etung@amazon.com>"]
license = "Apache-2.0 OR MIT"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
migration-helpers = { path = "../../../migration-helpers", version = "0.1.0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#![deny(rust_2018_idioms)]

use migration_helpers::common_migrations::AddSettingsMigration;
use migration_helpers::{migrate, Result};
use std::process;

/// We added a new setting for configuring kubelet's provider-id option, `settings.kubernetes.provider-id`
fn run() -> Result<()> {
migrate(AddSettingsMigration(&["settings.kubernetes.provider-id"]))
}

// 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);
}
}
1 change: 1 addition & 0 deletions sources/models/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ struct KubernetesSettings {
topology_manager_scope: TopologyManagerScope,
topology_manager_policy: TopologyManagerPolicy,
pod_pids_limit: i64,
provider_id: Url,
bcressey marked this conversation as resolved.
Show resolved Hide resolved

// Settings where we generate a value based on the runtime environment. The user can specify a
// value to override the generated one, but typically would not.
Expand Down