Skip to content

Commit d10c555

Browse files
committed
Mention --default-label-scoping-rules CLI option
Mention the --default-label-scoping-rules=false CLI option, add a FAQ section about kapp's labels, and cross-link the docs in the apply section with the configuration. Signed-off-by: Craig Ringer <[email protected]>
1 parent 16050a3 commit d10c555

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

site/content/kapp/docs/develop/apply.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Once change set is calculated (see [Diff](diff.md) section for details), kapp as
88

99
Changes are applied in particular order as described in [Apply ordering](apply-ordering.md).
1010

11+
### Resource labels
12+
1113
All created resources are labeled with several labels:
1214

1315
- `kapp.k14s.io/app` to track which application "owns" resource

site/content/kapp/docs/develop/config.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ See [ytt rebase rule](https://github.com/carvel-dev/kapp/blob/d3ee9a01b5f0d7d563
128128
129129
### labelScopingRules
130130
131-
`labelScopingRules` specify locations for inserting kapp generated labels that scope resources to resources within current application. `kapp.k14s.io/disable-default-label-scoping-rules: ""` (as of v0.33.0+, or use `kapp.k14s.io/disable-label-scoping: ""` in earlier versions) annotation can be used to exclude an individual resource from label scoping.
131+
`labelScopingRules` specify locations for inserting [kapp generated labels](apply.md#resource-labels) that scope resources to resources within current application.
132+
133+
The annotations `kapp.k14s.io/disable-default-label-scoping-rules: ""` (as of v0.33.0+, or use `kapp.k14s.io/disable-label-scoping: ""` in earlier versions) can be used to exclude an individual resource from label scoping.
134+
135+
The global CLI option `--default-label-scoping-rules=false` can be used to disable addition of ownership labels
136+
entirely, but it's recommended to limit the scope of this option to specific use cases so kapp can do a better job of tracking the application's resources.
132137

133138
### waitRules
134139

site/content/kapp/docs/develop/faq.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,14 @@ Additional resources: [tty flag in kapp code](https://github.com/carvel-dev/kapp
125125
## How can I get kapp to skip waiting on some resources?
126126

127127
kapp allows to control waiting behavior per resource via [resource annotations](apply-waiting.md#controlling-waiting-via-resource-annotations). When used, the resource will be applied to the cluster, but will not wait to reconcile.
128+
129+
---
130+
## Why does kapp add `kapp.k14s.io/app` labels to my resources?
131+
132+
[`kapp` adds the label `kapp.k14s.io/app` and other related labels](apply.md#resource-labels) to keep track of which app resources are part of.
133+
134+
This can cause issues in situations where controllers or custom resources are used to deploy resources, as it may result in mismatches between selectors and the resources selected, e.g. a service selector not matching any pods.
135+
136+
It may also result in [Field is immutable errors](#-field-is-immutable-error) when updating resources that were not previously managed by `kapp`, so they lacked the kapp labels. See [migration](#migrating-from-kubectl-apply-to-kapp).
137+
138+
See [label scoping rules](config#labelscopingrules) for details and configuration.

0 commit comments

Comments
 (0)