Skip to content

Instantly share code, notes, and snippets.

@nithu0115
Created October 5, 2019 00:07
Show Gist options
  • Save nithu0115/1f09ce1414f0430bdfe337d2e7461ce6 to your computer and use it in GitHub Desktop.
Save nithu0115/1f09ce1414f0430bdfe337d2e7461ce6 to your computer and use it in GitHub Desktop.
Title: Gather logs from Worker Nodes without SSH'ing into the instance using `kubectl proxy`
Services: eks; kubernetes
Summary
Gather logs from Worker Nodes without SSH'ing into the instacne
Q) How to get logs from a Worker nodes if customers cannot SSH into the instance as they don’t have a keypair associated (for security reasons) and without detaching the volume and attaching it to another instance to troubleshoot an issue?
Solution:
To gather logs, first run
1) kubectl proxy --port=8080 from where you have installed kubectl to communicate with your cluster and then
(If you are using bastion host, then SSH tunnel to port forward:ssh -i <<Keypair>> ec2-user@<<Public_IP_Workstation>> -L 8080:127.0.0.1:8080)
2) Open a browser and access this URL: http://localhost:8080/api/v1/nodes/<“Woker Node Name">/proxy/logs/aws-routed-eni/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment