Skip to content

Conversation

@iRaindrop
Copy link
Contributor

Need to alert users about not modifying the _example key, value propagation, versioning, and other tips about ConfigMaps.

Proposed Changes

  • New topic in Administration: Editing ConfigMaps

@netlify
Copy link

netlify bot commented Oct 21, 2025

Deploy Preview for knative ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 604589e
🔍 Latest deploy log https://app.netlify.com/projects/knative/deploys/69158a10d893580008161ba5
😎 Deploy Preview https://deploy-preview-6466--knative.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@knative-prow knative-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 21, 2025
@iRaindrop iRaindrop marked this pull request as draft October 21, 2025 22:01
@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 21, 2025
Added page to the Nav
Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this draft! Unfortunately, I think pulling in a lot of the general-purposes reference material about using ConfigMaps with generic applications obscured (rather than clarified) how Knative administrators need to interact with the ConfigMaps used to configure Knative.

@evankanderson
Copy link
Member

/assign

Processed reviewer edits
@knative-prow
Copy link

knative-prow bot commented Oct 24, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: iRaindrop
Once this PR has been reviewed and has the lgtm label, please ask for approval from evankanderson. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the recent commit only addressed some comments, so I didn't repeat all the outstanding comments.

## Value propagation
The ConfigMap change is immediate in the Kubernetes API, but its effect on Pods or applications depends on how the ConfigMap is consumed (volume, environment variables, or API) and whether the application or Pod is designed to pick up the change dynamically or requires a restart. For volumes, updates propagate within seconds, but for environment variables, a Pod restart is needed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if any of this "value propagation" information is necessary given how Knative watches ConfigMaps directly.

Comment on lines 84 to 102
### Track Object Version in ConfigMap

- Include a version field in the ConfigMap’s data to explicitly track the version of the application or configuration it represents.

```yaml
data:
app.properties: |
version=1.2.3
# other settings
```

- Alternatively, use annotations in the ConfigMap’s metadata:

```yaml
metadata:
name: my-app-config
annotations:
app-version: "1.2.3"
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this still seems to be an issue)

Removed unneeded content
Worked on Brokers section
Added links to Brokers section
Refocused content on just working with ConfigMaps. Removed generalized info not Knative specific.
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 29, 2025
---
# Editing ConfigMaps

This page provides information and best practices for editing ConfigMaps. Knative uses ConfigMaps to manage most system-level configuration, including default values, minimum and maximum values, and names and addresses of connecting services. Because Knative is implemented as a set of controllers, Knative watches the ConfigMaps and updates behavior live shortly after the ConfigMap is updated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we should add a line here explaining that if you use the Knative Operator, the fields in the Operator resources (KnativeServing and KnativeEventing) are used to fill out the ConfigMap, and you shouldn't edit the ConfigMaps directly -- the operator will overwrite your changes.

Updated _example key content and reviewer edits
@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 4, 2025
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 4, 2025
Removed Value Propagation - not needed
Fixes and reviewer edits
removed unneeded error example
One last annotation test
Made reviewer edits
Worked on the canonical edit - git v cluster
Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is getting close! I added a couple suggested wording changes, and a bit of a rewrite on the what-happens-when-you-edit-_example section.

As a side note, Markdown will treat a single newline as simple whitespace. Using newlines like this can be helpful to break up larger paragraphs into 80-character or 1-sentence lines. Since GitHub reviews are line-based, shorter lines can enable more precise commenting on sections of a paragraph; the diffs from the suggestion feature can also be easier to read if each individual line is not too wide


# Working with ConfigMaps

This page provides important information and best practices for working with Kubernetes ConfigMaps. ConfigMaps are the primary means for managing configuration values for Knative controllers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This page provides important information and best practices for working with Kubernetes ConfigMaps. ConfigMaps are the primary means for managing configuration values for Knative controllers.
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.


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 contains a value which acts as a documentation comment.

If a user edits the `_example` key by mistakenly thinking their edits don't effect on the cluster operation, the Knative webhook catches the error and alerts the user that their update could not be patched. More specifically, the edit is caught when the value of the checksum for the `_example` key is different when compared with the `knative.dev/example-checksum` annotation on the ConfigMap. If the checksum is null or missing, the webhook server does not create the warning.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If a user edits the `_example` key by mistakenly thinking their edits don't effect on the cluster operation, the Knative webhook catches the error and alerts the user that their update could not be patched. More specifically, the edit is caught when the value of the checksum for the `_example` key is different when compared with the `knative.dev/example-checksum` annotation on the ConfigMap. If the checksum is null or missing, the webhook server does not create the warning.
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.

The sentence here had some awkward wording "by mistakenly thinking ... don't effect on ...". I think this reads more smoothly?


Accordingly, you cannot alter the contents of the `_example` key, but you can delete the `_example` key altogether or delete the annotation.

For example, the following YAML code shows the first 24 lines of the `config-defaults` ConfigMap with the checkum highlighted.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For example, the following YAML code shows the first 24 lines of the `config-defaults` ConfigMap with the checkum highlighted.
For example, the following YAML code shows the first 24 lines of the `config-defaults` ConfigMap with the checksum highlighted.


If you manage the ConfigMap by using `kubectl edit`, periodically export ConfigMaps from the cluster (`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 sor use automation (for example Flux or ArgoCD) to apply the changes once they are committed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 sor use automation (for example Flux or ArgoCD) to apply the changes once they are committed.
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants