-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Create Editing ConfigMaps page #6466
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
e246c3c
Create editing-configmaps.md
iRaindrop d05c343
Update .nav.yml
iRaindrop a42327c
Update editing-configmaps.md
iRaindrop 275dd3c
Update editing-configmaps.md
iRaindrop 04fe58e
Update editing-configmaps.md
iRaindrop e2decb8
Update editing-configmaps.md
iRaindrop a9eaaff
Update editing-configmaps.md
iRaindrop 3df551f
Update editing-configmaps.md
iRaindrop 420803a
Update editing-configmaps.md
iRaindrop ee3de62
Update editing-configmaps.md
iRaindrop 6ed1846
Update editing-configmaps.md
iRaindrop 79b5502
Update editing-configmaps.md
iRaindrop 5257455
Update docs/versioned/admin/editing-configmaps.md
iRaindrop 9d97ee8
Update docs/versioned/admin/editing-configmaps.md
iRaindrop 9f65498
Update docs/versioned/admin/editing-configmaps.md
iRaindrop ef280e8
Update editing-configmaps.md
iRaindrop c4ae66c
Update editing-configmaps.md
iRaindrop 8af3db7
Nav update and annotation testing
iRaindrop 0bec94e
Update editing-configmaps.md
iRaindrop ff4dac3
Update editing-configmaps.md
iRaindrop 410abd8
Update editing-configmaps.md
iRaindrop 6301800
Update editing-configmaps.md
iRaindrop 8d4cf07
Update editing-configmaps.md
iRaindrop 20432ae
Update editing-configmaps.md
iRaindrop 604589e
Update editing-configmaps.md
iRaindrop b117812
Update docs/versioned/admin/editing-configmaps.md
iRaindrop e8cc852
Update docs/versioned/admin/editing-configmaps.md
iRaindrop a096d97
Update docs/versioned/admin/editing-configmaps.md
iRaindrop de63c7d
Update docs/versioned/admin/editing-configmaps.md
iRaindrop 6f1a4c4
Update editing-configmaps.md
iRaindrop ae69227
Update admin-overview.md
iRaindrop 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| --- | ||
| audience: administrator | ||
| components: | ||
| - serving | ||
| - eventing | ||
| function: explanation | ||
| --- | ||
|
|
||
| # Working with ConfigMaps | ||
|
|
||
| This page provides important Knative-specific information and best practices for managing cluster configuration using ConfigMaps. ConfigMaps are the primary means for managing configuration values for Knative controllers. | ||
|
|
||
| If you are using the Knative Operator to install and manage your Knative cluster, you should not edit the ConfigMaps directly as the Operator will overwrite the changes. See [Configuring Knative by using the Operator](../install/operator/configuring-with-operator.md) for information on how to manage ConfigMaps using the operator. | ||
|
|
||
| ## The _example key | ||
|
|
||
| ConfigMap files installed by Knative contain an `_example` key that shows the usage and purpose of all the known configuration keys in that ConfigMap. This key does not affect Knative behavior, but does contains a value which acts as a documentation comment. | ||
|
|
||
| If a user edits the `_example` key rather than creating a new key in the ConfigMap, the changes won't affect the cluster cluster configuration, which can be confusing. The Knative webhook flags this error and alerts the user that their update could not be patched. More specifically, the edit is caught when the checksum for the `_example` key differs from the `knative.dev/example-checksum` annotation on the ConfigMap. If the checksum is null or missing, the webhook does not create the warning. | ||
|
|
||
| Accordingly, you cannot alter the contents of the `_example` key, but you can delete the `_example` key altogether or delete the `example-checksum` annotation. | ||
|
|
||
| For example, the following YAML code shows the first 24 lines of the `config-defaults` ConfigMap with the checksum highlighted on line 11. | ||
|
|
||
| ```yml linenums="1" hl_lines="11" | ||
| piVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: config-defaults | ||
| namespace: knative-serving | ||
| labels: | ||
| app.kubernetes.io/name: knative-serving | ||
| app.kubernetes.io/component: controller | ||
| app.kubernetes.io/version: devel | ||
| annotations: | ||
| knative.dev/example-checksum: "5b64ff5c" | ||
| data: | ||
| _example: | | ||
| ################################ | ||
| # # | ||
| # EXAMPLE CONFIGURATION # | ||
| # # | ||
| ################################ | ||
|
|
||
| # This block is not actually functional configuration, | ||
| # but serves to illustrate the available configuration | ||
| # options and document them in a way that is accessible | ||
| # to users that `kubectl edit` this config map. | ||
| # | ||
| ``` | ||
|
|
||
| ## Best practices | ||
|
|
||
| ### Validate and Test Changes | ||
|
|
||
| Knative controllers process new values, including roll-backs to previous values, within a few seconds after being applied. | ||
|
|
||
| - Before applying ConfigMaps, validate their syntax and content using tools like `kubeval` or use `kubectl apply --dry-run=server`. | ||
| - Test ConfigMap changes in a staging environment to ensure compatibility with the application version. | ||
iRaindrop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### Storage and versioning | ||
|
|
||
| How you manage storage relates the canonical locations of both the cluster and Git. If your cluster is canonical, then you're exporting or backing up the configuration to Git. If Git is canonical, then you're practicing GitOps, and you should make changes in Git and then apply the files from Git to your cluster. | ||
|
|
||
| If you manage the ConfigMap by using `kubectl edit`, periodically export ConfigMaps from the cluster with `kubectl get configmap -o yaml` and commit them to Git for recovery purposes. Include applicable version numbers in `app.properties` as needed. | ||
|
|
||
| If you manage the ConfigMap by keeping the definition in Git and automatically applying it to the cluster (GitOps), you can apply the changes manually or use automation (for example Flux or ArgoCD) to apply the changes after they are committed. | ||
|
|
||
| ### Git recommendations | ||
|
|
||
| In addition to diligent usage of commit messages, here are some suggestions for ConfigMaps in GitHub: | ||
|
|
||
| - Centralize ConfigMaps: Store all ConfigMaps in a dedicated directory in your Git repository, such as `k8s/configmaps/`. | ||
| - Tag commits in Git with version numbers, such as `git tag config-v1.2.3` to mark specific ConfigMap versions. | ||
| - Implement a GitOps workflow with tools like ArgoCD or Flux to synchronize ConfigMaps from Git to your Kubernetes cluster. | ||
Oops, something went wrong.
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.