-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Add doc on how to configure Kubelet with a file #5694
Merged
steveperry-53
merged 1 commit into
kubernetes:master
from
mtaufen:kubelet-config-file-docs
Oct 12, 2017
+78
−6
Merged
Changes from all commits
Commits
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
approvers: | ||
- mtaufen | ||
- dawnchen | ||
title: Set Kubelet parameters via a config file | ||
--- | ||
|
||
{% capture overview %} | ||
{% include feature-state-alpha.md %} | ||
|
||
As of Kubernetes 1.8, a subset of the Kubelet's configuration parameters may be | ||
set via an on-disk config file, as a substitute for command-line flags. In the | ||
future, most of the existing command-line flags will be deprecated in favor of | ||
providing parameters via a config file, which simplifies node deployment. | ||
|
||
{% endcapture %} | ||
|
||
{% capture prerequisites %} | ||
|
||
- A v1.8 or higher Kubelet binary must be installed. | ||
|
||
{% endcapture %} | ||
|
||
{% capture steps %} | ||
|
||
## Create the config file | ||
|
||
The subset of the Kubelet's configuration that can be configured via a file | ||
is defined by the `KubeletConfiguration` struct | ||
[here (v1alpha1)](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/kubeletconfig/v1alpha1/types.go). | ||
The configuration file must be a JSON or YAML representation of the parameters | ||
in this struct. Note that this structure, and thus the config file API, | ||
is still considered alpha and is not subject to stability gurarantees. | ||
|
||
Create a file named `kubelet` in its own directory and make sure the directory | ||
and file are both readable by the Kubelet. You should write your intended | ||
Kubelet configuration in this `kubelet` file. | ||
|
||
For a trick to generate a configuration file from a live node, see | ||
[Reconfigure a Node's Kubelet in a Live Cluster](/docs/tasks/administer-cluster/reconfigure-kubelet). | ||
|
||
## Start a Kubelet process configured via the config file | ||
|
||
Start the Kubelet with the `KubeletConfigFile` feature gate enabled and the | ||
Kubelet's `--init-config-dir` flag set to the location of the directory | ||
containing the `kubelet` file. The Kubelet will then load the parameters defined | ||
by `KubeletConfiguration` from the `kubelet` file, rather than from their | ||
associated command-line flags. | ||
|
||
{% endcapture %} | ||
|
||
{% capture discussion %} | ||
|
||
## Relationship to Dynamic Kubelet Config | ||
|
||
If you are using the [Dynamic Kubelet Configuration](/docs/tasks/administer-cluster/reconfigure-kubelet) | ||
feature, the configuration provided via `--init-config-dir` will be considered | ||
the "last known good" configuration by the automatic rollback mechanism. | ||
|
||
Note that the layout of the files in the `--init-config-dir` mirrors the layout | ||
of data in the ConfigMaps used for Dynamic Kubelet Config; the file names are | ||
the same as the keys of the ConfigMap, and the file contents are JSON or YAML | ||
representations of the same structures. Today, the only pair is | ||
`kubelet:KubeletConfiguration`, though more may emerge in the future. | ||
See [Reconfigure a Node's Kubelet in a Live Cluster](/docs/tasks/administer-cluster/reconfigure-kubelet) | ||
for more information. | ||
|
||
{% endcapture %} | ||
|
||
{% include templates/task.md %} |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so settings in the configuration file take precedence of the command line flags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.