Document Usage replayDeletion (#728)

Signed-off-by: Hasan Turken <turkenh@gmail.com>
This commit is contained in:
Hasan Turken 2024-03-26 18:40:57 +03:00 committed by GitHub
parent 6ecd118d79
commit 5fb0dbb3f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 113 additions and 4 deletions

View File

@ -54,13 +54,13 @@ with Helm.
## Create a usage ## Create a usage
<!-- vale Google.Headings = YES --> <!-- vale Google.Headings = YES -->
<!-- vale write-good.Passive = NO -->
A {{<hover label="protect" line="2">}}Usage{{</hover>}} A {{<hover label="protect" line="2">}}Usage{{</hover>}}
{{<hover label="protect" line="5">}}spec{{</hover>}} has a mandatory {{<hover label="protect" line="5">}}spec{{</hover>}} has a mandatory
{{<hover label="protect" line="6">}}of{{</hover>}} field for defining the resource {{<hover label="protect" line="6">}}of{{</hover>}} field for defining the resource
in use or protected. The in use or protected. The
{{<hover label="protect" line="11">}}reason{{</hover>}} field defines the reason {{<hover label="protect" line="11">}}reason{{</hover>}} field defines the reason
for protection and the {{<hover label="order" line="11">}}by{{</hover>}} field for protection and the {{<hover label="order" line="11">}}by{{</hover>}} field
<!-- vale write-good.Passive = NO -->
defines the using resource. Both fields are optional, but at least one of them defines the using resource. Both fields are optional, but at least one of them
must be provided. must be provided.
<!-- vale write-good.Passive = YES --> <!-- vale write-good.Passive = YES -->
@ -189,6 +189,41 @@ spec:
baz: qux baz: qux
``` ```
### Replay blocked deletion attempt
By default, the deletion of a `Usage` resource doesn't trigger the deletion of
the resource in use even if there were deletion attempts blocked by the `Usage`.
Replaying the blocked deletion is possible by setting the
{{<hover label="replay" line="6">}}replayDeletion{{</hover>}} field to `true`.
```yaml {label="replay"}
apiVersion: apiextensions.crossplane.io/v1alpha1
kind: Usage
metadata:
name: release-uses-cluster
spec:
replayDeletion: true
of:
apiVersion: eks.upbound.io/v1beta1
kind: Cluster
resourceRef:
name: my-cluster
by:
apiVersion: helm.crossplane.io/v1beta1
kind: Release
resourceRef:
name: my-prometheus-chart
```
{{<hint "tip" >}}
Replay deletion is useful when the used resource is part of a composition.
This configuration radically decreases time for the deletion of the used
resource, hence the composite owning it, by replaying the deletion of the
used resource right after the using resource disappears instead of waiting
for the long exponential backoff durations of the Kubernetes garbage collector.
{{< /hint >}}
## Usage in a Composition ## Usage in a Composition
A typical use case for Usages is to define a deletion ordering between the A typical use case for Usages is to define a deletion ordering between the
@ -221,6 +256,7 @@ spec:
apiVersion: apiextensions.crossplane.io/v1alpha1 apiVersion: apiextensions.crossplane.io/v1alpha1
kind: Usage kind: Usage
spec: spec:
replayDeletion: true
of: of:
apiVersion: container.gcp.upbound.io/v1beta1 apiVersion: container.gcp.upbound.io/v1beta1
kind: Cluster kind: Cluster

View File

@ -54,13 +54,13 @@ with Helm.
## Create a usage ## Create a usage
<!-- vale Google.Headings = YES --> <!-- vale Google.Headings = YES -->
<!-- vale write-good.Passive = NO -->
A {{<hover label="protect" line="2">}}Usage{{</hover>}} A {{<hover label="protect" line="2">}}Usage{{</hover>}}
{{<hover label="protect" line="5">}}spec{{</hover>}} has a mandatory {{<hover label="protect" line="5">}}spec{{</hover>}} has a mandatory
{{<hover label="protect" line="6">}}of{{</hover>}} field for defining the resource {{<hover label="protect" line="6">}}of{{</hover>}} field for defining the resource
in use or protected. The in use or protected. The
{{<hover label="protect" line="11">}}reason{{</hover>}} field defines the reason {{<hover label="protect" line="11">}}reason{{</hover>}} field defines the reason
for protection and the {{<hover label="order" line="11">}}by{{</hover>}} field for protection and the {{<hover label="order" line="11">}}by{{</hover>}} field
<!-- vale write-good.Passive = NO -->
defines the using resource. Both fields are optional, but at least one of them defines the using resource. Both fields are optional, but at least one of them
must be provided. must be provided.
<!-- vale write-good.Passive = YES --> <!-- vale write-good.Passive = YES -->
@ -189,6 +189,41 @@ spec:
baz: qux baz: qux
``` ```
### Replay blocked deletion attempt
By default, the deletion of a `Usage` resource doesn't trigger the deletion of
the resource in use even if there were deletion attempts blocked by the `Usage`.
Replaying the blocked deletion is possible by setting the
{{<hover label="replay" line="6">}}replayDeletion{{</hover>}} field to `true`.
```yaml {label="replay"}
apiVersion: apiextensions.crossplane.io/v1alpha1
kind: Usage
metadata:
name: release-uses-cluster
spec:
replayDeletion: true
of:
apiVersion: eks.upbound.io/v1beta1
kind: Cluster
resourceRef:
name: my-cluster
by:
apiVersion: helm.crossplane.io/v1beta1
kind: Release
resourceRef:
name: my-prometheus-chart
```
{{<hint "tip" >}}
Replay deletion is useful when the used resource is part of a composition.
This configuration radically decreases time for the deletion of the used
resource, hence the composite owning it, by replaying the deletion of the
used resource right after the using resource disappears instead of waiting
for the long exponential backoff durations of the Kubernetes garbage collector.
{{< /hint >}}
## Usage in a Composition ## Usage in a Composition
A typical use case for Usages is to define a deletion ordering between the A typical use case for Usages is to define a deletion ordering between the
@ -221,6 +256,7 @@ spec:
apiVersion: apiextensions.crossplane.io/v1alpha1 apiVersion: apiextensions.crossplane.io/v1alpha1
kind: Usage kind: Usage
spec: spec:
replayDeletion: true
of: of:
apiVersion: container.gcp.upbound.io/v1beta1 apiVersion: container.gcp.upbound.io/v1beta1
kind: Cluster kind: Cluster

View File

@ -54,13 +54,13 @@ with Helm.
## Create a usage ## Create a usage
<!-- vale Google.Headings = YES --> <!-- vale Google.Headings = YES -->
<!-- vale write-good.Passive = NO -->
A {{<hover label="protect" line="2">}}Usage{{</hover>}} A {{<hover label="protect" line="2">}}Usage{{</hover>}}
{{<hover label="protect" line="5">}}spec{{</hover>}} has a mandatory {{<hover label="protect" line="5">}}spec{{</hover>}} has a mandatory
{{<hover label="protect" line="6">}}of{{</hover>}} field for defining the resource {{<hover label="protect" line="6">}}of{{</hover>}} field for defining the resource
in use or protected. The in use or protected. The
{{<hover label="protect" line="11">}}reason{{</hover>}} field defines the reason {{<hover label="protect" line="11">}}reason{{</hover>}} field defines the reason
for protection and the {{<hover label="order" line="11">}}by{{</hover>}} field for protection and the {{<hover label="order" line="11">}}by{{</hover>}} field
<!-- vale write-good.Passive = NO -->
defines the using resource. Both fields are optional, but at least one of them defines the using resource. Both fields are optional, but at least one of them
must be provided. must be provided.
<!-- vale write-good.Passive = YES --> <!-- vale write-good.Passive = YES -->
@ -189,6 +189,41 @@ spec:
baz: qux baz: qux
``` ```
### Replay blocked deletion attempt
By default, the deletion of a `Usage` resource doesn't trigger the deletion of
the resource in use even if there were deletion attempts blocked by the `Usage`.
Replaying the blocked deletion is possible by setting the
{{<hover label="replay" line="6">}}replayDeletion{{</hover>}} field to `true`.
```yaml {label="replay"}
apiVersion: apiextensions.crossplane.io/v1alpha1
kind: Usage
metadata:
name: release-uses-cluster
spec:
replayDeletion: true
of:
apiVersion: eks.upbound.io/v1beta1
kind: Cluster
resourceRef:
name: my-cluster
by:
apiVersion: helm.crossplane.io/v1beta1
kind: Release
resourceRef:
name: my-prometheus-chart
```
{{<hint "tip" >}}
Replay deletion is useful when the used resource is part of a composition.
This configuration radically decreases time for the deletion of the used
resource, hence the composite owning it, by replaying the deletion of the
used resource right after the using resource disappears instead of waiting
for the long exponential backoff durations of the Kubernetes garbage collector.
{{< /hint >}}
## Usage in a Composition ## Usage in a Composition
A typical use case for Usages is to define a deletion ordering between the A typical use case for Usages is to define a deletion ordering between the
@ -221,6 +256,7 @@ spec:
apiVersion: apiextensions.crossplane.io/v1alpha1 apiVersion: apiextensions.crossplane.io/v1alpha1
kind: Usage kind: Usage
spec: spec:
replayDeletion: true
of: of:
apiVersion: container.gcp.upbound.io/v1beta1 apiVersion: container.gcp.upbound.io/v1beta1
kind: Cluster kind: Cluster

View File

@ -79,3 +79,4 @@ TLS
tolerations tolerations
VM VM
YAML YAML
backoff