End to end deployment and observability of polyglot microservices in Amazon EKS using AWS App Mesh, AWS Fargate, Amazon Cloudwatch Container Insights, and AWS X-Ray
MIT No Attribution
64
stars
636
forks
source link
fixed hostname (command not found) failure in init-mysql stateful sets #22
Our workshop class (everyone) ran into the following issue during Stateful sets deployment, which was a showstopper:
The Issue: mysql-0 failed to deploy due to an issue in init-mysql, as seen in the logs for this init container :
$ kubectl -n workshop logs mysql-0 -c init-mysql
++ hostname
bash: line 2: hostname: command not found
The fix: I changed to this version you see. Essentially if the (current) hostname command fails, then it tries the next best thing: cat /etc/hostname . This worked like a charm, as seen in subsequent logs:
As seen above, despite the failed hostname command, the second option succeeded and the stateful sets pods (mysql-0 and mysql-1) get created successfully
Our workshop class (everyone) ran into the following issue during Stateful sets deployment, which was a showstopper:
The Issue: mysql-0 failed to deploy due to an issue in init-mysql, as seen in the logs for this init container :
The fix: I changed to this version you see. Essentially if the (current)
hostname
command fails, then it tries the next best thing:cat /etc/hostname
. This worked like a charm, as seen in subsequent logs:As seen above, despite the failed hostname command, the second option succeeded and the stateful sets pods (mysql-0 and mysql-1) get created successfully