509: certificate is valid for ingress.local, not quay.io

I am using microk8s version 1.17/stable on ubuntu 18.04. Whenever I enable microk8s ingress addon and deploy pods, they go into imagepullbackoff state. On describing the pods it gives errors like “509: certificate is valid for ingress.local, not quay.io”.
But if i disable the ingress addon, it works fine.
Can someone help me this?

Is it possible to upload the inpect tarball?