Skip to content

Commit b765ea6

Browse files
committed
addressing feedback
Signed-off-by: Scott Nichols <[email protected]>
1 parent 7ed06f6 commit b765ea6

File tree

5 files changed

+45
-74
lines changed

5 files changed

+45
-74
lines changed

content/master/get-started/get-started-with-mrds.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@ You can edit the default activation policy directly:
5151
{{< tabs >}}
5252
{{< tab "Edit Existing Policy" >}}
5353
```shell
54-
# Permanently disable by using a non-matching pattern
55-
kubectl patch mrap crossplane-default-activation-policy --type='merge' \
56-
-p='{"spec":{"activations":["nonexistent.example.com"]}}'
57-
58-
# Or remove all activations entirely
59-
kubectl patch mrap crossplane-default-activation-policy --type='merge' \
60-
-p='{"spec":{"activations":[]}}'
54+
# Delete the default policy and restart Crossplane using Helm
55+
kubectl delete mrap crossplane-default-activation-policy
56+
helm upgrade crossplane crossplane-stable/crossplane \
57+
--set provider.defaultActivations=null \
58+
--namespace crossplane-system --reuse-values
59+
kubectl rollout restart deployment/crossplane -n crossplane-system
6160
```
6261

6362
{{< hint "note" >}}

content/master/guides/implementing-safestart.md

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ Plan for breaking changes and thorough testing before implementing.
1919
safe-start transforms how your provider handles resource installation:
2020

2121
**Without safe-start:**
22-
- All managed resources become CRDs when provider installs
22+
- All resources become MRDs that are automatically active and create CRDs
2323
- Users get all ~200 AWS resources even if they need only 5
2424
- Higher memory usage and slower API server responses
2525

2626
**With safe-start:**
27-
- All managed resources become inactive MRDs when provider installs
27+
- All resources become MRDs that are inactive by default
2828
- Users activate only needed resources through policies
2929
- Lower resource overhead and better performance
3030

@@ -51,7 +51,7 @@ metadata:
5151
spec:
5252
package: registry.example.com/provider-example:v1.0.0
5353
capabilities:
54-
- name: safe-start
54+
- safe-start
5555
```
5656
5757
{{< hint "tip" >}}
@@ -148,42 +148,27 @@ func configureConnectionDetails(p *ujconfig.Provider) {
148148
{{< /tab >}}
149149
{{< /tabs >}}
150150

151-
### Step 3: Handle namespaced resources
151+
### Step 3: Update RBAC Permissions
152152

153-
safe-start works best with namespaced managed resources. Update your resources
154-
to support both cluster and namespaced scopes:
153+
safe-start providers need extra permissions to manage CRDs dynamically. Crossplane's RBAC manager automatically provides these permissions when you install safe-start providers.
155154

156-
```go
157-
// Update resource definitions to support namespacing
158-
type Database struct {
159-
metav1.TypeMeta `json:",inline"`
160-
metav1.ObjectMeta `json:"metadata,omitempty"`
161-
162-
Spec DatabaseSpec `json:"spec"`
163-
Status DatabaseStatus `json:"status,omitempty"`
164-
}
165-
166-
// Update your CRD generation
167-
//+kubebuilder:resource:scope=Namespaced
168-
//+kubebuilder:object:root=true
169-
//+kubebuilder:subresource:status
170-
type Database struct {
171-
// ... resource definition
172-
}
155+
{{< hint "note" >}}
156+
Manual RBAC configuration is only required if you disable Crossplane's RBAC manager (with `--args=--disable-rbac-manager`).
157+
{{< /hint >}}
173158

174-
// Optionally create cluster-scoped variants
175-
//+kubebuilder:resource:scope=Cluster
176-
//+kubebuilder:object:root=true
177-
//+kubebuilder:subresource:status
178-
type ClusterDatabase struct {
179-
// ... same spec but cluster scoped
180-
}
159+
**Automatically provided permissions:**
160+
```yaml
161+
# Crossplane RBAC manager grants these permissions automatically
162+
# safe-start permissions
163+
- apiGroups: ["apiextensions.k8s.io"]
164+
resources: ["customresourcedefinitions"]
165+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
166+
- apiGroups: ["apiextensions.crossplane.io"]
167+
resources: ["managedresourcedefinitions"]
168+
verbs: ["get", "list", "watch", "update", "patch"]
181169
```
182170
183-
### Step 4: Update RBAC Permissions
184-
185-
safe-start providers need extra permissions to manage CRDs dynamically:
186-
171+
**Manual configuration (only if you disable RBAC manager):**
187172
```yaml
188173
apiVersion: rbac.authorization.k8s.io/v1
189174
kind: ClusterRole
@@ -207,7 +192,7 @@ rules:
207192
verbs: ["get", "list", "watch", "update", "patch"]
208193
```
209194
210-
### Step 5: Implement managed resource definition controller logic
195+
### Step 4: Implement managed resource definition controller logic
211196
212197
Add controller logic to handle MRD activation and CRD lifecycle:
213198
@@ -280,7 +265,7 @@ func (r *MRDReconciler) createCRD(ctx context.Context, mrd *xpv1alpha1.ManagedRe
280265
}
281266
```
282267

283-
### Step 6: Update build and continuous integration processes
268+
### Step 5: Update build and continuous integration processes
284269

285270
Update your build process to generate MRDs alongside CRDs:
286271

@@ -311,7 +296,7 @@ build-package: generate
311296
echo "kind: Provider" >> package/provider.yaml
312297
echo "spec:" >> package/provider.yaml
313298
echo " capabilities:" >> package/provider.yaml
314-
echo " - name: safe-start" >> package/provider.yaml
299+
echo " - safe-start" >> package/provider.yaml
315300
```
316301
{{< /tab >}}
317302

