This repository was archived by the owner on Dec 21, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Adds command line parameter to control the pod cidr the agent requests from Kubernetes #50
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
125a461
Changed the pod cidr that our kubelet reports to the cluster to an em…
soenkeliebau 3b1476f
Added command line parameter to control the setting of pod cidr range.
soenkeliebau bcfcdef
Reverted change that is already included in a PR in review.
soenkeliebau f508d6a
Removed debug log
soenkeliebau c2a0ec5
Set rust channel to stable for clippy action to see if that fixes the…
soenkeliebau 63a0adf
Addressed comments from Lars.
soenkeliebau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,7 @@ | ||
| This setting controls the pod address range that the agent reports to Kubernetes. | ||
| The effect of this setting is that Kubernetes will reserve address blocks from withhin this range for every node. | ||
| Depending on the setting for maximum pods per node, these will be larger or smaller ranges, and influence the maximum number of nodes for the cluster. | ||
|
|
||
| The agent does not require any pod address ranges, and by default doesn't specify anything for this setting. | ||
|
|
||
| WARNING: There should almost never be a reason to use this setting, this is mostly here for very special circumstances. Do not touch it unless you really know what you're doing. | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ pub struct AgentConfig { | |
| pub server_cert_file: Option<PathBuf>, | ||
| pub server_key_file: Option<PathBuf>, | ||
| pub tags: HashMap<String, String>, | ||
| pub pod_cidr: String, | ||
| } | ||
|
|
||
| impl AgentConfig { | ||
|
|
@@ -158,6 +159,16 @@ impl AgentConfig { | |
| list: true | ||
| }; | ||
|
|
||
| pub const POD_CIDR: ConfigOption = ConfigOption { | ||
| name: "pod-cidr", | ||
| default: Some(""), | ||
| required: false, | ||
| takes_argument: true, | ||
| help: "An IP range in CIDR notation which designates the range that pods assigned to this node should have their ip addresses in.", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's one more "ip" in here. |
||
| documentation: include_str!("config_documentation/pod_cidr.adoc"), | ||
| list: false | ||
| }; | ||
|
|
||
| fn get_options() -> HashSet<ConfigOption> { | ||
| [ | ||
| AgentConfig::HOSTNAME, | ||
|
|
@@ -172,6 +183,7 @@ impl AgentConfig { | |
| AgentConfig::NO_CONFIG, | ||
| AgentConfig::TAG, | ||
| AgentConfig::BOOTSTRAP_FILE, | ||
| AgentConfig::POD_CIDR, | ||
| ] | ||
| .iter() | ||
| .cloned() | ||
|
|
@@ -376,6 +388,13 @@ impl Configurable for AgentConfig { | |
| error_list.as_mut(), | ||
| ); | ||
|
|
||
| // Parse pod cidr | ||
| let final_pod_cidr: Result<String, anyhow::Error> = AgentConfig::get_with_default( | ||
| &parsed_values, | ||
| &AgentConfig::POD_CIDR, | ||
| error_list.as_mut(), | ||
| ); | ||
|
|
||
| // Parse cert file | ||
| let final_server_cert_file = if let Ok(server_cert_file) = | ||
| AgentConfig::get_exactly_one_string(&parsed_values, &AgentConfig::SERVER_CERT_FILE) | ||
|
|
@@ -454,6 +473,7 @@ impl Configurable for AgentConfig { | |
| server_cert_file: final_server_cert_file, | ||
| server_key_file: final_server_key_file, | ||
| tags: final_tags, | ||
| pod_cidr: final_pod_cidr.unwrap(), | ||
| }) | ||
| } | ||
| } | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.