<p>I'm on a <code>minikube</code> single node environment (with default settings):</p>
<pre><code>|----------|-----------|---------|--------------|------|---------|---------|-------|
| Profile  | VM Driver | Runtime |      IP      | Port | Version | Status  | Nodes |
|----------|-----------|---------|--------------|------|---------|---------|-------|
| minikube | docker    | docker  | 192.168.49.2 | 8443 | v1.22.3 | Running |     1 |
|----------|-----------|---------|--------------|------|---------|---------|-------|
</code></pre>
<p>I need to clone some external repositories (hosted publicly on <a href="https://bitbucket.org" rel="nofollow noreferrer">https://bitbucket.org</a>) from inside a Pod. From what I've seen there must be some issues with the network policies.</p>
<p>For instance, this is the output from inside a generic pod inside the <code>default</code> namespace:</p>
<pre><code>root@netbox-85cdcc9587-hlxjb:/# git clone https://bitbucket.org/&lt;project_name&gt;/&lt;repo_name&gt;/
Cloning into '&lt;repo_name&gt;'...
fatal: unable to access 'https://bitbucket.org/&lt;project_name&gt;/&lt;repo_name&gt;/': Failed to connect to bitbucket.org port 443: Connection refused
</code></pre>
<p>I've already read about it at the following resources but I couldn't find anything useful:</p>
<ul>
<li><a href="https://minikube.sigs.k8s.io/docs/handbook/network_policy/" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/handbook/network_policy/</a></li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/network-policies/</a></li>
</ul>
<p>What I've already tried:</p>
<ol>
<li>Restarting the minikube cluster with Calico CNI (<code>minikube start --cni calico</code>)</li>
<li>Creating a network policy that allows all egress just for testing</li>
</ol>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-all-egress
spec:          
  podSelector: {}
  egress:           
  - {}
  policyTypes:
  - Egress
</code></pre>
<p>Am I missing some trivial steps or is there some issues in the cluster I can investigate more to verify?</p>

browser-bug
<p>I solved this by using a custom nameserver as @HarshManvar suggested but since I'm on minikube I needed to find a way to deploy it on cluster level.
Looking at the docs (<a href="https://minikube.sigs.k8s.io/docs/handbook/filesync/" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/handbook/filesync/</a>) I found this that interestingly has in the example section exactly what I was looking for.</p>
<p>So basically just do the following:</p>
<pre><code>mkdir -p ~/.minikube/files/etc
echo nameserver 8.8.8.8 &gt; ~/.minikube/files/etc/resolv.conf
minikube stop
minikube start
</code></pre>
<p>And the nameserver should be correctly deployed. I verified that the connection outside the cluster local network worked as expected, without the need of chaning CNI or using egress network policies.</p>
