From f68dc77ea315ff69449dcabc5c2761aa20c6911b Mon Sep 17 00:00:00 2001 From: Gabe Muniz Date: Thu, 15 Apr 2021 17:33:31 -0400 Subject: [PATCH 1/3] added documentation around environment variables --- README.md | 23 +++++++++++++++++++ .../awx-operator.clusterserviceversion.yaml | 2 ++ .../manifests/awx.ansible.com_awxs_crd.yaml | 2 ++ 3 files changed, 27 insertions(+) diff --git a/README.md b/README.md index f9fd0624..b7b430e9 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ An [Ansible AWX](https://github.com/ansible/awx) operator for Kubernetes built w * [LDAP Certificate Authority](#ldap-certificate-authority) * [Persisting Projects Directory](#persisting-projects-directory) * [Custom Volume and Volume Mount Options](#custom-volume-and-volume-mount-options) + * [Exporting Environment Variables to Containers](#exporting-environment-variables-to-containers) * [Development](#development) * [Testing](#testing) * [Testing in Docker](#testing-in-docker) @@ -477,6 +478,28 @@ Example spec file for volumes and volume mounts > :warning: **Volume and VolumeMount names cannot contain underscores(_)** +#### Exporting Environment Variables to Containers + +If you need to export custom environment variables to your containers. + +| Name | Description | Default | +| ----------------------------- | -------------------------------------------------------- | ------- | +| tower_task_extra_env | Environment variables to be added to Task container | '' | +| tower_web_extra_env | Environment variables to be added to Web container | '' | + +Example configuration of environment variables + +```yaml + spec: + tower_task_extra_env: | + - name: MYCUSTOMVAR + value: foo + tower_web_extra_env: | + - name: MYCUSTOMVAR + value: foo +``` + + ## Development ### Testing diff --git a/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml b/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml index 0fea86e0..960d8987 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml @@ -295,6 +295,7 @@ spec: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:hidden - displayName: Tower Task Extra Env + description: Environment variables to be added to Task container path: tower_task_extra_env x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced @@ -322,6 +323,7 @@ spec: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:hidden - displayName: Tower Web Extra Env + description: Environment variables to be added to Web container path: tower_web_extra_env x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced diff --git a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml index 1d684484..e628463e 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml @@ -225,6 +225,7 @@ spec: type: string type: array tower_task_extra_env: + description: Environment variables to be added to Task container type: string tower_ee_extra_volume_mounts: description: Specify volume mounts to be added to Execution container @@ -270,6 +271,7 @@ spec: type: string type: array tower_web_extra_env: + description: Environment variables to be added to Web container type: string tower_web_extra_volume_mounts: description: Specify volume mounts to be added to web container From ea018be298cc51c2e0fec0fcdf39a78b88b640f3 Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Wed, 21 Apr 2021 15:01:21 +0200 Subject: [PATCH 2/3] migration: Clarify you can migrate in-place Closes #213 --- docs/migration.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/migration.md b/docs/migration.md index 02a9e832..f2b258d8 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -43,6 +43,12 @@ type: Opaque > For `host`, a URL resolvable by the cluster could look something like `postgresql..svc.cluster.local`, where `` is filled in with the namespace of the AWX deployment you are migrating data from. +If your AWX deployment is already using an external database server or its database is otherwise not managed +by the AWX deployment, you can instead create the same secret as above but omit the `-old-` from the `name`. +In the next section pass it in through `tower_postgres_configuration_secret` instead, omitting the `_old_` +from the key and ensuring the value matches the name of the secret. This will make AWX pick up on the existing +database and apply any pending migrations. It is strongly recommended to backup your database beforehand. + ## Deploy AWX When you apply your AWX object, you must specify the name to the database secret you created above: From 51ea411a79d98dcbe651b57c826f0a93f618e7b9 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Wed, 21 Apr 2021 13:19:43 -0400 Subject: [PATCH 3/3] Stop telling folks to use devel --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b7b430e9..5f2d675f 100644 --- a/README.md +++ b/README.md @@ -51,10 +51,12 @@ Note that the operator is not supported by Red Hat, and is in **alpha** status. This Kubernetes Operator is meant to be deployed in your Kubernetes cluster(s) and can manage one or more AWX instances in any namespace. -First you need to deploy AWX Operator into your cluster: +First, you need to deploy AWX Operator into your cluster. Start by going to https://github.com/ansible/awx-operator/releases and making note of the latest release. + +Replace `` in the URL below with the version you are deploying: ```bash -#> kubectl apply -f https://raw.githubusercontent.com/ansible/awx-operator/devel/deploy/awx-operator.yaml +#> kubectl apply -f https://raw.githubusercontent.com/ansible/awx-operator//deploy/awx-operator.yaml ``` Then create a file named `my-awx.yml` with the following contents: