From 10b0bfdec04d50a0d160c3c9bd44db243af3a2bb Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Fri, 16 Feb 2024 14:41:49 +0900 Subject: [PATCH 1/2] feat: bump operator version to 2.12.0 --- README.md | 17 ++++++++++------- acme/README.md | 2 +- backup/ansible/README.md | 2 +- operator/kustomization.yaml | 4 ++-- runner/README.md | 2 +- tips/upgrade-operator.md | 3 +++ tips/version-mapping.md | 1 + 7 files changed, 19 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 481529d..4fddfcc 100644 --- a/README.md +++ b/README.md @@ -29,17 +29,17 @@ An example implementation of AWX on single node K3s using AWX Operator, with eas - Tested on: - CentOS Stream 8 (Minimal) - - K3s v1.28.5+k3s1 + - K3s v1.28.6+k3s2 - Products that will be deployed: - - AWX Operator 2.11.0 - - AWX 23.7.0 + - AWX Operator 2.12.0 + - AWX 23.8.0 - PostgreSQL 13 ## References - [K3s - Lightweight Kubernetes](https://docs.k3s.io/) -- [INSTALL.md on ansible/awx](https://github.com/ansible/awx/blob/23.7.0/INSTALL.md) @23.7.0 -- [README.md on ansible/awx-operator](https://github.com/ansible/awx-operator/blob/2.11.0/README.md) @2.11.0 +- [INSTALL.md on ansible/awx](https://github.com/ansible/awx/blob/23.8.0/INSTALL.md) @23.8.0 +- [README.md on ansible/awx-operator](https://github.com/ansible/awx-operator/blob/2.12.0/README.md) @2.12.0 ## Requirements @@ -79,11 +79,14 @@ sudo dnf install -y git curl Install specific version of K3s with `--write-kubeconfig-mode 644` to make config file (`/etc/rancher/k3s/k3s.yaml`) readable by non-root user. ```bash -curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.5+k3s1 sh -s - --write-kubeconfig-mode 644 +curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.6+k3s2 sh -s - --write-kubeconfig-mode 644 ``` ### Install AWX Operator +> [!WARNING] +> AWX Operator 2.12.0 and AWX 23.8.0 are marked as NOT RECOMMENDED due to [a known issue](https://github.com/ansible/awx/issues/14876). Refer to the release notes ([for AWX Operator](https://github.com/ansible/awx-operator/releases/tag/2.12.0), [for AWX](https://github.com/ansible/awx/releases/tag/23.8.0)) for details. + Clone this repository and change directory. If you want to use files suitable for the specific version of AWX Operator, [refer tags in this repository](https://github.com/kurokobo/awx-on-k3s/tags) and specify desired tag in `git checkout`. Especially for `0.13.0` or earlier version of AWX Operator, refer to [📝Tips: Deploy older version of AWX Operator](tips/deploy-older-operator.md). @@ -92,7 +95,7 @@ If you want to use files suitable for the specific version of AWX Operator, [ref cd ~ git clone https://github.com/kurokobo/awx-on-k3s.git cd awx-on-k3s -git checkout 2.11.0 +git checkout 2.12.0 ``` Then invoke `kubectl apply -k operator` to deploy AWX Operator. diff --git a/acme/README.md b/acme/README.md index cc591cf..631f43f 100644 --- a/acme/README.md +++ b/acme/README.md @@ -42,7 +42,7 @@ This guide does not provide any information how to configure Azure, other DNS se Deploy cert-manager first. ```bash -kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.13.3/cert-manager.yaml +kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.14.2/cert-manager.yaml ``` Ensure the pods in `cert-manager` namespace are running. diff --git a/backup/ansible/README.md b/backup/ansible/README.md index 3770a30..951692d 100644 --- a/backup/ansible/README.md +++ b/backup/ansible/README.md @@ -32,7 +32,7 @@ An example simple playbook for Ansible is also provided in this repository. This | - | - | - | | `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_spec` | The `spec` of the `AWXBackup` resource. Refer [official documentation](https://github.com/ansible/awx-operator/tree/2.11.0/roles/backup) for acceptable fields. | `deployment_name: awx`
`backup_pvc: awx-backup-claim`
`clean_backup_on_delete: true` | +| `awxbackup_spec` | The `spec` of the `AWXBackup` resource. Refer [official documentation](https://github.com/ansible/awx-operator/tree/2.12.0/roles/backup) for acceptable fields. | `deployment_name: awx`
`backup_pvc: awx-backup-claim`
`clean_backup_on_delete: true` | | `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. | `30` | diff --git a/operator/kustomization.yaml b/operator/kustomization.yaml index a046f82..d0ac04d 100644 --- a/operator/kustomization.yaml +++ b/operator/kustomization.yaml @@ -12,8 +12,8 @@ secretGenerator: - operator=awx resources: - - github.com/ansible/awx-operator/config/default?ref=2.11.0 + - github.com/ansible/awx-operator/config/default?ref=2.12.0 images: - name: quay.io/ansible/awx-operator - newTag: 2.11.0 + newTag: 2.12.0 diff --git a/runner/README.md b/runner/README.md index 95adf14..713a3ae 100644 --- a/runner/README.md +++ b/runner/README.md @@ -10,7 +10,7 @@ This repository includes ready-to-use files as an example to run Ansible Runner. - CentOS Stream 8 (Minimal) - Python 3.9 - Docker 20.10.17 -- Ansible Runner 2.3.4 +- Ansible Runner 2.3.5 ## Install diff --git a/tips/upgrade-operator.md b/tips/upgrade-operator.md index 2573bce..569dbf3 100644 --- a/tips/upgrade-operator.md +++ b/tips/upgrade-operator.md @@ -35,6 +35,9 @@ Refer [📝README: Backing up using AWX Operator](../README.md#backing-up-using- If you are using AWX Operator `0.14.0` or later and want to upgrade to newer version, basically upgrade is done by deploying the new version of AWX Operator to the same namespace where the old AWX Operator is running. +> [!WARNING] +> AWX Operator 2.12.0 and AWX 23.8.0 are marked as NOT RECOMMENDED due to [a known issue](https://github.com/ansible/awx/issues/14876). Refer to the release notes ([for AWX Operator](https://github.com/ansible/awx-operator/releases/tag/2.12.0), [for AWX](https://github.com/ansible/awx/releases/tag/23.8.0)) for details. + ### ⚠️ Note for upgrading from `2.0.0` to `2.0.1` or later Note that only when upgrading **from `2.0.0` that deployed using this repository to `2.0.1` or later**, [the `extra_volumes` and `extra_volumes` in `base/awx.yaml` for `2.0.0` as a workaround for specific issue](https://github.com/kurokobo/awx-on-k3s/blob/2.0.0/base/awx.yaml#L42-L51) causes failure of upgrading. diff --git a/tips/version-mapping.md b/tips/version-mapping.md index 2c7d66d..3d75642 100644 --- a/tips/version-mapping.md +++ b/tips/version-mapping.md @@ -10,6 +10,7 @@ The table below maps the AWX Operator versions and bundled AWX versions. | AWX Operator | AWX | | - | - | +| 2.12.0 | 23.8.0 | | 2.11.0 | 23.7.0 | | 2.10.0 | 23.6.0 | | 2.9.0 | 23.5.1 | From d536378763c13e9e901fbecf77d95a3ea81f6aed Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Fri, 16 Feb 2024 17:38:32 +0900 Subject: [PATCH 2/2] feat: bump operator version to 2.12.1 --- README.md | 13 +++---- backup/ansible/README.md | 2 +- operator/kustomization.yaml | 4 +- tips/alternative-methods.md | 8 ++++ tips/uninstall.md | 5 +-- tips/upgrade-operator.md | 77 +++++++++++++++++-------------------- tips/version-mapping.md | 1 + 7 files changed, 54 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 4fddfcc..7c6e5bd 100644 --- a/README.md +++ b/README.md @@ -31,15 +31,15 @@ An example implementation of AWX on single node K3s using AWX Operator, with eas - CentOS Stream 8 (Minimal) - K3s v1.28.6+k3s2 - Products that will be deployed: - - AWX Operator 2.12.0 - - AWX 23.8.0 + - AWX Operator 2.12.1 + - AWX 23.8.1 - PostgreSQL 13 ## References - [K3s - Lightweight Kubernetes](https://docs.k3s.io/) -- [INSTALL.md on ansible/awx](https://github.com/ansible/awx/blob/23.8.0/INSTALL.md) @23.8.0 -- [README.md on ansible/awx-operator](https://github.com/ansible/awx-operator/blob/2.12.0/README.md) @2.12.0 +- [INSTALL.md on ansible/awx](https://github.com/ansible/awx/blob/23.8.1/INSTALL.md) @23.8.1 +- [README.md on ansible/awx-operator](https://github.com/ansible/awx-operator/blob/2.12.1/README.md) @2.12.1 ## Requirements @@ -84,9 +84,6 @@ curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.6+k3s2 sh -s - --write- ### Install AWX Operator -> [!WARNING] -> AWX Operator 2.12.0 and AWX 23.8.0 are marked as NOT RECOMMENDED due to [a known issue](https://github.com/ansible/awx/issues/14876). Refer to the release notes ([for AWX Operator](https://github.com/ansible/awx-operator/releases/tag/2.12.0), [for AWX](https://github.com/ansible/awx/releases/tag/23.8.0)) for details. - Clone this repository and change directory. If you want to use files suitable for the specific version of AWX Operator, [refer tags in this repository](https://github.com/kurokobo/awx-on-k3s/tags) and specify desired tag in `git checkout`. Especially for `0.13.0` or earlier version of AWX Operator, refer to [📝Tips: Deploy older version of AWX Operator](tips/deploy-older-operator.md). @@ -95,7 +92,7 @@ If you want to use files suitable for the specific version of AWX Operator, [ref cd ~ git clone https://github.com/kurokobo/awx-on-k3s.git cd awx-on-k3s -git checkout 2.12.0 +git checkout 2.12.1 ``` Then invoke `kubectl apply -k operator` to deploy AWX Operator. diff --git a/backup/ansible/README.md b/backup/ansible/README.md index 951692d..9356a32 100644 --- a/backup/ansible/README.md +++ b/backup/ansible/README.md @@ -32,7 +32,7 @@ An example simple playbook for Ansible is also provided in this repository. This | - | - | - | | `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_spec` | The `spec` of the `AWXBackup` resource. Refer [official documentation](https://github.com/ansible/awx-operator/tree/2.12.0/roles/backup) for acceptable fields. | `deployment_name: awx`
`backup_pvc: awx-backup-claim`
`clean_backup_on_delete: true` | +| `awxbackup_spec` | The `spec` of the `AWXBackup` resource. Refer [official documentation](https://github.com/ansible/awx-operator/tree/2.12.1/roles/backup) for acceptable fields. | `deployment_name: awx`
`backup_pvc: awx-backup-claim`
`clean_backup_on_delete: true` | | `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. | `30` | diff --git a/operator/kustomization.yaml b/operator/kustomization.yaml index d0ac04d..3784b2f 100644 --- a/operator/kustomization.yaml +++ b/operator/kustomization.yaml @@ -12,8 +12,8 @@ secretGenerator: - operator=awx resources: - - github.com/ansible/awx-operator/config/default?ref=2.12.0 + - github.com/ansible/awx-operator/config/default?ref=2.12.1 images: - name: quay.io/ansible/awx-operator - newTag: 2.12.0 + newTag: 2.12.1 diff --git a/tips/alternative-methods.md b/tips/alternative-methods.md index dbaf17d..624392d 100644 --- a/tips/alternative-methods.md +++ b/tips/alternative-methods.md @@ -204,6 +204,14 @@ helm repo update helm -n awx upgrade -i awx awx-operator/awx-operator -f base/values.yaml ``` +If the upgraded AWX Operator has been released with CRD changes, you may need to run following command to apply the changes. + +```bash +# Specify the version of the upgraded AWX Operator +VERSION="1.0.1" +kubectl apply --server-side --force-conflicts -k github.com/ansible/awx-operator/config/crd?ref=${VERSION} +``` + #### Gather history of upgrades The history of the upgrades for the release can be listed with `history` command. diff --git a/tips/uninstall.md b/tips/uninstall.md index 5f33b83..26da62c 100644 --- a/tips/uninstall.md +++ b/tips/uninstall.md @@ -16,7 +16,6 @@ For example, some resources deployed with the following command; ```bash $ kubectl apply -k base -namespace/awx created secret/awx-admin-password created secret/awx-postgres-configuration created secret/awx-secret-tls created @@ -26,11 +25,11 @@ persistentvolumeclaim/awx-projects-claim created awx.awx.ansible.com/awx created ``` -can be deleted with the following command with same manifest files. +can be deleted with the following command with same manifest files. Note that PVC for PostgreSQL should be removed manually since this PVC was created by not `kubectl apply -k` but AWX Operator. ```bash +$ kubectl -n awx delete pvc postgres-13-awx-postgres-13-0 --wait=false $ kubectl delete -k base -namespace "awx" deleted secret "awx-admin-password" deleted secret "awx-postgres-configuration" deleted secret "awx-secret-tls" deleted diff --git a/tips/upgrade-operator.md b/tips/upgrade-operator.md index 569dbf3..592b91a 100644 --- a/tips/upgrade-operator.md +++ b/tips/upgrade-operator.md @@ -16,8 +16,6 @@ Note that once you upgrade AWX Operator, your AWX will also be upgraded automati - [✅ Take a backup of the old AWX instance](#-take-a-backup-of-the-old-awx-instance) - [📝 Upgrade from `0.14.0` or later (e.g. from `0.14.0` to `0.15.0`)](#-upgrade-from-0140-or-later-eg-from-0140-to-0150) - - [⚠️ Note for upgrading from `2.0.0` to `2.0.1` or later](#️-note-for-upgrading-from-200-to-201-or-later) - - [⚠️ Note for upgrading from `0.25.0` or earlier to `0.26.0` or later](#️-note-for-upgrading-from-0250-or-earlier-to-0260-or-later) - [📝 Procedure](#-procedure) - [📝 Upgrade from `0.13.0` (e.g. from `0.13.0` to `0.14.0`)](#-upgrade-from-0130-eg-from-0130-to-0140) - [📝 Procedure](#-procedure-1) @@ -36,47 +34,42 @@ Refer [📝README: Backing up using AWX Operator](../README.md#backing-up-using- If you are using AWX Operator `0.14.0` or later and want to upgrade to newer version, basically upgrade is done by deploying the new version of AWX Operator to the same namespace where the old AWX Operator is running. > [!WARNING] -> AWX Operator 2.12.0 and AWX 23.8.0 are marked as NOT RECOMMENDED due to [a known issue](https://github.com/ansible/awx/issues/14876). Refer to the release notes ([for AWX Operator](https://github.com/ansible/awx-operator/releases/tag/2.12.0), [for AWX](https://github.com/ansible/awx/releases/tag/23.8.0)) for details. +> If you are planning to upgrade AWX Operator **from `2.0.0` to `2.0.1` or later**, note that [the `extra_volumes` and `extra_volumes` in `base/awx.yaml` for `2.0.0` as a workaround for specific issue](https://github.com/kurokobo/awx-on-k3s/blob/2.0.0/base/awx.yaml#L42-L51) causes failure of upgrading. +> +> To avoid this, follow these steps before upgrading AWX Operator. Steps 1 and 2 can also be achieved by `kubectl -n awx edit awx awx`. +> +> 1. Remove the definition of the volume and volume mount that named `awx-projects-web` in `extra_volumes` and `web_extra_volume_mounts` in your `base/awx.yaml`. +> - If there are no other volumes or volume mounts, you can remove whole `extra_volumes` and `web_extra_volume_mounts`. +> 2. Apply modified `base/awx.yaml` by `kubectl apply -k base` +> 3. Wait for deployment for AWX to be completed +> +> Once your AWX has been deployed without volume `awx-projects-web`, your AWX can be safely upgraded. Proceed to [the next step](#-procedure). -### ⚠️ Note for upgrading from `2.0.0` to `2.0.1` or later - -Note that only when upgrading **from `2.0.0` that deployed using this repository to `2.0.1` or later**, [the `extra_volumes` and `extra_volumes` in `base/awx.yaml` for `2.0.0` as a workaround for specific issue](https://github.com/kurokobo/awx-on-k3s/blob/2.0.0/base/awx.yaml#L42-L51) causes failure of upgrading. - -To avoid this, follow these steps before upgrading AWX Operator. Steps 1 and 2 can also be achieved by `kubectl -n awx edit awx awx`. - -1. Remove the definition of the volume and volume mount that named `awx-projects-web` in `extra_volumes` and `web_extra_volume_mounts` in your `base/awx.yaml`. - - If there are no other volumes or volume mounts, you can remove whole `extra_volumes` and `web_extra_volume_mounts`. -2. Apply modified `base/awx.yaml` by `kubectl apply -k base` -3. Wait for deployment for AWX to be completed - -Once your AWX has been deployed without volume `awx-projects-web`, your AWX can be safely upgraded. Proceed to [the next step](#-procedure). - -### ⚠️ Note for upgrading from `0.25.0` or earlier to `0.26.0` or later - -Note that only when upgrading **from `0.25.0` or earlier to `0.26.0` or later**, since the bundled PostgreSQL version will be changed to 13, so the following additional tasks are required. - -```bash -# Required only when upgrading from 0.25.0 or earlier to 0.26.0 or later -sudo mkdir -p /data/postgres-13 -sudo chmod 755 /data/postgres-13 -cat < pv-postgres-13.yaml ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: awx-postgres-13-volume -spec: - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - capacity: - storage: 8Gi - storageClassName: awx-postgres-volume - hostPath: - path: /data/postgres-13 -EOF -kubectl apply -f pv-postgres-13.yaml -``` +> [!WARNING] +> If you are planning to upgrade AWX Operator **from `0.25.0` or earlier to `0.26.0` or later**, note that since the bundled PostgreSQL version will be changed to 13, so the following additional tasks are required. +> +> ```bash +> # Required only when upgrading from 0.25.0 or earlier to 0.26.0 or later +> sudo mkdir -p /data/postgres-13 +> sudo chmod 755 /data/postgres-13 +> cat < pv-postgres-13.yaml +> --- +> apiVersion: v1 +> kind: PersistentVolume +> metadata: +> name: awx-postgres-13-volume +> spec: +> accessModes: +> - ReadWriteOnce +> persistentVolumeReclaimPolicy: Retain +> capacity: +> storage: 8Gi +> storageClassName: awx-postgres-volume +> hostPath: +> path: /data/postgres-13 +> EOF +> kubectl apply -f pv-postgres-13.yaml +> ``` ### 📝 Procedure diff --git a/tips/version-mapping.md b/tips/version-mapping.md index 3d75642..a7719b5 100644 --- a/tips/version-mapping.md +++ b/tips/version-mapping.md @@ -10,6 +10,7 @@ The table below maps the AWX Operator versions and bundled AWX versions. | AWX Operator | AWX | | - | - | +| 2.12.1 | 23.8.1 | | 2.12.0 | 23.8.0 | | 2.11.0 | 23.7.0 | | 2.10.0 | 23.6.0 |