Skip to content

Commit 1585332

Browse files
Update Quickstart: ProviderNamingFormat & ImageConfig (#42)
* update quickstart to detail ownerRefs and image path rewriting * update quickstart to detail resolving of duplicate family providers
1 parent 42bfc39 commit 1585332

File tree

1 file changed

+76
-3
lines changed

1 file changed

+76
-3
lines changed

docs/quickstart.md

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,23 @@ The first provider installed of a family also installs an extra provider-family
1212
> [!NOTE]
1313
> Always install the family provider first to ensure anticipated/right version of image is pulled. Installing sub-provider first creates a missing dependency issue, which the crossplane package-manager always resolves by pulling latest family provider image. It might lead to unexpected behavior.
1414
15+
> [!IMPORTANT]
16+
> Adhere to the following naming format for providers as: `(organization)-(provider-name)`, eg: oracle-samples-provider-family-oci.
17+
> When pulling the image from a registry, crossplane formats the name as `registry.io/organization/provider-name:tags`, eg: ghcr.io/oracle-samples/provider-family-oci:v0.0.1-alpha.1-amd64.
18+
> Crossplane behavior and corresponding steps to resolve conflict detailed in section: [Owner references conflict](#owner-references-conflict)
1519
```
1620
cat <<EOF | kubectl apply -f -
1721
apiVersion: pkg.crossplane.io/v1
1822
kind: Provider
1923
metadata:
20-
name: provider-oci-family
24+
name: oracle-samples-provider-family-oci
2125
spec:
2226
package: ghcr.io/oracle-samples/provider-family-oci:v0.0.1-alpha.1-amd64
2327
---
2428
apiVersion: pkg.crossplane.io/v1
2529
kind: Provider
2630
metadata:
27-
name: provider-oci-objectstorage
31+
name: oracle-samples-provider-oci-objectstorage
2832
spec:
2933
package: ghcr.io/oracle-samples/provider-oci-objectstorage:v0.0.1-alpha.1-amd64
3034
EOF
@@ -44,6 +48,37 @@ provider-oci-objectstorage True True ghcr.io/oracle-samples/provid
4448

4549
It may take up to 5 minutes to report `HEALTHY`.
4650

51+
### Optional: Pulling images from private registry
52+
If you are required to pull images from private registries instead of `ghcr.io`. Mirror the images into, for example `registry1.io`, then utilize the following `ImageConfig` sample to rewrite image paths and configure a pull secret.
53+
54+
[The official crossplane documents](https://docs.crossplane.io/latest/packages/image-configs/#rewriting-image-paths) covers the rewrite image paths in more details.
55+
```
56+
---
57+
apiVersion: pkg.crossplane.io/v1beta1
58+
kind: ImageConfig
59+
metadata:
60+
name: private-registry-rewrite
61+
spec:
62+
matchImages:
63+
- prefix: ghcr.io
64+
rewriteImage:
65+
prefix: registry1.io
66+
67+
# Configure pull secrets for registry1.io
68+
---
69+
apiVersion: pkg.crossplane.io/v1beta1
70+
kind: ImageConfig
71+
metadata:
72+
name: private-registry-auth
73+
spec:
74+
matchImages:
75+
- type: Prefix
76+
prefix: registry1.io
77+
registry:
78+
authentication:
79+
pullSecretRef:
80+
name: private-registry-credentials
81+
```
4782
## Configure family provider for OCI
4883

4984
The official provider-family requires credentials to create and manage OCI resources.
@@ -182,4 +217,42 @@ $ kubectl delete providers/provider-oci-family
182217
183218
> [!Warning]
184219
> Never delete a family provider before deleting its sub-providers. Deleting a family provider while sub-providers are still installed can lead to unexpected behavior and potential errors.
185-
220+
221+
## Owner references conflict
222+
Crossplane’s package manager establishes an ownership chain between a family Provider (parent) and each sub‑provider (child) using metadata.ownerReferences on the child’s ProviderRevision. The owner reference encodes the parent Provider’s “package identity” as a name that the package manager expects to persist:
223+
224+
```
225+
$ kubectl describe providerrevisions/provider-family-oci...
226+
227+
<TRUNCATED OUTPUT>
228+
Owner References:
229+
API Version: pkg.crossplane.io/v1
230+
Block Owner Deletion: true
231+
Controller: true
232+
Kind: Provider
233+
Name: oracle-samples-provider-family-oci
234+
UID: ...
235+
```
236+
237+
What can go wrong
238+
- If the family Provider is deleted or reinstalled with a different metadata.name while any sub‑providers or their ProviderRevisions still exist, Crossplane will attempt to satisfy the outstanding owner reference by automatically pulling a Provider with the name encoded in the ownerReferences (from the same registry as the sub‑provider’s image).
239+
- This results in two family Providers trying to coexist (the one you applied and the one auto‑installed to satisfy the ownerRef), which leads to unhealthy/competing ProviderRevisions and confusing state during upgrades.
240+
241+
Typical symptoms
242+
- An unexpected Provider with name - appears after you delete or rename your family Provider.
243+
- providerrevisions stuck in Unhealthy/Inactive with messages about conflicting ownership or multiple controlling owners.
244+
- Repeated reconcile loops pulling a family image you did not specify explicitly.
245+
246+
### Resolving duplicate family providers
247+
248+
Proceed with clean up of managed resource(s) and providers in order. Refer to the sections: [Delete the managed resource](#delete-the-managed-resource) and [Delete the providers](#delete-the-providers).
249+
250+
After deletion, check for the existence of duplicate family provider by
251+
```
252+
$ kubectl get providers
253+
```
254+
255+
If exists, delete the duplicated family provider by
256+
```
257+
$ kubectl delete providers/<duplicate-provider-name>
258+
```

0 commit comments

Comments
 (0)