Last active
November 17, 2020 20:00
-
-
Save suhas316380/d3026871292dd6d5317c09a1f31d7905 to your computer and use it in GitHub Desktop.
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
kubectl-debug create -f- <<EOF | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: privileged-debug | |
spec: | |
hostNetwork: true | |
containers: | |
- name: privileged-debug | |
image: ubuntu | |
securityContext: | |
privileged: true | |
args: | |
- sleep | |
- "600" | |
volumeMounts: | |
- name: host | |
mountPath: /host | |
volumes: | |
- name: host | |
hostPath: | |
path: / | |
type: Directory | |
nodeSelector: | |
kubernetes.io/hostname: ip-your-hostname-here.us-west-2.compute.internal | |
EOF | |
kubectl-debug exec --stdin --tty privileged-debug -- /bin/bash | |
apt update | |
apt install curl sudo | |
mkdir /logs | |
cd /host/home/ec2-user | |
curl -O https://raw.githubusercontent.com/awslabs/amazon-eks-ami/master/log-collector-script/linux/eks-log-collector.sh | |
chroot /host bash /home/ec2-user/eks-log-collector.sh | |
cp /host/var/log/eks_i-1234567_your_log_file_name_here.tar.gz /logs | |
cd /logs | |
// optionally exact logs here and read on instance | |
tar -xzf eks_i-1234567_your_log_file_name_here.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment