63 lines
1.3 KiB
Markdown
63 lines
1.3 KiB
Markdown
|
|
# Deployment Guide
|
||
|
|
|
||
|
|
## Crossplane Resource Management
|
||
|
|
|
||
|
|
### ✅ Correct Approach - Declarative Updates
|
||
|
|
|
||
|
|
Always use `kubectl apply` for Crossplane Objects:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Make changes to YAML files
|
||
|
|
kubectl apply -f filename.yaml
|
||
|
|
|
||
|
|
# For directory updates
|
||
|
|
kubectl apply -f .
|
||
|
|
```
|
||
|
|
|
||
|
|
This will:
|
||
|
|
- Update existing Objects (shows "configured")
|
||
|
|
- Create new Objects (shows "created")
|
||
|
|
- Leave unchanged Objects (shows "unchanged")
|
||
|
|
- Maintain resource state and ownership
|
||
|
|
|
||
|
|
### ❌ Avoid - Delete/Recreate Pattern
|
||
|
|
|
||
|
|
Don't use delete/apply cycles unless absolutely necessary:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# This is generally wrong for routine updates
|
||
|
|
kubectl delete -f filename.yaml
|
||
|
|
kubectl apply -f filename.yaml
|
||
|
|
```
|
||
|
|
|
||
|
|
Only use delete/recreate for:
|
||
|
|
- Schema changes that require recreation
|
||
|
|
- Fixing stuck resources
|
||
|
|
- Resource type changes
|
||
|
|
|
||
|
|
### Verification Steps
|
||
|
|
|
||
|
|
After applying changes:
|
||
|
|
|
||
|
|
1. Check Crossplane Object status:
|
||
|
|
```bash
|
||
|
|
kubectl get objects.kubernetes.crossplane.io -A
|
||
|
|
```
|
||
|
|
|
||
|
|
2. Verify managed resources:
|
||
|
|
```bash
|
||
|
|
kubectl get <resource-type> -n <namespace>
|
||
|
|
```
|
||
|
|
|
||
|
|
3. Check Object details if issues:
|
||
|
|
```bash
|
||
|
|
kubectl describe object <name> -n crossplane-system
|
||
|
|
```
|
||
|
|
|
||
|
|
### GitOps Compatibility
|
||
|
|
|
||
|
|
This declarative approach ensures:
|
||
|
|
- Flux/ArgoCD can manage resources properly
|
||
|
|
- No unexpected deletions
|
||
|
|
- Proper drift detection
|
||
|
|
- Safe rollbacks
|