mirror of https://github.com/crossplane/docs.git
Drop docs on naming resources with external name annotation
It's an MR feature, not a composition feature. It's documented in the MR docs. Signed-off-by: Nic Cope <nicc@rk0n.org>
This commit is contained in:
parent
36999a7b34
commit
1d4e24dc76
|
@ -85,75 +85,6 @@ NAME SYNCED READY COMPOSITION AGE
|
|||
my-composite-resource True True my-composition 4s
|
||||
```
|
||||
|
||||
### Naming external resources
|
||||
By default, managed resources created by a composite resource have the name of
|
||||
the composite resource, followed by a random suffix.
|
||||
|
||||
<!-- vale Google.FirstPerson = NO -->
|
||||
<!-- vale Crossplane.Spelling = NO -->
|
||||
For example, a composite resource named "my-composite-resource" creates external
|
||||
resources named "my-composite-resource-fqvkw."
|
||||
<!-- vale Google.FirstPerson = YES -->
|
||||
<!-- vale Crossplane.Spelling = YES -->
|
||||
|
||||
Resource names can be deterministic by applying an
|
||||
{{<hover label="annotation" line="5">}}annotation{{</hover>}} to the composite
|
||||
resource.
|
||||
|
||||
```yaml {label="annotation",copy-lines="none"}
|
||||
apiVersion: example.org/v1alpha1
|
||||
kind: MyDatabase
|
||||
metadata:
|
||||
namespace: default
|
||||
name: my-composite-resource
|
||||
annotations:
|
||||
crossplane.io/external-name: my-custom-name
|
||||
# Removed for brevity
|
||||
```
|
||||
|
||||
Inside the Composition, use a
|
||||
{{<hover label="comp" line="10">}}patch{{</hover>}}
|
||||
to apply the external-name to the resources.
|
||||
|
||||
The {{<hover label="comp" line="11">}}fromFieldPath{{</hover>}} patch copies the
|
||||
{{<hover label="comp" line="11">}}metadata.annotations{{</hover>}} field from
|
||||
the composite resource to the
|
||||
{{<hover label="comp" line="12">}}metadata.annotations{{</hover>}} inside the
|
||||
managed resource.
|
||||
|
||||
{{<hint "note" >}}
|
||||
If a managed resource has the `crossplane.io/external-name` annotation
|
||||
Crossplane uses the annotation value to name the external resource.
|
||||
{{</hint >}}
|
||||
|
||||
```yaml {label="comp",copy-lines="none"}
|
||||
apiVersion: apiextensions.crossplane.io/v1
|
||||
kind: Composition
|
||||
metadata:
|
||||
name: my-composition
|
||||
spec:
|
||||
mode: Pipeline
|
||||
pipeline:
|
||||
- step: patch-and-transform
|
||||
functionRef:
|
||||
name: function-patch-and-transform
|
||||
input:
|
||||
apiVersion: pt.fn.crossplane.io/v1beta1
|
||||
kind: Resources
|
||||
resources:
|
||||
- name: database
|
||||
base:
|
||||
# Removed for brevity
|
||||
patches:
|
||||
- fromFieldPath: metadata.annotations
|
||||
toFieldPath: metadata.annotations
|
||||
```
|
||||
|
||||
For more information on using `function-patch-and-transform` to patch
|
||||
resources refer to the
|
||||
[Function Patch and Transform]({{<ref "../guides/function-patch-and-transform">}})
|
||||
documentation.
|
||||
|
||||
### Composition selection
|
||||
|
||||
Select a specific Composition for a composite resource to use with
|
||||
|
|
Loading…
Reference in New Issue