<p>I want to install additional python libraries in a running container via <strong>pip</strong>. The reason why I use this way instead of building a container which have already be installed this library, is that my docker image needs to be small.</p>

<p>I have tried to open ports 8080, 3128 and 443. The yaml entries are as follows:</p>

<pre><code>ports: 
- containerPort: 8080 
  name: http 
  protocol: TCP
- containerPort: 3128
  name: http 
  protocol: TCP
- containerPort: 443
  name: http 
  protocol: TCP
</code></pre>

<p>However, pip is not able to connect with the pypi server.</p>

<p>What port do I have to add? Or did I miss anything else? </p>

<p><code>containerPort</code> is the port on which the container will listen for incoming traffic. For downloading library from pypy server the traffic flow is outgoing from the pod.If you don't have any network policy blocking egress traffic then there is no need to whitelist any IP for traffic to go out to internet from the pod. But the pod and node need to be able to reach internet without getting the traffic blocked by any firewall.</p>
