Gurpreet Singh:
Hi, I started with kubernetes challenges (3rd one) and in one of the scenario the requirement is to run the deployment (https://github.com/kodekloudhub/kubernetes-challenges/blob/master/challenge-3/worker.yml) with image: kodekloud/examplevotingapp_worker but the container never runs successfully. I tried to debug but did not find definite issue so I tried to run normal docker container with the same image but container also failed to run with some exception (when I checked the docker container logs). Is there any issue with the image (code logic) ?
Alistair Mackay:
Hi @Gurpreet Singh
The lab is fine. I went through it only yesterday
The order in which you create the resources is key to this one as they depend on each other as indicated by the arrows. The worker pod requires both the database and the redis to be running, without which it will crash. Also ensure you have created all resources in the new namespace vote
The correct order to solve this challenge to that point is
- namespace
- db-deployment
- db-service
- redis-deployment
- redis-service
- worker
Remember after each deployment to allow its pods to start fully before progressing.
Gurpreet Singh:
@Alistair Mackay thanks for replying, i will try again with correct order. Can we expect same thing (to check arrows part) in the CKAD exam?
Alistair Mackay:
The exam is not like the challenges. You wonβt have to solve an entire infrastructure like in the challenges.
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, Func
2 endFunction, Action1 endAction, Task
1 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.TaskFactory
1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action
1 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?