简体   繁体   中英

dapr annotation errors : when dapr annotation is added to my deployments AKS

can anyone help explain why i get this error and possible solution when deploying to aks cluster adding dapr annotations. the error below

error: a container name must be specified for pod nginx-5bcb65d68d-r49zm, choose one of: [nginx daprd]

The puzzle here is i actually get the injection working but my containers keeps failing. below also is the error block from "kubectl pods describe:

> NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                               AGE
nginx-service-dapr   ClusterIP   None         <none>        80/TCP,50001/TCP,50002/TCP,9090/TCP   51m

below also is the error block from "kubectl pods describe:

> Events:
  Type     Reason     Age                    From               Message
  ----     ------     ----                   ----               -------
  Normal   Scheduled  47m                    default-scheduler  Successfully assigned default/nginx-5bcb65d68d-r49zm to aks-system-31874662-vmss000000
  Normal   Pulling    47m                    kubelet            Pulling image "nginx"
  Normal   Pulled     47m                    kubelet            Successfully pulled image "nginx" in 4.633962322s
  Normal   Created    47m                    kubelet            Created container nginx
  Normal   Started    47m                    kubelet            Started container nginx
  Normal   Pulled     47m (x2 over 47m)      kubelet            Container image "docker.io/daprio/daprd:1.8.4" already present on machine
  Normal   Created    47m (x2 over 47m)      kubelet            Created container daprd
  Normal   Started    47m (x2 over 47m)      kubelet            Started container daprd
  Normal   Killing    47m                    kubelet            Container daprd failed liveness probe, will be restarted
  Warning  Unhealthy  47m (x6 over 47m)      kubelet            Liveness probe failed: HTTP probe failed with statuscode: 500
  Warning  Unhealthy  12m (x72 over 47m)     kubelet            Readiness probe failed: HTTP probe failed with statuscode: 500
  Warning  BackOff    2m53s (x193 over 46m)  kubelet            Back-off restarting failed container

guys, i am fagged out don't know what else to do.

error: a container name must be specified for pod nginx-5bcb65d68d-r49zm, choose one of: [nginx daprd]

The above error usually occurs due to that pod name has multiple containers.

I have seen two container name

  • Container 1=nginx
  • Container 2=daprd

You can see the log of the podname by below command:

kubectl logs <podname>

You can see the log of the specific container by below commands.

kubectl logs <podname> -c ngnix

Otherwise you can check all container in the log you can use:

kubectl logs <podname> --all-containers

You must include the name of the specific container if a pod contains more than one. By running the above commands you can able to troubleshoot the error.

Reference: Kubernetes Error Codes: Container Name Must Be Specified | Datree.io

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM