שליפה מהירה
סדר חירום
Section titled “סדר חירום”| סוג התקלה | הפקודה הראשונה | עמוד |
|---|---|---|
Pod לא Running / CrashLoopBackOff / Pending | kubectl -n <NS> describe pod -l trident.dev/service=<SERVICE> | kubernetes |
Application לא Synced/Healthy | kubectl -n argocd get application <APP> -o jsonpath='{.status.conditions}{"\n"}' | argocd/operate |
שגיאת render / YAML parse error | helm template <RELEASE> <CHART_DIR> -n <NS> -f <FILE> -f <FILE> --set defaultImageTag=probe | helm |
403 / Access denied / repository not found | git ls-remote https://oauth2:$(cat <TOKEN_FILE>)@<GITLAB_HOST>/<GROUP>/<REPO>.git HEAD | credentials |
Synced+Healthy אבל לא עובד | curl -k --resolve <HOST>:<PORT>:<VM_IP> https://<HOST>:<PORT>/info | verify |
לא מצאת? טבלת הסימפטומים המלאה.
git status -sb # where am Igit switch -c <BRANCH> # new branch, switchgit add <FILE> # stage one filegit commit -m "describe the change" # commit stagedgit push -u origin <BRANCH> # first push of branchgit fetch # update remote viewgit pull --rebase # after non-fast-forwardgit log --oneline --graph --all -15 # see the shapegit tag <TAG> # lightweight taggit push origin <TAG> # tags push separatelygit reflog # find lost commitgit revert --no-edit <SHA> # undo pushed commitהמלא: git/overview · branches · sync · undo
GitLab / CI
Section titled “GitLab / CI”Pipelines: Build -> PipelinesJob log: click the job in the graphValidate: Build -> Pipeline editor -> ValidateManual job: click play on promote:prodVariables: Settings -> CI/CD -> VariablesMembers: Manage -> Membersgit ls-remote origin <BRANCH> # did GitLab get itgit push origin HEAD:<BRANCH> # push current commit thereinclude: - project: "$TRIDENT_GROUP/trident-ci" ref: main file: pipelines/source.ymlהמלא: gitlab/overview · ci/overview · ci/patterns
Docker
Section titled “Docker”docker build -t <IMAGE>:<CANDIDATE> -f services/<SERVICE>/Dockerfile services/ # context = parent dircat <TOKEN_FILE> | docker login -u <USER> --password-stdin <REGISTRY> # login from filedocker push <IMAGE>:<CANDIDATE> # push one imagedocker logout <REGISTRY> # drop credentialsdocker image ls --format '{{.Repository}}:{{.Tag}}' # local imagesdocker info --format '{{.Driver}}' # blob unknown checkהמלא: docker/overview
bash -n <FILE> # syntax check onlysed -i 's/\r$//' <FILE> # strip CRLFgrep -nE ' +$' <FILE> # trailing whitespacebash <FILE> # run without +xenv | grep <VAR_NAME> # is it set here#!/usr/bin/env bashset -euo pipefailENV="${1:?usage: example.sh <ENV>}" # required argumentDIR="${TRIDENT_LOCAL_DIR:-$HOME/.local/share/trident}" # default valueהמלא: bash/overview · snippets · templates
helm template <RELEASE> <CHART_DIR> -n <NS> -f base.yaml -f <ENV>.yaml -f versions/<ENV>.yaml # one -f per filehelm template <RELEASE> <CHART_DIR> -n <NS> -f base.yaml --set defaultImageTag=probe # isolate empty taghelm template <RELEASE> <CHART_DIR> -n <NS> -f base.yaml -s templates/networking/ingress.yml # one templatehelm template <RELEASE> <CHART_DIR> -n <NS> -f base.yaml | grep '# Source:' | sort -u # which files renderhelm show values <CHART_DIR> # settable keyshelm lint <CHART_DIR> -f base.yaml # lint, not templateהמלא: helm/overview · values · testing
kubectl
Section titled “kubectl”kubectl -n <NS> get pods -o wide # state, node, IPkubectl -n <NS> get deploy,sts,svc,ingress,pvc,cm,secret # all objectskubectl -n <NS> describe pod -l trident.dev/service=<SERVICE> # read Eventskubectl -n <NS> get events --sort-by=.lastTimestamp # newest lastkubectl -n <NS> logs deploy/<SERVICE> --tail=50 # recent logskubectl -n <NS> logs deploy/<SERVICE> --previous # before last crashkubectl -n <NS> exec -it deploy/<SERVICE> -- sh # shell insidekubectl -n <NS> rollout restart deploy/<SERVICE> # restart Deploymentkubectl -n <NS> logs <POD> -c <CONTAINER> # one container; no logs = never started, use describekubectl -n <NS> delete pod <POD> # StatefulSet: broken Pod is not auto-replaced after a Git fixkubectl -n <NS> delete statefulset <SERVICE> # immutable volumeClaimTemplates: delete STS + its PVC,kubectl -n <NS> delete pvc <PVC> # then manual sync; never delete the StorageClasskubectl -n <NS> get secret <SECRET> -o jsonpath='{.data}' | jq 'keys' # key names onlykubectl get sc # StorageClasseskubectl -n ingress-nginx get svc # NodePort after 443:המלא: kubernetes/overview · secrets · networking · storage-probes
Argo CD
Section titled “Argo CD”kubectl -n argocd get applications # all appskubectl -n argocd get application <APP> -o jsonpath='{.status.sync.status}/{.status.health.status}{"\n"}' # sync/healthkubectl -n argocd get application <APP> -o jsonpath='{.status.conditions}{"\n"}' # why Unknownkubectl -n argocd get application <APP> -o jsonpath='{.status.operationState.message}{"\n"}' # last sync messagekubectl -n argocd get application <APP> -o jsonpath='{.status.operationState.finishedAt}{"\n"}' # compare with datekubectl -n argocd annotate application <APP> argocd.argoproj.io/refresh=hard --overwrite # re-read Git (does not restart a Failed sync)kubectl -n argocd patch application <APP> --type merge -p '{"operation":{"initiatedBy":{"username":"admin"},"sync":{"syncStrategy":{"hook":{}}}}}' # manual synckubectl -n argocd get secret <SECRET> -o jsonpath='{.data.url}' | base64 -d; echo # repo url byteskubectl apply -f <FILE> # root only, onceהמלא: argocd/overview · applications · operate
curl / verify
Section titled “curl / verify”curl -k --resolve <HOST>:<PORT>:<VM_IP> https://<HOST>:<PORT>/info # version, counterskubectl -n <NS> get pods # all 1/1 Runningkubectl -n <NS> get pvc # Boundkubectl -n argocd get applications # Synced/Healthygit pull --ff-only # latest versions filescat apps/trident/versions/<ENV>.yaml # tag per environmentהמלא: verify/overview · debugging/symptoms
Cleanup
Section titled “Cleanup”kubectl delete application <APP> -n argocd --ignore-not-found --wait=true # root firstkubectl delete namespace <NS> --ignore-not-found --wait=true # also deletes PVCkubectl delete secret <SECRET> -n argocd --ignore-not-found # repo Secretskubectl get applications -n argocd # expect nonekubectl get ns # no project namespacesהמלא: verify/cleanup