A kubectl plugin for intercepting HTTP traffic to Kubernetes Services using mitmproxy.
kubectl mittens SERVICE [OPTIONS]Examples:
kubectl mittens my-service -n my-namespace # Auto-detect port
kubectl mittens my-service -p 8080 # Explicit port
kubectl mittens my-service -p 443 --https # HTTPS serviceOptions:
-n, --namespace STRING: Target namespace-p, --port INT: Service port (auto-detected if omitted)--https: Enable for HTTPS services-i, --image STRING: Custom proxy image--command-args STRING: Custom mitmproxy arguments
What happens:
- Deploy mitmproxy sidecar to service pods
- Redirect traffic through mitmproxy
- Open interactive mitmproxy TUI
- Auto-cleanup on exit (Ctrl+C)
Binary: Download from Releases
From source: go install github.com/Lappihuan/mittens/cmd/kubectl-mittens@latest
With Krew: kubectl krew install mittens
Add to ~/.k9s/plugins.yaml:
plugins:
mittens:
shortCut: Ctrl-T
description: "mittens: inject mitmproxy sidecar"
scopes:
- services
command: kubectl
background: false
args:
- mittens
- $NAME
- -n
- $NAMESPACEWhen using mittens with GitOps tools, Service port modifications may be reconciled back to the desired state. mittens handles this automatically for Flux. For ArgoCD, manual configuration is required.
mittens automatically adds helm.toolkit.fluxcd.io/driftDetection: disabled annotation to tapped Services, preventing drift detection from rolling back changes. No configuration needed.
Add ignoreDifferences to your Application to prevent auto-sync from reverting the port changes:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
spec:
ignoreDifferences:
- group: ""
kind: Service
name: my-service
namespace: default
jsonPointers:
- /spec/ports/0/targetPortApache 2.0. See LICENSE.
mittens is a fork of kubetap by Soluble Inc.
