feat: bump awx operator version to 0.24.0

This commit is contained in:
kurokobo 2022-07-17 18:01:43 +09:00
parent 3883623ec0
commit d1939098eb
8 changed files with 34 additions and 24 deletions

View file

@ -27,17 +27,17 @@ An example implementation of AWX on single node K3s using AWX Operator, with eas
- Tested on: - Tested on:
- CentOS Stream 8 (Minimal) - CentOS Stream 8 (Minimal)
- K3s v1.23.6+k3s1 - K3s v1.23.8+k3s2
- Products that will be deployed: - Products that will be deployed:
- AWX Operator 0.23.0 - AWX Operator 0.24.0
- AWX 21.2.0 - AWX 21.3.0
- PostgreSQL 12 - PostgreSQL 12
## References ## References
- [K3s - Lightweight Kubernetes](https://rancher.com/docs/k3s/latest/en/) - [K3s - Lightweight Kubernetes](https://rancher.com/docs/k3s/latest/en/)
- [INSTALL.md on ansible/awx](https://github.com/ansible/awx/blob/21.2.0/INSTALL.md) @21.2.0 - [INSTALL.md on ansible/awx](https://github.com/ansible/awx/blob/21.3.0/INSTALL.md) @21.3.0
- [README.md on ansible/awx-operator](https://github.com/ansible/awx-operator/blob/0.23.0/README.md) @0.23.0 - [README.md on ansible/awx-operator](https://github.com/ansible/awx-operator/blob/0.24.0/README.md) @0.24.0
## Requirements ## Requirements
@ -83,7 +83,7 @@ Install specified version of AWX Operator. Note that this procedure is applicabl
cd ~ cd ~
git clone https://github.com/ansible/awx-operator.git git clone https://github.com/ansible/awx-operator.git
cd awx-operator cd awx-operator
git checkout 0.23.0 git checkout 0.24.0
``` ```
Export the name of the namespace where you want to deploy AWX Operator as the environment variable `NAMESPACE` and run `make deploy`. The default namespace is `awx`. Export the name of the namespace where you want to deploy AWX Operator as the environment variable `NAMESPACE` and run `make deploy`. The default namespace is `awx`.

View file

@ -42,7 +42,7 @@ This guide does not provide any information how to configure Azure, other DNS se
Deploy cert-manager first. Deploy cert-manager first.
```bash ```bash
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.8.0/cert-manager.yaml kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.8.2/cert-manager.yaml
``` ```
Ensure the pods in `cert-manager` namespace are running. Ensure the pods in `cert-manager` namespace are running.

View file

@ -26,13 +26,19 @@ An example simple playbook for Ansible is also provided in this repository. This
[This example playbook](project/backup.yml) is designed to allow you to customize your backup with variables. [This example playbook](project/backup.yml) is designed to allow you to customize your backup with variables.
<!-- markdownlint-disable MD033 -->
| Variables | Description | Default | | Variables | Description | Default |
| - | - | - | | - | - | - |
| `awxbackup_namespace` | The name of the NameSpace where the `AWXBackup` resource will be created. | `awx` | | `awxbackup_namespace` | The name of the NameSpace where the `AWXBackup` resource will be created. | `awx` |
| `awxbackup_name` | The name of the `AWXBackup` resource. Dynamically generated using execution time by default. | `awxbackup-{{ lookup('pipe', 'date +%Y-%m-%d-%H-%M-%S') }}` | | `awxbackup_name` | The name of the `AWXBackup` resource. Dynamically generated using execution time by default. | `awxbackup-{{ lookup('pipe', 'date +%Y-%m-%d-%H-%M-%S') }}` |
| `awxbackup_spec` | The `spec` of the `AWXBackup` resource. Refer [official documentation](https://github.com/ansible/awx-operator/tree/0.23.0/roles/backup) for acceptable fields. | `{'deployment_name':'awx','backup_pvc':'awx-backup-claim'}` | | `awxbackup_spec` | The `spec` of the `AWXBackup` resource. Refer [official documentation](https://github.com/ansible/awx-operator/tree/0.24.0/roles/backup) for acceptable fields. | `deployment_name: awx`<br>`backup_pvc: awx-backup-claim`<br>`clean_backup_on_delete: true` |
| `awxbackup_timeout` | Time to wait for backup to complete, in seconds. If exceeded, the playbook will fail. | `600` | | `awxbackup_timeout` | Time to wait for backup to complete, in seconds. If exceeded, the playbook will fail. | `600` |
| `awxbackup_keep_days` | Number of days to keep `AWXBackup` resources. `AWXBackup` resources older than this value will be deleted by this playbook. Set `0` to keep forever. **Note that the actual backup data will remain in the PVC after the `AWXBackup` resource is deleted.** | `30` | | `awxbackup_keep_days` | Number of days to keep `AWXBackup` resources. `AWXBackup` resources older than this value will be deleted by this playbook. Set `0` to keep forever. | `30` |
<!-- markdownlint-enable MD033 -->
Note that this playbook enables `clean_backup_on_delete` by default that only works with AWX Operator `0.24.0` and later. This option makes that your actual backup data in your PVC is deleted at the same time the AWXBackup resource is deleted. You can disable this feature by explicitly specifying `clean_backup_on_delete: false`. Refer [the official documentation](https://github.com/ansible/awx-operator/tree/devel/roles/backup) for detail.
## Preparation ## Preparation
@ -76,7 +82,7 @@ export K8S_AUTH_API_KEY="<Your API Token>"
```bash ```bash
# Modify variables using "-e" as needed # Modify variables using "-e" as needed
ansible-playbook project/backup.yml \ ansible-playbook project/backup.yml \
-e awxbackup_spec="{'deployment_name':'awx','backup_pvc':'awx-backup-claim'}" \ -e awxbackup_spec="{'deployment_name':'awx','backup_pvc':'awx-backup-claim','clean_backup_on_delete':'true'}" \
-e keep_days=90 -e keep_days=90
``` ```

View file

@ -1,6 +1,6 @@
--- ---
- name: Backing up AWX using AWX Operator - name: Backing up AWX using AWX Operator
gather_facts: no gather_facts: false
hosts: localhost hosts: localhost
tasks: tasks:
@ -16,6 +16,7 @@
spec: spec:
deployment_name: awx deployment_name: awx
backup_pvc: awx-backup-claim backup_pvc: awx-backup-claim
clean_backup_on_delete: true
timeout: 600 timeout: 600
keep_days: 30 keep_days: 30
@ -56,11 +57,11 @@
kubernetes.core.k8s: kubernetes.core.k8s:
state: present state: present
definition: "{{ _awxbackup_manifest }}" definition: "{{ _awxbackup_manifest }}"
wait: yes wait: true
wait_condition: wait_condition:
reason: "Successful" reason: Successful
status: "True" status: "True"
type: "Running" type: Running
wait_timeout: "{{ _awxbackup_config.timeout | int }}" wait_timeout: "{{ _awxbackup_config.timeout | int }}"
register: _awxbackup_created register: _awxbackup_created
@ -71,7 +72,7 @@
_awxbackup_created_info: _awxbackup_created_info:
name: "{{ _awxbackup_created.result.metadata.name }}" name: "{{ _awxbackup_created.result.metadata.name }}"
creation_timestamp: "{{ _awxbackup_created.result.metadata.creationTimestamp }}" creation_timestamp: "{{ _awxbackup_created.result.metadata.creationTimestamp }}"
deploument_name: "{{ _awxbackup_created.result.spec.deployment_name }}" deployment_name: "{{ _awxbackup_created.result.spec.deployment_name }}"
backup_pvc: "{{ _awxbackup_created.result.status.backupClaim }}" backup_pvc: "{{ _awxbackup_created.result.status.backupClaim }}"
backup_directory: "{{ _awxbackup_created.result.status.backupDirectory }}" backup_directory: "{{ _awxbackup_created.result.status.backupDirectory }}"
@ -80,12 +81,12 @@
kubernetes.core.k8s: kubernetes.core.k8s:
state: absent state: absent
definition: "{{ _awxbackup_manifest }}" definition: "{{ _awxbackup_manifest }}"
wait: yes wait: true
- name: Force to fail if the backup was failed - name: Force to fail if the backup was failed
ansible.builtin.fail: ansible.builtin.fail:
- name: Creanup outdated backups - name: Cleanup outdated backups
block: block:
- name: Store current datetime - name: Store current datetime
ansible.builtin.set_fact: ansible.builtin.set_fact:
@ -105,10 +106,12 @@
namespace: "{{ _awxbackup_config.namespace }}" namespace: "{{ _awxbackup_config.namespace }}"
name: "{{ item.name }}" name: "{{ item.name }}"
state: absent state: absent
wait_timeout: "{{ _awxbackup_config.timeout | int }}"
wait: true
loop: "{{ _awxbackup_all_backups.resources }}" loop: "{{ _awxbackup_all_backups.resources }}"
loop_control: loop_control:
label: "{{ item.name }}" label: "{{ item.name }}"
when: > when: >-
(_awxbackup_now | int) (_awxbackup_now | int)
- ((item.metadata.creationTimestamp | to_datetime('%Y-%m-%dT%H:%M:%S%z')).strftime('%s') | int) - ((item.metadata.creationTimestamp | to_datetime('%Y-%m-%dT%H:%M:%S%z')).strftime('%s') | int)
> ((_awxbackup_config.keep_days | int) * 86400) > ((_awxbackup_config.keep_days | int) * 86400)

View file

@ -5,10 +5,10 @@ metadata:
name: awx name: awx
spec: spec:
# These parameters are designed for use with: # These parameters are designed for use with:
# - AWX Operator: 0.23.0 # - AWX Operator: 0.24.0
# https://github.com/ansible/awx-operator/blob/0.23.0/README.md # https://github.com/ansible/awx-operator/blob/0.24.0/README.md
# - AWX: 21.2.0 # - AWX: 21.3.0
# https://github.com/ansible/awx/blob/21.2.0/INSTALL.md # https://github.com/ansible/awx/blob/21.3.0/INSTALL.md
admin_user: admin admin_user: admin
admin_password_secret: awx-admin-password admin_password_secret: awx-admin-password

View file

@ -28,7 +28,7 @@ secretGenerator:
literals: literals:
- password=Ansible123! - password=Ansible123!
# Temporary workaround to suppress errors from AWX Operator 0.23.0. # Temporary workaround to suppress errors from AWX Operator 0.21.0.
# Refer: https://github.com/kurokobo/awx-on-k3s/issues/74 # Refer: https://github.com/kurokobo/awx-on-k3s/issues/74
- name: redhat-operators-pull-secret - name: redhat-operators-pull-secret
files: files:

View file

@ -179,7 +179,7 @@ Typical solutions are one of the following:
ee_resource_requirements: {} 👈👈👈 ee_resource_requirements: {} 👈👈👈
``` ```
- You can specify more specific value for each containers. Refer [official documentation](https://github.com/ansible/awx-operator/blob/0.23.0/README.md#containers-resource-requirements) for details. - You can specify more specific value for each containers. Refer [official documentation](https://github.com/ansible/awx-operator/blob/0.24.0/README.md#containers-resource-requirements) for details.
- In this way you can run AWX with fewer resources, but you may encounter performance issues. - In this way you can run AWX with fewer resources, but you may encounter performance issues.
### The Pod is `Pending` with "1 pod has unbound immediate PersistentVolumeClaims." event ### The Pod is `Pending` with "1 pod has unbound immediate PersistentVolumeClaims." event

View file

@ -10,6 +10,7 @@ The table below maps the AWX Operator versions and bundled AWX versions.
| AWX Operator | AWX | | AWX Operator | AWX |
| - | - | | - | - |
| 0.24.0 | 21.3.0 |
| 0.23.0 | 21.2.0 | | 0.23.0 | 21.2.0 |
| 0.22.0 | 21.1.0 | | 0.22.0 | 21.1.0 |
| 0.21.0 | 21.0.0 | | 0.21.0 | 21.0.0 |