@@ -378,7 +363,7 @@ jobs:
378363
{{< /tab >}}
379364
{{< /tabs >}}
380365

381-
### Step 7: Add connection details documentation
366+
### Step 6: Add connection details documentation
382367

383368
Document connection details in your MRDs to help users understand resource
384369
capabilities:
@@ -496,7 +481,7 @@ metadata:
496481
spec:
497482
package: registry.example.com/provider-example:latest
498483
capabilities:
499-
- name: safe-start
484+
- safe-start
500485
EOF
501486

502487
# Wait for provider installation

content/master/guides/mrd-activation-policies.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,12 @@ You can change the default activation policy directly and changes persist:
9292
# View current default policy
9393
kubectl get mrap crossplane-default-activation-policy -o yaml
9494

95-
# Permanently change to disable default activation
96-
kubectl patch mrap crossplane-default-activation-policy --type='merge' \
97-
-p='{"spec":{"activations":["nonexistent.example.com"]}}'
98-
99-
# Or remove all activations
100-
kubectl patch mrap crossplane-default-activation-policy --type='merge' \
101-
-p='{"spec":{"activations":[]}}'
102-
103-
# Or delete the default policy entirely
95+
# Delete the default policy and restart Crossplane using Helm
10496
kubectl delete mrap crossplane-default-activation-policy
97+
helm upgrade crossplane crossplane-stable/crossplane \
98+
--set provider.defaultActivations=null \
99+
--namespace crossplane-system --reuse-values
100+
kubectl rollout restart deployment/crossplane -n crossplane-system
105101
```
106102

107103
{{< hint "note" >}}

content/master/managed-resources/managed-resource-definitions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Kubernetes Custom Resource Definitions (CRDs) that enables selective
99
installation and better documentation of managed resources.
1010

1111
{{< hint "note" >}}
12-
MRDs are available in Crossplane v2.0+ as an alpha feature.
12+
MRDs are available in Crossplane v2.0+ as a beta feature.
1313
{{< /hint >}}
1414

1515
<!-- vale write-good.Passive = NO -->
@@ -193,7 +193,7 @@ Without safe-start, all MRDs are active by default for backward compatibility.
193193
# In provider package metadata
194194
spec:
195195
capabilities:
196-
- name: safe-start
196+
- safe-start
197197
```
198198

199199
{{< hint "note" >}}

content/master/packages/provider-capabilities.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ metadata:
2222
name: provider-aws
2323
spec:
2424
capabilities:
25-
- name: safe-start
26-
- name: CustomCapability
25+
- safe-start
26+
- CustomCapability
2727
```
2828
2929
Crossplane reads these capabilities and modifies its behavior when installing
@@ -39,19 +39,19 @@ The `safe-start` capability changes how Managed Resource Definitions (MRDs) are
3939
activated when you install the provider.
4040

4141
**Without safe-start:**
42-
- All MRDs are automatically activated
43-
- Crossplane creates all corresponding CRDs when provider installs
42+
- All resources become MRDs that are automatically active
43+
- Active MRDs create corresponding CRDs
4444
- Compatible with legacy providers and existing workflows
4545

4646
**With safe-start:**
47-
- All MRDs start in `Inactive` state
47+
- All resources become MRDs that start in `Inactive` state
4848
- No CRDs until you explicitly activate MRDs
4949
- Reduces initial resource overhead and improves performance
5050

5151
```yaml
5252
spec:
5353
capabilities:
54-
- name: safe-start
54+
- safe-start
5555
```
5656

5757
{{< hint "tip" >}}
@@ -79,7 +79,7 @@ Don't use safe-start when:
7979
Crossplane supports flexible matching for capability names:
8080

8181
* **Exact match**: `safe-start`
82-
* **Case variations**: `safestart`, `safe-start`, `safe-start`
82+
* **Case variations**: `SafeStart`, `safestart`, `safe-start`
8383
* **Fuzzy matching**: Handles common spelling variations
8484

8585
This flexibility prevents issues when providers use different naming conventions.
@@ -180,7 +180,7 @@ metadata:
180180
spec:
181181
package: registry.example.com/my-provider:v2.0.0
182182
capabilities:
183-
- name: safe-start
183+
- safe-start
184184
```
185185

186186
### Managed resource definition generation with connection details
@@ -305,15 +305,6 @@ kubectl get mrap -o wide
305305
kubectl top nodes
306306
```
307307

308-
## Future capabilities
309-
310-
The capability system is extendable. Future capabilities might include:
311-
312-
* **ResourceQuotas** - Automatic resource limit management
313-
* **NetworkPolicies** - Provider-specific network isolation
314-
* **CustomValidation** - Enhanced resource validation
315-
* **TelemetryOpt** - Telemetry and observability features
316-
317308
## Troubleshooting capabilities
318309

319310
### Common issues

0 commit comments

Comments
 (0)