#kubectl-export
Since kubectl —export is deprecated it is possible to do something like this.
WARNING: I have not tested this
#!/bin/bashd=$(date +%Y%m%d)BACKUP_TARGET="/TANK/ARCHIVE/argocd-backups/argocd_backup_yaml"kubectl -n argocd get cm -o=json | jq 'del(.metadata.resourceVersion,.metadata.uid,.metadata.selfLink,.metadata.creationTimestamp,.metadata.annotations,.metadata.generation,.metadata.ownerReferences,.status)' | yq eval . --prettyPrint > $BACKUP_TARGETkubectl -n argocd get secrets -o=json | jq 'del(.metadata.resourceVersion,.metadata.uid,.metadata.selfLink,.metadata.creationTimestamp,.metadata.annotations,.metadata.generation,.metadata.ownerReferences,.status)' | yq eval . --prettyPrint >> $BACKUP_TARGETkubectl -n argocd get app -o=json | jq 'del(.metadata.resourceVersion,.metadata.uid,.metadata.selfLink,.metadata.creationTimestamp,.metadata.annotations,.metadata.generation,.metadata.ownerReferences,.status)' | yq eval . --prettyPrint >> $BACKUP_TARGETkubectl -n argocd get appproj -o=json | jq 'del(.metadata.resourceVersion,.metadata.uid,.metadata.selfLink,.metadata.creationTimestamp,.metadata.annotations,.metadata.generation,.metadata.ownerReferences,.status)' | yq eval . --prettyPrint >> $BACKUP_TARGET