mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 01:28:09 -03:30
Merge pull request #3219 from mickfeech/devel
update documentation to include kuberentes initContainers Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -77,6 +77,48 @@ index d69e2c9..a08bae5 100644
|
|||||||
+ VENV_BASE=/var/lib/awx/venv make requirements_custom && \
|
+ VENV_BASE=/var/lib/awx/venv make requirements_custom && \
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Kubernetes Custom Virtualenvs
|
||||||
|
=============================
|
||||||
|
|
||||||
|
You can create custom virtualenvs without updating the awx images by using initContainers and a shared emptydir within Kubernetes. To start create an emptydir volume in the volumes stanza.
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- emptyDir: {}
|
||||||
|
name: custom-venv
|
||||||
|
|
||||||
|
Now create an initContainer stanza. You can subsititute your own custom images for this example we are using centos:7 as the base to build upon. The command stanza is where you will add the python modules you require in your virtualenv.
|
||||||
|
|
||||||
|
initContainers:
|
||||||
|
- image: 'centos:7'
|
||||||
|
name: init-my-custom-venv
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- '-c'
|
||||||
|
- >-
|
||||||
|
yum install -y ansible python-pip curl python-setuptools epel-release openssl openssl-devel gcc python-devel &&
|
||||||
|
curl 'https://bootstrap.pypa.io/get-pip.py' | python &&
|
||||||
|
pip install virtualenv &&
|
||||||
|
virtualenv /var/lib/awx/venv/my-custom-venv &&
|
||||||
|
source /var/lib/awx/venv/my-custom-venv/bin/activate &&
|
||||||
|
/var/lib/awx/venv/my-custom-venv/bin/pip install python-memcached psutil &&
|
||||||
|
/var/lib/awx/venv/my-custom-venv/bin/pip install -U "ansible == X.Y.Z" &&
|
||||||
|
/var/lib/awx/venv/my-custom-venv/bin/pip install -U custom-python-module
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /var/lib/awx/venv/my-custom-venv
|
||||||
|
name: custom-venv
|
||||||
|
|
||||||
|
Finally in the awx-celery and awx-web containers stanza add the shared volume as a mount.
|
||||||
|
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /var/lib/awx/venv/my-custom-venv
|
||||||
|
name: custom-venv
|
||||||
|
- mountPath: /etc/tower
|
||||||
|
name: awx-application-config
|
||||||
|
readOnly: true
|
||||||
|
- mountPath: /etc/tower/conf.d
|
||||||
|
name: awx-confd
|
||||||
|
readOnly: true
|
||||||
|
|
||||||
Assigning Custom Virtualenvs
|
Assigning Custom Virtualenvs
|
||||||
============================
|
============================
|
||||||
Once you've created a custom virtualenv, you can assign it at the Organization,
|
Once you've created a custom virtualenv, you can assign it at the Organization,
|
||||||
|
|||||||
Reference in New Issue
Block a user