Skip to content

Commit 67d5a86

Browse files
KnVereyTim Bannister
andauthored
Apply suggestions from code review
Co-authored-by: Tim Bannister <[email protected]>
1 parent 0207e38 commit 67d5a86

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

content/en/docs/reference/labels-annotations-taints/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ Example: `applyset.k8s.io/additional-namespaces: "namespace1,namespace2"`
9898

9999
Used on: Objects being used as ApplySet parents.
100100

101+
Use of this label is alpha.
101102
For Kubernetes version {{< skew currentVersion >}}, you can use this label on Secrets, ConfigMaps, or custom resources if the {{< glossary_tooltip term_id="CustomResourceDefinition" text="CustomResourceDefinition" >}} defining them has the `applyset.k8s.io/is-parent-type` label.
102103

103104
Part of the specification used to implement [ApplySet-based pruning in kubectl](/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune). This annotation is applied to the parent object used to track an ApplySet to extend the scope of the ApplySet beyond the parent object's own namespace (if any). The value is a comma-separated list of the names of namespaces other than the parent's namespace in which objects are found.
@@ -108,6 +109,7 @@ Example: `applyset.k8s.io/contains-group-resources: "certificates.cert-manager.i
108109

109110
Used on: Objects being used as ApplySet parents.
110111

112+
Use of this label is alpha.
111113
For Kubernetes version {{< skew currentVersion >}}, you can use this label on Secrets, ConfigMaps, or custom resources if the {{< glossary_tooltip term_id="CustomResourceDefinition" text="CustomResourceDefinition" >}} defining them has the `applyset.k8s.io/is-parent-type` label.
112114

113115
Part of the specification used to implement [ApplySet-based pruning in kubectl](/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune). This annotation is applied to the parent object used to track an ApplySet to optimize listing of ApplySet member objects. It is optional in the ApplySet specification, as tools can perform discovery or use a different optimization. However, as of Kubernetes version {{< skew currentVersion >}}, it is required by kubectl. When present, the value of this annotation must be a comma separated list of the group-kinds, in the fully-qualified name format, i.e. `<resource>.<group>`.
@@ -119,6 +121,7 @@ Example: `applyset.k8s.io/id: "applyset-0eFHV8ySqp7XoShsGvyWFQD3s96yqwHmzc4e0HR1
119121

120122
Used on: Objects being used as ApplySet parents.
121123

124+
Use of this label is alpha.
122125
For Kubernetes version {{< skew currentVersion >}}, you can use this label on Secrets, ConfigMaps, or custom resources if the {{< glossary_tooltip term_id="CustomResourceDefinition" text="CustomResourceDefinition" >}} defining them has the `applyset.k8s.io/is-parent-type` label.
123126

124127
Part of the specification used to implement [ApplySet-based pruning in kubectl](/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune). This label is what makes an object an ApplySet parent object. Its value is the unique ID of the ApplySet, which is derived from the identity of the parent object itself. This ID **must** be the base64 encoding (using the URL safe encoding of RFC4648) of the hash of the group-kind-name-namespace of the object it is on, in the form: `<base64(sha256(<name>.<namespace>.<kind>.<group>))>`. There is no relation between the value of this label and object UIDs.
@@ -129,6 +132,7 @@ Example: `applyset.k8s.io/is-parent-type: "true"`
129132

130133
Used on: Custom Resource Definition (CRD)
131134

135+
Use of this label is alpha.
132136
Part of the specification used to implement [ApplySet-based pruning in kubectl](/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune). You can set this label on a {{< glossary_tooltip term_id="CustomResourceDefinition" text="CustomResourceDefinition" >}} (CRD) to identify the custom resource type it defines (not the CRD itself) as an allowed parent for an ApplySet. The only permitted value for this label is `"true"`; if you want to mark a CRD as not being a valid parent for ApplySets, omit this label.
133137

