infrastructure/DEPLOYMENT.md
2025-09-26 08:59:17 -04:00

1.3 KiB

Deployment Guide

Crossplane Resource Management

Correct Approach - Declarative Updates

Always use kubectl apply for Crossplane Objects:

# 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:

# 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:

    kubectl get objects.kubernetes.crossplane.io -A
    
  2. Verify managed resources:

    kubectl get <resource-type> -n <namespace>
    
  3. Check Object details if issues:

    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