Skip to main content
Quick reference for common commands used to manage, debug, and operate the Kubernetes cluster with Flux, Cilium, and other components.

Flux CLI Commands

Manage GitOps resources and check reconciliation status.

Get Resources

flux get all

Reconcile Resources

Force immediate reconciliation:
flux reconcile kustomization flux-system
flux reconcile ks flux-system --with-source

Suspend and Resume

Temporarily stop automatic reconciliation:
flux suspend kustomization infrastructure
flux suspend helmrelease prometheus -n flux-system

View Logs

flux logs
flux logs --all-namespaces

Export Configuration

Export Flux resources:
flux export kustomization flux-system
flux export helmrelease cert-manager -n flux-system
flux export source git flux-system

Check Dependencies

View resource dependency tree:
flux tree kustomization flux-system
flux tree kustomization infrastructure

Diff Changes

Preview changes before applying:
flux diff kustomization flux-system --path=./cluster/kimawesome
flux diff helmrelease prometheus -n flux-system

kubectl Commands

Standard Kubernetes operations.

Get Resources

kubectl get pods
kubectl get pods -n observability
kubectl get pods --all-namespaces
kubectl get pods -o wide

Describe Resources

Get detailed information:
kubectl describe pod <pod-name>
kubectl describe pod -n observability <pod-name>

View Logs

kubectl logs <pod-name>
kubectl logs <pod-name> -n observability
kubectl logs <pod-name> --follow
kubectl logs <pod-name> --tail=100

Execute Commands

kubectl exec -it <pod-name> -- /bin/bash
kubectl exec -it <pod-name> -n observability -- /bin/sh

Port Forwarding

Access services locally:
kubectl port-forward pod/<pod-name> 8080:80
kubectl port-forward -n observability pod/prometheus-0 9090:9090

Apply and Delete

kubectl apply -f manifest.yaml
kubectl apply -k overlays/kimawesome/infrastructure/
kubectl apply -f . --recursive

Scale Resources

kubectl scale deployment <name> --replicas=3
kubectl scale deployment -n observability prometheus --replicas=2

Rollout Management

kubectl rollout status deployment/<name>
kubectl rollout status deployment/grafana -n observability

Resource Usage

kubectl top nodes
kubectl top pods
kubectl top pods -n observability
kubectl top pods --all-namespaces

Kustomize Commands

Build and preview Kustomize configurations.
kubectl kustomize overlays/base/cert-manager/
kubectl kustomize overlays/kimawesome/infrastructure/

Cilium Commands

Manage Cilium CNI and network policies.

Status Check

cilium status
cilium status --wait

Monitor Traffic

cilium monitor

Network Policies

cilium policy get
cilium policy validate policy.yaml

Troubleshooting

cilium debuginfo
cilium troubleshoot

Helm Commands

Manage Helm releases directly.

List Releases

helm list --all-namespaces

Release Information

helm status prometheus -n observability

Rollback

helm rollback prometheus -n observability
helm rollback prometheus 2 -n observability

kubeseal Commands

Manage Sealed Secrets for secure secret storage.

Create Sealed Secret

kubeseal -f secret.yaml -w sealed-secret.yaml

Fetch Certificate

kubeseal --fetch-cert > pub-cert.pem
kubeseal --fetch-cert --controller-namespace=sealed-secrets

Encrypt Value

echo -n "mypassword" | kubeseal --raw \
  --name=mysecret \
  --namespace=default \
  --from-file=/dev/stdin

Cert-Manager Commands

Manage TLS certificates.

Check Resources

kubectl get certificates --all-namespaces
kubectl get cert -n default
kubectl describe certificate <cert-name>

Renew Certificate

kubectl delete certificaterequest <request-name>
# cert-manager will automatically create a new request

Debugging Commands

Network Debugging

kubectl run -it --rm debug --image=busybox --restart=Never -- nslookup kubernetes.default

Event Monitoring

kubectl get events --all-namespaces --sort-by='.lastTimestamp'
kubectl get events -n flux-system --watch
kubectl get events --field-selector type=Warning

Resource Issues

kubectl describe node <node-name> | grep -A 5 Allocated
kubectl get pods --all-namespaces --field-selector=status.phase=Pending
kubectl get pods --all-namespaces --field-selector=status.phase=Failed

Quick Diagnostics

Cluster Health Check

#!/bin/bash
echo "=== Nodes ==="
kubectl get nodes

echo "\n=== Flux Status ==="
flux get all

echo "\n=== Failed Pods ==="
kubectl get pods --all-namespaces --field-selector=status.phase!=Running,status.phase!=Succeeded

echo "\n=== Recent Events ==="
kubectl get events --all-namespaces --sort-by='.lastTimestamp' | tail -10

Component Status

#!/bin/bash
echo "Cilium:" && cilium status --brief
echo "cert-manager:" && kubectl get pods -n cert-manager
echo "MetalLB:" && kubectl get pods -n metallb-system
echo "Prometheus:" && kubectl get pods -n observability -l app.kubernetes.io/name=prometheus

Aliases

Useful shell aliases to add to your ~/.bashrc or ~/.zshrc:
alias k='kubectl'
alias kgp='kubectl get pods'
alias kgs='kubectl get svc'
alias kgn='kubectl get nodes'
alias kdp='kubectl describe pod'
alias kl='kubectl logs'
alias kex='kubectl exec -it'

alias f='flux'
alias fga='flux get all'
alias fgk='flux get kustomizations'
alias fgh='flux get helmreleases'
alias frk='flux reconcile kustomization'
alias frh='flux reconcile helmrelease'

alias kustomize='kubectl kustomize'
alias kg='kubectl get'
alias kd='kubectl describe'
alias ka='kubectl apply -f'

Build docs developers (and LLMs) love