134138
### applyset.k8s.io/part-of
@@ -137,6 +141,7 @@ Example: `applyset.k8s.io/part-of: "applyset-0eFHV8ySqp7XoShsGvyWFQD3s96yqwHmzc4
137141

138142
Used on: All objects.
139143

144+
Use of this label is alpha.
140145
Part of the specification used to implement [ApplySet-based pruning in kubectl](/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune). This label is what makes an object a member of an ApplySet. The value of the label **must** match the value of the `applyset.k8s.io/id` label on the parent object.
141146

142147
### applyset.k8s.io/tooling
@@ -145,6 +150,7 @@ Example: `applyset.k8s.io/tooling: "kubectl/v{{< skew currentVersion >}}"`
145150

146151
Used on: Objects being used as ApplySet parents.
147152

153+
Use of this label is alpha.
148154
For Kubernetes version {{< skew currentVersion >}}, you can use this label on Secrets, ConfigMaps, or custom resources if the {{< glossary_tooltip term_id="CustomResourceDefinition" text="CustomResourceDefinition" >}} defining them has the `applyset.k8s.io/is-parent-type` label.
149155

150156
Part of the specification used to implement [ApplySet-based pruning in kubectl](/docs/tasks/manage-kubernetes-objects/declarative-config/#alternative-kubectl-apply-f-directory-prune). This label is applied to the parent object used to track an ApplySet to indicate which tooling manages that ApplySet. Tooling should refuse to mutate ApplySets belonging to other tools. The value must be in the format `<toolname>/<semver>`.

content/en/docs/tasks/manage-kubernetes-objects/declarative-config.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,11 @@ As an alternative to `kubectl delete`, you can use `kubectl apply` to identify o
377377
their manifests have been removed from a directory in the local filesystem.
378378

379379
In Kubernetes {{< skew currentVersion >}}, there are two pruning modes available in kubectl apply:
380-
- Allowlist-based pruning: This mode has existed since kubectl v1.5 but is still in alpha due to usability, correctness and performance issues with its design. The ApplySet-based mode is designed to replace it, and upon its graduation, allowlist-based pruning will be deprecated using beta timelines.
381-
- ApplySet-based pruning: An ApplySet is a server-side object (by default, a Secret) that kubectl can use to accurately and efficiently track set membership across `apply` operations. This mode was introduced in alpha in kubectl v1.27 as a replacement for allowlist-based pruning. Unlike allowlist-based pruning, it is under active development and is expected to ultimately become generally available.
380+
- Allowlist-based pruning: This mode has existed since kubectl v1.5 but is still in alpha due to usability, correctness and performance issues with its design. The ApplySet-based mode is designed to replace it.
381+
- ApplySet-based pruning: An _apply set_ is a server-side object (by default, a Secret) that kubectl can use to accurately and efficiently track set membership across **apply** operations. This mode was introduced in alpha in kubectl v1.27 as a replacement for allowlist-based pruning.
382382

383383
{{< tabs name="kubectl_apply_prune" >}}
384-
{{% tab name="Allowlist" %}}
384+
{{% tab name="Allow list" %}}
385385

386386
{{< feature-state for_k8s_version="v1.5" state="alpha" >}}
387387

@@ -391,13 +391,13 @@ Only use this if you know what you are doing. You must be careful when using thi
391391

392392
To use allowlist-based pruning, add the following flags to your `kubectl apply` invocation:
393393
- `--prune`: Delete previously applied objects that are not in the set passed to the current invocation.
394-
- `--prune-allowlist`: A list of group-version-kinds (GVKs) to consider for pruning. This flag is optional but strongly encouraged, as its [default value](https://git.k8s.io/kubectl/pkg/util/prune/prune.go#L28-L50) is a partial list of both namespaced and cluster-scoped types, which can lead to surprising results.
394+
- `--prune-allowlist`: A list of group-version-kinds (GVKs) to consider for pruning. This flag is optional but strongly encouraged, as its default value is a partial list of both namespaced and cluster-scoped types, which can lead to surprising results.
395395
- `--selector/-l`: Use a label selector to constrain the set of objects selected for pruning. This flag is optional but strongly encouraged.
396396
- `--all`: use instead of `--selector/-l` to explicitly select all previously applied objects of the allowlisted types.
397397

398398
Allowlist-based pruning queries the API server for all objects of the allowlisted GVKs that match the given labels (if any), and attempts to match the returned live object configurations against the object
399-
configuration files. If an object matches the query, and it does not have a
400-
configuration file in the directory, and it has a `last-applied-configuration` annotation,
399+
manifest files. If an object matches the query, and it does not have a
400+
manifest in the directory, and it has a `kubectl.kubernetes.io/last-applied-configuration` annotation,
401401
it is deleted.
402402

403403

@@ -414,7 +414,7 @@ have the labels given (if any), and do not appear in the subdirectory.
414414

415415
{{% /tab %}}
416416

417-
{{% tab name="ApplySet" %}}
417+
{{% tab name="Apply set" %}}
418418

419419
{{< feature-state for_k8s_version="v1.27" state="alpha" >}}
420420

0 commit comments

Comments
 (0)