Hello Elijah Abdulrahman,
Thanks for your question.
This can be for different reasons.
Could be a DNS issue. I will suggest you check core-dns or kube-dns.
See troubleshooting steps here:
https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/connectivity/troubleshoot-connection-pods-services-same-cluster
You can mark it 'Accept Answer' and 'Upvote' if this helped you
Regards,
Abiola