Kubernetes Challenge #3 Lab not completing postgres error


Having issues with Kubernetes Challenge #3 Postgres not initialized, thus lab not completing.


Lab error

Hi @serinsusansunny ,
Will you please check your work with our solutions?

Regards,
KodeKloud Support

Missed this part.
env:
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
in the container.
How can I know to add this(in any use cases or is it by default)? This parameter is not mentioned in the lab. Thus, asking.
But thank you for the help.

Hi @serinsusansunny ,
In such cases, you need to do some troubleshooting for this. As you can see in your shared screenshot. You did kubectl logs and some errors were clearly visible in the output.

Regards,

Getting below error in worker pod logs due to which worker pod is in CrashLoopBackOff.

controlplane ➜ k logs worker-78645fb679-h9ns8 -n vote
System.AggregateException: One or more errors occurred. (No such device or address) —> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: No such device or address
at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)
at System.Net.Dns.EndGetHostAddresses(IAsyncResult asyncResult)
at System.Net.Dns.<>c.b__14_1(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
— End of inner exception stack trace —
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout) at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout) at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout) at Npgsql.ConnectorPool.Allocate(NpgsqlConnection conn, NpgsqlTimeout timeout) at Npgsql.NpgsqlConnection.OpenInternal() at Worker.Program.OpenDbConnection(String connectionString) in /code/src/Worker/Program.cs:line 74 at Worker.Program.Main(String[] args) in /code/src/Worker/Program.cs:line 19 ---> (Inner Exception #0) System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: No such device or address at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult) at System.Net.Dns.EndGetHostAddresses(IAsyncResult asyncResult) at System.Net.Dns.<>c.<GetHostAddressesAsync>b__14_1(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task`1 promise, Boolean requiresSynchronization)<—

controlplane ➜ k get pods -n vote
NAME READY STATUS RESTARTS AGE
db-deployment-7bfb789f65-bpl5z 1/1 Running 0 3m1s
redis-deployment-75d4bf6cf6-l7k2m 1/1 Running 0 3m1s
result-deployment-6f46497b48-mjzhd 1/1 Running 0 3m
vote-deployment-74b6568b4d-bs6rs 1/1 Running 0 3m
worker-78645fb679-h9ns8 0/1 CrashLoopBackOff 4 (85s ago) 3m

controlplane ➜

Tried all above steps but worker pod is not coming up. Seems like worker pod’s image is broken?

Hi @amj1641,
Please check the logs of the postgresql pod.

Thanks for your confirmation, @tsanghan :+1: :+1: