Created
November 22, 2021 07:35
-
-
Save tanelmae/ba6152e761a48d071d12929480ddd98e to your computer and use it in GitHub Desktop.
Connect to pod host with AWS SSM
This file contains 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
function aws-pod-host-ssm() { | |
local NODE_NAME=$(kubectl get pods ${1} -o go-template='{{.spec.nodeName}}') | |
local PROVIDER_ID=$(kubectl get node $NODE_NAME -o go-template='{{.spec.providerID}}') | |
local INSTANCE_ID=${PROVIDER_ID#*//*/*/} | |
aws ssm start-session --target $INSTANCE_ID | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment