skypilot-users
How to configure proxy settings for running SkyPilot on a Kubernetes cluster without internet connectivity?
I am trying to run SkyPilot on a Kubernetes cluster without internet connectivity (only with proxy). I tried to configure proxy settings with the --env
flag with the sky launch
command and I also tried to add env values in the pod_config
in the config.yaml
without success. I see these errors:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f07fafb3040>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/python-dotenv/
Anyone could give me some hints how to solve this?
Ol
Oliver Joggerst
Asked on Feb 06, 2024
To configure proxy settings for running SkyPilot on a Kubernetes cluster without internet connectivity, you can follow these steps:
- Add the proxy environment variables to the pod's
env
section in the Kubernetes pod YAML file. Here's an example:
apiVersion: v1
kind: Pod
metadata:
name: example-pod
spec:
containers:
- name: example
image: nginx
ports:
- name: http
containerPort: 80
protocol: TCP
env:
- name: HTTPS_PROXY
value: <http://proxy-host:3128>
- name: HTTP_PROXY
value: <http://proxy-host:3128>
- name: NO_PROXY
value: "127.0.0.1,localhost"
- name: http_proxy
value: <http://proxy-host:3128>
- name: https_proxy
value: <http://proxy-host:3128>
- name: no_proxy
value: "127.0.0.1,localhost"
- Make sure the
containers
key is added underspec
in the SkyPilot config file (~/.sky/config.yaml
). Here's an example:
kubernetes:
pod_config:
spec:
containers:
- env:
- name: HTTPS_PROXY
value: <http://proxy-host:3128>
- name: HTTP_PROXY
value: <http://proxy-host:3128>
- name: NO_PROXY
value: "127.0.0.1,localhost"
- name: https_proxy
value: <http://proxy-host:3128>
- name: http_proxy
value: <http://proxy-host:3128>
- name: no_proxy
value: "127.0.0.1,localhost"
- Ensure that the proxy settings are correctly specified in both the pod YAML file and the SkyPilot config file.
By following these steps, you should be able to configure the proxy settings for running SkyPilot on a Kubernetes cluster without internet connectivity.
Feb 08, 2024Edited by