rewrite tips for adding proxy

This commit is contained in:
Jens Heinitz 2022-05-30 14:49:02 +02:00
parent 2c2325b5c6
commit 6edb8a4e17

View file

@ -1,43 +1,18 @@
# Add Proxy Settings for AWX containers # Add Proxy Settings for AWX containers
If you are deploying AWX in a corporate environment, you may have no direct access to the internet, but need to go through a proxy. to achieve this, you can add extra environment variables to the awx-web, awx-task and awx-ee containers. If you are deploying AWX in a corporate environment, you may have no direct access to the internet, but need to go through a proxy way to achieve this is to add a section `extra_settings:` to awx.yaml. These settings will be available in the `Settings` -> `Jobs Settings` -> `Extra Environment Variables` block in the AWX UI.
You also need to specify the `no_proxy` variable to avoid that internal calls to the K3S cluster are routed to the proxy.
## Obtain the ClusterUP
Therefore you need to obtain the `ClusterIP` by running `kubectl get all` in the default namespace:
```
[awx@ansible03 base]$ kubectl get all
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 26h
[awx@ansible03 base]$
```
In my case the IP to use is `10.43.0.1`.
## Add Proxy Settings to base/awx.yaml ## Add Proxy Settings to base/awx.yaml
Now you need to specify your proxy settings in the stanza `task_extra_env`, `web_extra_env` and `ee_extra_env` in `base/awx.yaml` like this: You need to specify your proxy settings in the section `extra_settings:` in `base/awx.yaml` like this:
``` ```
task_extra_env: | extra_settings: |
- name: HTTP_PROXY - setting: AWX_TASK_ENV['HTTP_PROXY']
value: http://proxy.example.com:3128 value: "'http://proxy.example.com:3128'"
- name: HTTPS_PROXY - setting: AWX_TASK_ENV['HTTPS_PROXY']
value: http://proxy.example.com:3128 value: "'http://proxy.example.com:3128'"
- name: NO_PROXY - setting: AWX_TASK_ENV['NO_PROXY']
value: 10.43.0.1,ansible03,localhost,.example.com,127.0.0.1 value: "'10.43.0.1,ansible03,localhost,.example.com,127.0.0.1'"
web_extra_env: |
- name: HTTP_PROXY
value: http://proxy.example.com:3128
- name: HTTPS_PROXY
value: http://proxy.example.com:3128
- name: NO_PROXY
value: 10.43.0.1,ansible03,localhost,.example.com,127.0.0.1
ee_extra_env: |
- name: HTTP_PROXY
value: http://proxy.example.com:3128
- name: HTTPS_PROXY
value: http://proxy.example.com:3128
- name: NO_PROXY
value: 10.43.0.1,ansible03,localhost,.example.com,127.0.0.1
``` ```
You may have to adjust your settings to match your environment. You may have to adjust your settings to match your environment.
@ -50,3 +25,5 @@ kubectl apply -k base
Now you need to wait some time until K3S has restarted all your pods. Now you need to wait some time until K3S has restarted all your pods.
After logging in you can navigate to `Settings` -> `Jobs Settings` and find your proxy settings in the `Extra Environment Variables` block: