On the github action I login to Azure CLI and then Connect to the cluster by following commands:
az login
az aks get-credentials --resource-group $AKS_PERS_RESOURCE_GROUP --name $AKS_CLUSTER_NAME
Then I Connect to kubernete pods by following command
kubectl exec -it mypod -- //bin/bash
If you use the -it flag on the local machine, there should be no problem. However, when running on Github action, it will have a warning:
Unable to use a TTY - input is not a terminal or the right kind of file
Then I Connect to postgres localhost by following command.
psql -h 127.0.0.1 -p 5432 -d postgres -U postgres
I tried removing the -t flag according to some tutorials but it didn't work.
This means cannot connect to kubernete pods. In fact, when I connect with my local computer, it succeeds