Commit Graph
628 Commits
Author SHA1 Message Date
Djebran Lezzoum ae86cb3d13 Skip django_auth_ldap import if missing (#1955) 2024-10-02 09:36:00 -04:00
mihirlele 70ec7a5304 Add ability to exclude postgres data during migration to Openshift AAP operator (#1954) 2024-09-20 03:23:39 +00:00
aknochow 532be386fc fix postgres user permissions for upgrades (#1959) 2024-09-18 13:24:18 -04:00
Elijah DeLee f50c029408 add graceful harakiri
now there is way for uwsgi to send signal for graceful harakiri to try and handle it nice way before sending signal 9

pairs with https://github.com/ansible/awx/pull/15447/files
2024-09-04 15:40:59 -04:00
Imed 8224b0b354 Adding postgres annotations support (#1829)
* Adding postgres annotations support

Authored-by: Imed Aouidene <[email protected]>
2024-07-24 18:45:06 +00:00
Guillaume LefevreandGuillaume Lefevre d42737993f Change ansible k8s_info tasks api_version for Job kind to batch/v1 (#1833)
Co-authored-by: Guillaume Lefevre <[email protected]>
2024-07-24 18:38:04 +00:00
Dimitri Savineau 36cf9c23ea web: Add volume to handle debug logs (#1921)
When enabling debug web requests, the /var/log/tower directory needs
to exist.
Rather than just creating that directory in the container image then
create an emptyDir volume.

Closes: #1485

Signed-off-by: Dimitri Savineau <[email protected]>
2024-07-16 11:58:27 -04:00
Christian Adams 041270ffbe Use task_resource_requirements for migration k8s job (#1912) 2024-07-10 15:51:47 -04:00
Chi Cuong HAandChristian Adams cdab3dd538 fix: Make basic install without operator works (#1875)
- Update role name for README.md
  - Avoid the this_awx['resources'][0] is undefined in database_configuration.yml
  - Add update_status variable to include or not the update_status.yml
  - metrics_utility_enabled exists in CRD but not as variable

Co-authored-by: Christian Adams <[email protected]>
2024-07-03 19:12:47 +00:00
aknochow 9fc3738b53 Split metrics utility cronjobs for crc and local report (#1906)
* fixing metrics-utility variables and conditionals

* separating metrics-utility for console into separate tasks and conditionals
2024-06-26 10:52:58 -04:00
Stéphane BilquéandStéphane BILQUÉ e271515385 Ability to add custom labels to the DB migration pods (#1878)
add the labels from the 'additional_labels' parameter in the awx-migration pods

Co-authored-by: Stéphane BILQUÉ <[email protected]>
2024-06-12 14:42:28 -04:00
David Hageman 13abaab1b3 Add scheduling controls to Mesh Ingress (#1892) 2024-06-12 11:33:03 -04:00
Ricardo Carrillo Cruz 01bde2cebb Cast manage_replicas to bool (#1893) 2024-06-06 14:43:20 +02:00
Joel c696eda50a Fix custom CA certificates for task/web/migration (#1846)
* Fix bundle_ca_crt for task/web/migration

- added a new init container init-bundle-ca-trust
- added volume ca-trust-extracted to the migration job
- added volume ca-trust-extracted to the init container init-database
- removed volume bundle-ca from all follow-up containers
2024-06-05 22:56:52 -04:00
Hao Liu a260ab6873 Fix migrating from devel version to devel version (#1890)
upgrading from devel version to devel version currently don't run migration because we chopped off the git sha
2024-06-05 14:10:51 -04:00
David Hageman 8ead140541 Add support for horizontal pod autoscaling (#1676)
CI / molecule (--skip-tags=replicas) (push) Failing after 1m59s
CI / molecule (-t replicas) (push) Failing after 2m27s
CI / helm (push) Failing after 6m16s
CI / no-log (push) Successful in 25s
CI / nox-sessions (push) Failing after 3m28s
2024-06-03 15:59:48 -04:00
Hao Liu 6820981dd5 Use check_instance_ready for task pod readiness (#1885) 2024-05-31 09:33:29 -04:00
kurokobo 56df3279a6 feat: implement extra_settings_files (#1836)
* feat: implement extra_settings_files
* fix: reduce duplicated code blocks by templates
* docs: update docs for extra settings
* docs: simplify the commands
* docs: add notes for duplicated keys in setting files
2024-05-23 13:40:51 -04:00
aknochow 64fb262830 fixing metrics-utility variables and conditionals (#1872) 2024-05-22 15:29:26 -04:00
aknochow cecf812382 moving metrics_utility defaults to vars/main.yaml and setting default… (#1869)
moving metrics_utility defaults to vars/main.yaml and setting default secret undefined to fix conditional
2024-05-21 18:16:14 -04:00
Christian Adams a8da7f9398 Add support for spec overrides when restoring AWX (#1862) 2024-05-17 15:47:26 -04:00
fluzzykitten 4720d29fda Update k8s_exec and k8s_cp to include container name (#1858)
Update secrets.yml

We need to specify a container in environments that use sidecar injection, like in the case of istio service mesh. If the container is not specified, and a side car is injected so there are multiple containers running in the pod, this task will fail because a container was not specified in a pod with multiple containers.
2024-05-16 16:32:38 -04:00
Christian Adams 64e4279d96 Fix innocuous but confusing typo in db management pod task (#1859) 2024-05-16 15:17:39 -04:00
David Hageman cf61205f49 Create _metrics_utility_secret for metrics utility (#1857) 2024-05-16 13:29:04 -04:00
larsux e98c913f86 Add postgresql option target_session_attrs (#1847)
Signed-off-by: Lars Wildemann <[email protected]>
2024-05-15 18:47:33 +00:00
jamesmarshall24 b49d68ca92 Expose websockets on api prefix v2 (#1842)
Expose websockets on controller v2
2024-05-01 15:47:23 -04:00
Ranvit Bommineni 4fc20de72e add tolerations/nodeselector to migration job template (fixes #1774) (#1804)
Enable fallback to global settings for db-migration job scheduling (#1804)

Modified the db-migration job template to use `task_*` settings with a fallback to global AWX configurations if not specified.
2024-05-01 15:10:29 -04:00
Tom Siewert 6fff7cb485 installer: nginx: add missing locales location required by ui_next (#1822)
The new UI depends on the locales available via ingress/locales which
is being served as static file and not via Django.

A change in the nginx.conf was already done for the dev environment
in commit ec4f10d86881389af12371f90cb75af03417d109 (AWX), but not
here.

Signed-off-by: Tom Siewert <[email protected]>
2024-05-01 15:05:43 -04:00
David Hageman 6baf3a174d Add database secret to metric jobs (#1843) 2024-04-30 16:12:31 -04:00
Dimitri Savineau ed72dc12b2 Add explicit list filter after rejectattr (#1845)
CI / molecule (--skip-tags=replicas) (push) Failing after 2m21s
CI / molecule (-t replicas) (push) Failing after 2m25s
CI / helm (push) Failing after 4m57s
CI / no-log (push) Successful in 12s
CI / nox-sessions (push) Failing after 1m26s
With ansible 2.9.27 (operator-sdk v1.27.0) then the rejectattr filter
returns a generator so we need to cast it to list.
The behavior doesn't exist when using a more recent operator-sdk
version like v1.34.0 (ansible-core 2.15.8) but using the list
filter on that version works too (even if not needed)

"<generator object select_or_reject at 0x7fbbf0443728>"

This is a similar issue as 80a9e8c.

TASK [Get the new resource pod information after updating resource.]
********************************
FAILED! => {"msg": "The conditional check '_new_pod['resources'] | rejectattr('metadata.deletionTimestamp', 'defined') | length' failed.
The error was: Unexpected templating type error occurred on ({% if _new_pod['resources'] | rejectattr('metadata.deletionTimestamp', 'defined') | length %} True {% else %} False {% endif %}): object of type 'generator' has no len()

This also removes the unneeded quotes on the when conditions.

Signed-off-by: Dimitri Savineau <[email protected]>
2024-04-29 23:35:37 -04:00
Dimitri Savineau 3fa60853a2 backup: Remove default parameter from jinja map (#1839)
CI / molecule (--skip-tags=replicas) (push) Failing after 4m29s
CI / molecule (-t replicas) (push) Failing after 3m16s
CI / helm (push) Failing after 23s
CI / no-log (push) Successful in 12s
CI / nox-sessions (push) Failing after 1m41s
The default paramater from the jinja map filter has been added in the
2.11.0 release.
However, the downstream ansible operator is still using ansible 2.9
with jinja 2.10.x so using the default parameter leads to the
following error:

TASK [Dump ingress tls secret names from awx spec and data into file]
********************************
The error was: jinja2.exceptions.FilterArgumentError: Unexpected
keyword argument 'default'
fatal: [localhost]: FAILED! => {
  "msg": "Unexpected failure during module execution.",
  "stdout": ""
}

Rather than using the default parameter with the map filter then add the
selectattr filter to get only the items with tls_secret defined and then
get the tls_secret attribute with the map filter.

This also gets rid of the when statement since we always get an empty
list when no tls_secret are present in ingress_hosts so the loop statement
will be skipped on the empty list.

Finally this changes the default value from the ingress_hosts field because
it's a list rather than a string.

https://jinja.palletsprojects.com/en/latest/templates/#jinja-filters.map

Signed-off-by: Dimitri Savineau <[email protected]>
2024-04-23 10:36:42 -04:00
aknochow e6e1025206 adding new variables for redhat hybrid cloud console to metrics-utility (#1816)
adding new variables for redhat hybrid cloud console shipping
simplifying configmap and secret setup
making pvc creation conditional on ship_target type being directory
2024-04-11 19:30:39 -04:00
Christian Adams 7b02b5df04 Set default for -iness probe parameters and add docs (#1808) 2024-04-03 14:26:41 -04:00
a5211fe511 Add postgres init container to resolve permissions for some k3s deployments (#1805)
Add postgres init container if
postgres_data_volume_init is true

This is aimed to solve the issue where users may
need to chmod or chown the postgres
data volume for user 26, which is the user
that is running postgres in the sclorg image.

For example, one can now set the follow on the AWX spec:
spec:
  postgres_init_container_commands: |
    chown 26:0 /var/lib/pgsql/data
    chmod 700 /var/lib/pgsql/data

Deprecate postgres_init_container_resource_requirements param in favor
of postgres_resource_requirements param.

Signed-off-by: Seth Foster <[email protected]>
Co-authored-by: craph <[email protected]>
Co-authored-by: kurokobo <[email protected]>
Co-authored-by: Christian M. Adams <[email protected]>
2024-04-03 13:19:57 -04:00
Hao Liu fcbf394272 Fix "external_hostname" should not be required while using Route ingress (#1807)
Fix "external_hostname" required on OCP
2024-04-03 16:16:16 +00:00
Christian Adams 7bf49c207a Remove the ability to customize the postgres_data_dir (#1798)
* in the sclorg Postgresql 15 image, the PGDATA directory is hardcoded
* if users were to modify this directory, they would only change the
  directory the pvc is mounted to, not the directory PostgreSQL uses.
  This would result in loss of data.
* switch from /var/lib/pgsql/data/pgdata to /var/lib/pgsql/data/userdata
2024-03-31 21:58:33 -04:00
Dimitri Savineau 80a9e8c156 postgresql: Cast sorted_old_postgres_pods as list (#1791)
With ansible 2.9.27 (operator-sdk v1.27.0) then the reverse filter
returns an iterator so we need to cast it to list.
The behavior doesn't exist when using a more recent operator-sdk
version like v1.34.0 (ansible-core 2.15.8) but using the list
filter on that version works too (even if not needed)

"sorted_old_postgres_pods": "<list_reverseiterator object at 0x7f539eaa5610>"

Signed-off-by: Dimitri Savineau <[email protected]>
2024-03-27 14:31:53 -04:00
kurokobo 07b8120788 fix: add retries to find running web pod (#1787) 2024-03-27 14:25:10 -04:00
kurokobo a6e7a1bec3 fix: correct readinessProbe for web pod (#1786)
fix: correct readinesProbe for web pod
2024-03-27 14:21:23 -04:00
aknochow c6fe038fe4 Adding support for ansible metrics-utility (#1754)
- Adding metadata, storage_class, and pullsecret for metrics-utility
- Updating crd, csv and defaults
- Adding metrics-utility cronjob
2024-03-20 11:05:13 -04:00
Hao Liu 0dbf3ddff8 Add ServiceAccount and ImagePullSecet to migration job (#1763)
CI / molecule (--skip-tags=replicas) (push) Failing after 2m32s
CI / molecule (-t replicas) (push) Failing after 1m56s
CI / helm (push) Failing after 4m3s
CI / no-log (push) Successful in 12s
Add ServiceAccount and ImagePullSecet to migration pod
2024-03-13 20:56:56 +00:00
Seth FosterandHao Liu 154b801cfc Change default value for postgres_data_path (#1766)
* Change default value for postgres_data_path

/var/lib/postgresql/data/pgdata
to
/var/lib/pgsql/data/pgdata

postgres 15 uses a different location for
postgres data directory.

Fixes issue were database was not being written
to the mounted in volume, and if the postgres
container restarted, data would be lost.

Signed-off-by: Seth Foster <[email protected]>
---------

Signed-off-by: Seth Foster <[email protected]>
Co-authored-by: Hao Liu <[email protected]>
2024-03-13 16:17:49 -04:00
Hao Liu a8acae4af5 Don't delete old postgres 13 volume automatically (#1767)
Leave old postgres-13 volume alone in case of unforseen upgrade failure for restore purposes

User can manually delete old PVC after verifying upgrade is completed
2024-03-13 15:23:10 -04:00
Hao Liu 6e31feaa20 Add command when specifying args for postgres (#1765)
When using args the container defaults to the entrypoint instead of command

causing postgres to be in a crashloop
2024-03-13 15:16:05 -04:00
Christian Adams ed6ac1a11a Create a new postgres configuration secret when restoring a new instance (#1733)
- This will avoid the operator changing the host value of the original
  deployments postgres_configuration_secret. As it was, restores broke
  the original deployment if it was still around before this change.

Signed-off-by: Christian M. Adams <[email protected]>
2024-03-11 16:34:43 -04:00
Hao LiuandSeth Foster b5d81b8e5d Fix awx_kube_devel (#1759)
* Fix awx_kube_devel
* Sanitize version name for kube_dev

When in development mode, awx version may look
like 23.9.1.dev18+gee9eac15dc.d20240311

k8s job to the migration can only have
a name with alphanumeric, and '.', '-'

so we can just drop off the +

Signed-off-by: Seth Foster <[email protected]>

---------

Signed-off-by: Seth Foster <[email protected]>
Co-authored-by: Seth Foster <[email protected]>
2024-03-11 19:01:00 +00:00
bartowlandHao Liu 3abeec518a Bind EE images version with DEFAULT_AWX_VERSION (#1740)
* bind ee_images, control_plane_ee_image and init_container_image with DEFAULT_AWX_VERSION instead of "latest"

* fix when condition on init_container_image_version check

* Use DEFAULT_AWX_VERSION for AWXMeshIngress

* Add back AWX EE latest for backward compatibility

---------

Co-authored-by: Hao Liu <[email protected]>
2024-03-11 14:12:10 -04:00
Christian Adams d2c4b9c8a4 The pg service label_selector now uses the deployment_type variable (#1755) 2024-03-08 09:02:31 -05:00
Christian Adams 2ad1d25120 Update PostgreSQL docs about finding default version (#1747) 2024-03-07 21:47:18 -05:00
Hao Liu 26e72b4e1d Fix undefined external_hostname when using Route (#1753) 2024-03-07 22:53:48 +00:00