Skip to content

Commit

Permalink
chore(eks): log the command before invoking aws eks (aws#12088)
Browse files Browse the repository at this point in the history
It seems it is possible to hit a condition where `aws eks update-kubeconfig`
command may indefinitely hang: never returns until lambda is killed
by timeout.

Add debug print so that it is possible to easier localize the issue.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
valters authored and flochaz committed Jan 5, 2021
1 parent 566554a commit e2b2042
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ def apply_handler(event, context):
overwrite = props.get('Overwrite', False)

# "log in" to the cluster
subprocess.check_call([ 'aws', 'eks', 'update-kubeconfig',
cmd = [ 'aws', 'eks', 'update-kubeconfig',
'--role-arn', role_arn,
'--name', cluster_name,
'--kubeconfig', kubeconfig
])
]
logger.info(f'Running command: {cmd}')
subprocess.check_call(cmd)

# write resource manifests in sequence: { r1 }{ r2 }{ r3 } (this is how
# a stream of JSON objects can be included in a k8s manifest).
Expand Down

0 comments on commit e2b2042

Please sign in to comment.