> ## Documentation Index
> Fetch the complete documentation index at: https://infra-docs.kaeyros.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Aide-mémoire : commandes essentielles au quotidien

> Commandes essentielles pour opérer la plateforme Kaeyros : kubectl, ArgoCD, Rollouts, Postgres, certificats, stockage, Ansible, Git, Trivy, Semgrep, Helm.

Cette page regroupe les commandes les plus courantes pour opérer la plateforme Kaeyros. Gardez-la sous la main pour gagner du temps lors des diagnostics, déploiements ou investigations en production.

## Se repérer

```bash Se repérer theme={null}
kubectl get nodes -o wide
kubectl get ns
kubectl -n argocd get applications
kubectl get pods -A -o wide | grep <motif>
```

## Une application

```bash Application theme={null}
kubectl -n <ns> get pods,svc,ingress
kubectl -n <ns> describe pod <pod>
kubectl -n <ns> logs <pod> --tail=200 -f
kubectl -n <ns> logs <pod> --previous
kubectl -n <ns> get pods -o jsonpath='{.items[*].spec.containers[*].image}{"\n"}'
```

## ArgoCD

```bash ArgoCD theme={null}
argocd app list
argocd app get <app>
argocd app get <app> -o json | jq '.spec.source.helm.parameters'   # image réelle
argocd app sync <app>
argocd app history <app>
argocd app rollback <app> <id>
```

## Argo Rollouts

```bash Rollouts theme={null}
kubectl argo rollouts list rollouts -A
kubectl argo rollouts get rollout <app>-rollout-v2 -n <ns> --watch
kubectl argo rollouts promote <app>-rollout-v2 -n <ns>
kubectl argo rollouts abort   <app>-rollout-v2 -n <ns>
kubectl argo rollouts undo    <app>-rollout-v2 -n <ns>
```

## Bases de données

```bash Bases Postgres theme={null}
kubectl get postgresql -A
kubectl -n <ns> exec <cluster>-0 -- patronictl list
kubectl -n <ns> exec -it <cluster>-0 -- psql -U postgres
```

## Certificats

```bash Certificats theme={null}
kubectl get certificate -A | grep -v ' True '
kubectl -n <ns> get challenge,order
```

## Stockage

```bash Stockage theme={null}
kubectl get pvc -A
kubectl -n longhorn-system get volumes.longhorn.io
```

## Ansible

```bash Ansible theme={null}
ansible-playbook -i inventories/production/hosts site.yml --limit <groupe> --check
ansible-playbook -i inventories/production/hosts site.yml --limit <groupe>
ansible -i inventories/production/hosts <groupe> -m ping
```

> [!NOTE]
>
> L'option `--check` permet de simuler l'exécution sans appliquer de changement. Utilisez-la systématiquement avant un déploiement réel. Le repo Ansible est `github.com/kaeyros-analytics-org/ansible-roles` (arborescence à confirmer).

## Git

```bash Git workflow theme={null}
# Rebase workflow
git fetch origin
git rebase origin/develop
# Tag SemVer
git tag -a v1.2.3 -m "Release v1.2.3"
git push origin v1.2.3
```

## Trivy et Semgrep

```bash Sécurité theme={null}
# Scan d'image conteneur
trivy image ghcr.io/kaeyros-analytics-org/<image>:<tag>

# Analyse statique de code
semgrep --config auto
```

## Avant de pousser

```bash Validation Helm theme={null}
helm template test charts/rollout-v2 -f values/<ns>/<app>.yaml -n <ns>
```

> [!TIP]
>
> Faites toujours tourner `helm template` avant de pousser un changement. C'est le seul contrôle réel en l'absence de dry-run sur le cluster de production.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.