Skip to content

Add support for spec overrides when restoring AWX#1862

Merged
rooftopcellist merged 1 commit intoansible:develfrom
rooftopcellist:restore-overrides
May 17, 2024
Merged

Add support for spec overrides when restoring AWX#1862
rooftopcellist merged 1 commit intoansible:develfrom
rooftopcellist:restore-overrides

Conversation

@rooftopcellist
Copy link
Copy Markdown
Member

SUMMARY

There are often times where you might want to override specific parameters on the AWX spec when restoring from a backup. One such case is when you want to extend the database PVC size.

To extend the storage size of your postgres PVC, with this change, you can now:

  1. Create an AWXBackup
  2. Create an AWXRestore with a spec_overrides entry for spec_overrides.postgres_storage_requirements.requests: 110Gi on your AWXRestore object
  3. The new deployment will have any spec_overrides preferentially included on the new AWX CR spec.
ISSUE TYPE
  • New or Enhanced Feature

@rooftopcellist
Copy link
Copy Markdown
Member Author

rooftopcellist commented May 17, 2024

Testing

First, I applied the following AWX CR

---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
  namespace: awx
spec:
  service_type: clusterip
  ingress_type: route
  no_log: false
  admin_password_secret: custom-admin-password
  postgres_storage_requirements:
    requests:
      storage: 10Gi
  extra_settings:
    - setting: MAX_PAGE_SIZE
      value: "500"

Then I created an AWXBackup:

---
apiVersion: awx.ansible.com/v1beta1
kind: AWXBackup
metadata:
  name: awxbackup-2022-11-3
  # namespace: awx
spec:
  deployment_name: awx
  no_log: false

Then I created an AWXRestore with a variety of spec_overrides:

---
apiVersion: awx.ansible.com/v1beta1
kind: AWXRestore
metadata:
  name: restore1
  namespace: awx
spec:
  backup_name: backup1
  backup_source: "Backup CR"
  deployment_name: new-awx
  no_log: false

  # New Overrides parameter in action
  spec_overrides:
    service_type: clusterip
    ingress_type: route
    no_log: false
    postgres_storage_requirements:
      requests:
        storage: 11Gi
    extra_settings:
      - setting: MAX_PAGE_SIZE
        value: "511"
      - setting: LOG_AGGREGATOR_LEVEL
        value: "'DEBUG'"
    node_selector: |
      kubernetes.io/os: linux

The resulting new-awx CR had everything present on it's spec and deployed successfully!

apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  annotations:
  creationTimestamp: "2024-05-17T18:39:58Z"
  generation: 1
  labels:
    app.kubernetes.io/component: awx
    app.kubernetes.io/managed-by: awx-operator
    app.kubernetes.io/operator-version: ""
    app.kubernetes.io/part-of: new-awx
  name: new-awx
  namespace: awx
  resourceVersion: "29239021"
  uid: 83d06486-c6b1-4847-82c0-25d8f394ebbe
spec:
  admin_password_secret: custom-admin-password
  admin_user: admin
  broadcast_websocket_secret: awx-broadcast-websocket
  create_preload_data: true
  extra_settings:
  - setting: MAX_PAGE_SIZE
    value: "511"
  - setting: LOG_AGGREGATOR_LEVEL
    value: '''DEBUG'''
  image_pull_policy: IfNotPresent
  ingress_type: route
  no_log: false
  node_selector: |
    kubernetes.io/os: linux
  postgres_configuration_secret: new-awx-postgres-configuration
  postgres_storage_requirements:
    requests:
      storage: 11Gi
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants