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:
softwarefactory-project-zuul[bot] 2019-03-21 14:36:17 +00:00 committed by GitHub
commit cd62f39bce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,48 @@ index d69e2c9..a08bae5 100644
+ 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
============================
Once you've created a custom virtualenv, you can assign it at the Organization,