Skip to content

Commit 5fb0dbb

Browse files
authored
Document Usage replayDeletion (#728)
Signed-off-by: Hasan Turken <[email protected]>
1 parent 6ecd118 commit 5fb0dbb

File tree

4 files changed

+113
-4
lines changed

4 files changed

+113
-4
lines changed

content/master/concepts/usages.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ with Helm.
5454
## Create a usage
5555
<!-- vale Google.Headings = YES -->
5656
57+
<!-- vale write-good.Passive = NO -->
5758
A {{<hover label="protect" line="2">}}Usage{{</hover>}}
5859
{{<hover label="protect" line="5">}}spec{{</hover>}} has a mandatory
5960
{{<hover label="protect" line="6">}}of{{</hover>}} field for defining the resource
6061
in use or protected. The
6162
{{<hover label="protect" line="11">}}reason{{</hover>}} field defines the reason
6263
for protection and the {{<hover label="order" line="11">}}by{{</hover>}} field
63-
<!-- vale write-good.Passive = NO -->
6464
defines the using resource. Both fields are optional, but at least one of them
6565
must be provided.
6666
<!-- vale write-good.Passive = YES -->
@@ -189,6 +189,41 @@ spec:
189189
baz: qux
190190
```
191191

192+
### Replay blocked deletion attempt
193+
194+
By default, the deletion of a `Usage` resource doesn't trigger the deletion of
195+
the resource in use even if there were deletion attempts blocked by the `Usage`.
196+
Replaying the blocked deletion is possible by setting the
197+
{{<hover label="replay" line="6">}}replayDeletion{{</hover>}} field to `true`.
198+
199+
```yaml {label="replay"}
200+
apiVersion: apiextensions.crossplane.io/v1alpha1
201+
kind: Usage
202+
metadata:
203+
name: release-uses-cluster
204+
spec:
205+
replayDeletion: true
206+
of:
207+
apiVersion: eks.upbound.io/v1beta1
208+
kind: Cluster
209+
resourceRef:
210+
name: my-cluster
211+
by:
212+
apiVersion: helm.crossplane.io/v1beta1
213+
kind: Release
214+
resourceRef:
215+
name: my-prometheus-chart
216+
```
217+
218+
{{<hint "tip" >}}
219+
220+
Replay deletion is useful when the used resource is part of a composition.
221+
This configuration radically decreases time for the deletion of the used
222+
resource, hence the composite owning it, by replaying the deletion of the
223+
used resource right after the using resource disappears instead of waiting
224+
for the long exponential backoff durations of the Kubernetes garbage collector.
225+
{{< /hint >}}
226+
192227
## Usage in a Composition
193228

194229
A typical use case for Usages is to define a deletion ordering between the
@@ -221,6 +256,7 @@ spec:
221256
apiVersion: apiextensions.crossplane.io/v1alpha1
222257
kind: Usage
223258
spec:
259+
replayDeletion: true
224260
of:
225261
apiVersion: container.gcp.upbound.io/v1beta1
226262
kind: Cluster

content/v1.14/concepts/usages.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ with Helm.
5454
## Create a usage
5555
<!-- vale Google.Headings = YES -->
5656
57+
<!-- vale write-good.Passive = NO -->
5758
A {{<hover label="protect" line="2">}}Usage{{</hover>}}
5859
{{<hover label="protect" line="5">}}spec{{</hover>}} has a mandatory
5960
{{<hover label="protect" line="6">}}of{{</hover>}} field for defining the resource
6061
in use or protected. The
6162
{{<hover label="protect" line="11">}}reason{{</hover>}} field defines the reason
6263
for protection and the {{<hover label="order" line="11">}}by{{</hover>}} field
63-
<!-- vale write-good.Passive = NO -->
6464
defines the using resource. Both fields are optional, but at least one of them
6565
must be provided.
6666
<!-- vale write-good.Passive = YES -->
@@ -189,6 +189,41 @@ spec:
189189
baz: qux
190190
```
191191

192+
### Replay blocked deletion attempt
193+
194+
By default, the deletion of a `Usage` resource doesn't trigger the deletion of
195+
the resource in use even if there were deletion attempts blocked by the `Usage`.
196+
Replaying the blocked deletion is possible by setting the
197+
{{<hover label="replay" line="6">}}replayDeletion{{</hover>}} field to `true`.
198+
199+
```yaml {label="replay"}
200+
apiVersion: apiextensions.crossplane.io/v1alpha1
201+
kind: Usage
202+
metadata:
203+
name: release-uses-cluster
204+
spec:
205+
replayDeletion: true
206+
of:
207+
apiVersion: eks.upbound.io/v1beta1
208+
kind: Cluster
209+
resourceRef:
210+
name: my-cluster
211+
by:
212+
apiVersion: helm.crossplane.io/v1beta1
213+
kind: Release
214+
resourceRef:
215+
name: my-prometheus-chart
216+
```
217+
218+
{{<hint "tip" >}}
219+
220+
Replay deletion is useful when the used resource is part of a composition.
221+
This configuration radically decreases time for the deletion of the used
222+
resource, hence the composite owning it, by replaying the deletion of the
223+
used resource right after the using resource disappears instead of waiting
224+
for the long exponential backoff durations of the Kubernetes garbage collector.
225+
{{< /hint >}}
226+
192227
## Usage in a Composition
193228

194229
A typical use case for Usages is to define a deletion ordering between the
@@ -221,6 +256,7 @@ spec:
221256
apiVersion: apiextensions.crossplane.io/v1alpha1
222257
kind: Usage
223258
spec:
259+
replayDeletion: true
224260
of:
225261
apiVersion: container.gcp.upbound.io/v1beta1
226262
kind: Cluster

content/v1.15/concepts/usages.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ with Helm.
5454
## Create a usage
5555
<!-- vale Google.Headings = YES -->
5656
57+
<!-- vale write-good.Passive = NO -->
5758
A {{<hover label="protect" line="2">}}Usage{{</hover>}}
5859
{{<hover label="protect" line="5">}}spec{{</hover>}} has a mandatory
5960
{{<hover label="protect" line="6">}}of{{</hover>}} field for defining the resource
6061
in use or protected. The
6162
{{<hover label="protect" line="11">}}reason{{</hover>}} field defines the reason
6263
for protection and the {{<hover label="order" line="11">}}by{{</hover>}} field
63-
<!-- vale write-good.Passive = NO -->
6464
defines the using resource. Both fields are optional, but at least one of them
6565
must be provided.
6666
<!-- vale write-good.Passive = YES -->
@@ -189,6 +189,41 @@ spec:
189189
baz: qux
190190
```
191191

192+
### Replay blocked deletion attempt
193+
194+
By default, the deletion of a `Usage` resource doesn't trigger the deletion of
195+
the resource in use even if there were deletion attempts blocked by the `Usage`.
196+
Replaying the blocked deletion is possible by setting the
197+
{{<hover label="replay" line="6">}}replayDeletion{{</hover>}} field to `true`.
198+
199+
```yaml {label="replay"}
200+
apiVersion: apiextensions.crossplane.io/v1alpha1
201+
kind: Usage
202+
metadata:
203+
name: release-uses-cluster
204+
spec:
205+
replayDeletion: true
206+
of:
207+
apiVersion: eks.upbound.io/v1beta1
208+
kind: Cluster
209+
resourceRef:
210+
name: my-cluster
211+
by:
212+
apiVersion: helm.crossplane.io/v1beta1
213+
kind: Release
214+
resourceRef:
215+
name: my-prometheus-chart
216+
```
217+
218+
{{<hint "tip" >}}
219+
220+
Replay deletion is useful when the used resource is part of a composition.
221+
This configuration radically decreases time for the deletion of the used
222+
resource, hence the composite owning it, by replaying the deletion of the
223+
used resource right after the using resource disappears instead of waiting
224+
for the long exponential backoff durations of the Kubernetes garbage collector.
225+
{{< /hint >}}
226+
192227
## Usage in a Composition
193228

194229
A typical use case for Usages is to define a deletion ordering between the
@@ -221,6 +256,7 @@ spec:
221256
apiVersion: apiextensions.crossplane.io/v1alpha1
222257
kind: Usage
223258
spec:
259+
replayDeletion: true
224260
of:
225261
apiVersion: container.gcp.upbound.io/v1beta1
226262
kind: Cluster

utils/vale/styles/Crossplane/allowed-jargon.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,5 @@ syscall
7878
TLS
7979
tolerations
8080
VM
81-
YAML
81+
YAML
82+
backoff

0 commit comments

Comments
 (0)