Last active
October 25, 2019 02:55
-
-
Save superbrothers/f13a8e17b67c8072775829bf1830d28a to your computer and use it in GitHub Desktop.
Kubernetes 1.16 Ephemeral Containers (alpha) - Kubernetes Meetup Tokyo #24 (2019/10/24)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: debugtest | |
spec: | |
shareProcessNamespace: true | |
containers: | |
- name: myapp | |
image: docker.io/superbrothers/distroless-examples-nodejs-hello-http | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: debugtest | |
spec: | |
selector: | |
app: debugtest | |
ports: | |
- port: 80 | |
targetPort: 8000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install kubectl-debug kubectl plugin | |
curl -s -L -o- "https://github.com/verb/kubectl-debug/releases/download/v0.1.2/kubectl-debug_$(uname | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" | tar xzf - kubectl-debug | |
mkdir -p ~/bin | |
mv kubectl-debug ~/bin | |
export PATH="$HOME/bin:$PATH" | |
kubectl debug -h | |
--- | |
minikube version | |
minikube start --kubernetes-version=v1.16.2 --feature-gates=EphemeralContainers=true | |
kubectl version | |
kubectl get po -n kube-system kube-apiserver-minikube -o yaml | grep feature-gates | |
cat debugtest.yaml | |
kubectl apply -f debugtest.yaml | |
kubectl exec -it debugtest /bin/sh | |
kubectl debug debugtest --attach | |
kubectl debug debugtest --attach -c debugger2 --image chriswayg/toolbox | |
# tcpdump -A dst port 8000 | |
# strace -p 6 | |
--- | |
kubectl run busybox --image=busybox --restart=Never --rm -it | |
# wget -q -O- debugtest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment