From 2726e781d5d9f468f391911f5872727883b5bdc7 Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:34:02 +0900 Subject: [PATCH 1/8] feat: bump postgresql version to 15 --- README.md | 18 +++++++++--------- base/kustomization.yaml | 2 +- base/pv.yaml | 4 ++-- restore/README.md | 10 +++++----- restore/pv.yaml | 4 ++-- tips/alternative-methods.md | 2 +- tips/enable-hsts.md | 2 +- tips/troubleshooting.md | 35 +++++++++++++++++++++++++++-------- tips/uninstall.md | 2 +- tips/upgrade-operator.md | 26 ++++++++++++++++++++++++++ 10 files changed, 75 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 641171e..afdb951 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ An example implementation of AWX on single node K3s using AWX Operator, with eas - Products that will be deployed: - AWX Operator 2.12.2 - AWX 23.9.0 - - PostgreSQL 13 + - PostgreSQL 15 ## References @@ -85,8 +85,8 @@ curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.6+k3s2 sh -s - --write- ### Install AWX Operator -> [!WARNING] -> If you are planning that creating backup of your AWX instance using AWX Operator by referring to [the backup guide](backup), AWX Operator 2.12.2 is not recommended due to [a known issue for backup](https://github.com/ansible/awx-operator/issues/1734). Use an older version of AWX Operator like [2.12.1](https://github.com/kurokobo/awx-on-k3s/tree/2.12.1) instead. +> [!NOTE] +> From AWX Operator 2.13.0, Default PostgreSQL version is bumped from 13 to 15. If you have a plan to upgrade existing AWX Operator and AWX, refer to [πŸ“Tips: Upgrade AWX Operator and AWX](tips/upgrade-operator.md) to perform additional tasks to database migration. Clone this repository and change directory. @@ -151,7 +151,7 @@ Modify the two `password` entries in `base/kustomization.yaml`. Note that the `p - name: awx-postgres-configuration type: Opaque literals: - - host=awx-postgres-13 + - host=awx-postgres-15 - port=5432 - database=awx - username=awx @@ -168,9 +168,9 @@ Modify the two `password` entries in `base/kustomization.yaml`. Note that the `p Prepare directories for Persistent Volumes defined in `base/pv.yaml`. These directories will be used to store your databases and project files. Note that the size of the PVs and PVCs are specified in some of the files in this repository, but since their backends are `hostPath`, its value is just like a label and there is no actual capacity limitation. ```bash -sudo mkdir -p /data/postgres-13 +sudo mkdir -p /data/postgres-15 sudo mkdir -p /data/projects -sudo chmod 755 /data/postgres-13 +sudo chmod 755 /data/postgres-15 sudo chown 1000:0 /data/projects ``` @@ -207,13 +207,13 @@ awx.awx.ansible.com/awx 6m15s NAME READY STATUS RESTARTS AGE pod/awx-operator-controller-manager-57867569c4-ggl29 2/2 Running 0 6m50s -pod/awx-postgres-13-0 1/1 Running 0 5m56s +pod/awx-postgres-15-0 1/1 Running 0 5m56s pod/awx-task-5d8cd9b6b9-8ptjt 4/4 Running 0 5m25s pod/awx-web-66f89bc9cf-6zck5 3/3 Running 0 4m39s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/awx-operator-controller-manager-metrics-service ClusterIP 10.43.18.30 8443/TCP 7m -service/awx-postgres-13 ClusterIP None 5432/TCP 5m55s +service/awx-postgres-15 ClusterIP None 5432/TCP 5m55s service/awx-service ClusterIP 10.43.237.218 80/TCP 5m28s NAME READY UP-TO-DATE AVAILABLE AGE @@ -227,7 +227,7 @@ replicaset.apps/awx-task-5d8cd9b6b9 1 1 replicaset.apps/awx-web-66f89bc9cf 1 1 1 4m39s NAME READY AGE -statefulset.apps/awx-postgres-13 1/1 5m56s +statefulset.apps/awx-postgres-15 1/1 5m56s NAME CLASS HOSTS ADDRESS PORTS AGE ingress.networking.k8s.io/awx-ingress traefik awx.example.com 192.168.0.219 80, 443 5m27s diff --git a/base/kustomization.yaml b/base/kustomization.yaml index bddf77e..bd31048 100644 --- a/base/kustomization.yaml +++ b/base/kustomization.yaml @@ -16,7 +16,7 @@ secretGenerator: - name: awx-postgres-configuration type: Opaque literals: - - host=awx-postgres-13 + - host=awx-postgres-15 - port=5432 - database=awx - username=awx diff --git a/base/pv.yaml b/base/pv.yaml index bc3c4c0..c0187b5 100644 --- a/base/pv.yaml +++ b/base/pv.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: awx-postgres-13-volume + name: awx-postgres-15-volume spec: accessModes: - ReadWriteOnce @@ -11,7 +11,7 @@ spec: storage: 8Gi storageClassName: awx-postgres-volume hostPath: - path: /data/postgres-13 + path: /data/postgres-15 --- apiVersion: v1 diff --git a/restore/README.md b/restore/README.md index 5f954ab..69b1716 100644 --- a/restore/README.md +++ b/restore/README.md @@ -29,19 +29,19 @@ If your AWX instance is running, it is recommended that it be deleted along with ```bash # Delete AWX resource, PVC, and PV kubectl -n awx delete awx awx -kubectl -n awx delete pvc postgres-13-awx-postgres-13-0 -kubectl delete pv awx-postgres-13-volume +kubectl -n awx delete pvc postgres-15-awx-postgres-15-0 +kubectl delete pv awx-postgres-15-volume # Delete any data in the PV -sudo rm -rf /data/postgres-13 +sudo rm -rf /data/postgres-15 ``` Then prepare directories for your PVs. `/data/projects` is required if you are restoring the entire AWX to a new environment. ```bash -sudo mkdir -p /data/postgres-13 +sudo mkdir -p /data/postgres-15 sudo mkdir -p /data/projects -sudo chmod 755 /data/postgres-13 +sudo chmod 755 /data/postgres-15 sudo chown 1000:0 /data/projects ``` diff --git a/restore/pv.yaml b/restore/pv.yaml index 051aa2a..e3cfc32 100644 --- a/restore/pv.yaml +++ b/restore/pv.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: awx-postgres-13-volume + name: awx-postgres-15-volume spec: accessModes: - ReadWriteOnce @@ -11,7 +11,7 @@ spec: storage: 8Gi storageClassName: awx-postgres-volume hostPath: - path: /data/postgres-13 + path: /data/postgres-15 --- apiVersion: v1 diff --git a/tips/alternative-methods.md b/tips/alternative-methods.md index 789c3df..9d32777 100644 --- a/tips/alternative-methods.md +++ b/tips/alternative-methods.md @@ -245,7 +245,7 @@ $ kubectl delete -k base secret "awx-admin-password" deleted secret "awx-postgres-configuration" deleted secret "awx-secret-tls" deleted -persistentvolume "awx-postgres-13-volume" deleted +persistentvolume "awx-postgres-15-volume" deleted persistentvolume "awx-projects-volume" deleted persistentvolumeclaim "awx-projects-claim" deleted diff --git a/tips/enable-hsts.md b/tips/enable-hsts.md index fbb0377..ba38abe 100644 --- a/tips/enable-hsts.md +++ b/tips/enable-hsts.md @@ -87,7 +87,7 @@ namespace/awx unchanged secret/awx-admin-password unchanged secret/awx-postgres-configuration unchanged secret/awx-secret-tls configured -persistentvolume/awx-postgres-13-volume unchanged +persistentvolume/awx-postgres-15-volume unchanged persistentvolume/awx-projects-volume unchanged persistentvolumeclaim/awx-projects-claim unchanged awx.awx.ansible.com/awx configured πŸ‘ˆπŸ‘ˆπŸ‘ˆ diff --git a/tips/troubleshooting.md b/tips/troubleshooting.md index 60bbd51..6d7a12e 100644 --- a/tips/troubleshooting.md +++ b/tips/troubleshooting.md @@ -44,7 +44,7 @@ If the Pods are working properly, its `STATUS` are `Running`. If your Pods are n $ kubectl -n awx get pod NAME READY STATUS RESTARTS AGE awx-operator-controller-manager-57867569c4-ggl29 2/2 Running 0 8m20s -awx-postgres-13-0 1/1 Running 0 7m26s +awx-postgres-15-0 1/1 Running 0 7m26s awx-task-5d8cd9b6b9-8ptjt 0/4 Pending 0 6m55s awx-web-66f89bc9cf-6zck5 0/3 Pending 0 6m9s ``` @@ -108,7 +108,7 @@ For AWX Operator and AWX, specifically, the following commands are helpful. - `kubectl -n awx logs -f deployment/awx-task -c awx-rsyslog` - `kubectl -n awx logs -f deployment/awx-task -c redis` - Logs of PostgreSQL - - `kubectl -n awx logs -f statefulset/awx-postgres-13` + - `kubectl -n awx logs -f statefulset/awx-postgres-15` ### Reveal "censored" output in the AWX Operator's log @@ -208,7 +208,7 @@ Check the `STATUS` of your PVs and ensure your PVs doesn't have `Available` or ` $ kubectl get pv NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE awx-projects-volume 2Gi RWO Retain Released awx/awx-projects-claim awx-projects-volume 17h -awx-postgres-13-volume 8Gi RWO Retain Released awx/postgres-13-awx-postgres-13-0 awx-postgres-volume 17h +awx-postgres-15-volume 8Gi RWO Retain Released awx/postgres-15-awx-postgres-15-0 awx-postgres-volume 17h ``` Probably this is the second (or more) time to deploy AWX for you. These PVs which have `Released` state are tied to your old (and probably no longer exists now) PVCs you created in the past. @@ -266,9 +266,9 @@ This problem occurs when the AWX pod and the PostgreSQL pod cannot communicate p To solve this, check or try the following: -- Ensure your PostgreSQL (typically the Pod named `awx-postgres-0` or `awx-postgres-13-0`) is in `Running` state. +- Ensure your PostgreSQL (typically the Pod named `awx-postgres-0`, `awx-postgres-13-0`, or `awx-postgres-15-0`) is in `Running` state. - Ensure `host` under `awx-postgres-configuration` in `base/kustomization.yaml` has correct value. - - Specify `awx-postgres` for AWX Operator 0.25.0 or earlier, `awx-postgres-13` for `0.26.0` or later. + - Specify `awx-postgres` for AWX Operator 0.25.0 or earlier, `awx-postgres-13` for `0.26.0` to `2.12.2`, `awx-postgres-15` for newer versions. - Ensure your `firewalld`, `ufw` or any kind of firewall has been disabled on your K3s host. - Ensure your `nm-cloud-setup` service on your K3s host is disabled if exists. - Ensure your `awx-postgres-configuration` has correct values, especially if you're using external PostgreSQL. @@ -290,7 +290,9 @@ $ kubectl -n awx logs statefulset/awx-postgres mkdir: cannot create directory '/var/lib/postgresql/data': Permission denied ``` -You should check the permissions and the owner of directories where used as PV on your K3s host. If you followed my guide, it would be `/data/postgres-13`. There is additional `data` directory created by K3s under `/data/postgres-13`. +You should check the permissions and the owner of directories where used as PV on your K3s host. + +For the PostgreSQL that deployed by **AWX Operator 2.12.2 or earlier**, if you followed my guide, it would be `/data/postgres-13`. There is additional `data` directory created by K3s under `/data/postgres-13`. ```bash $ ls -ld /data/postgres-13 /data/postgres-13/data @@ -305,14 +307,31 @@ sudo chmod 755 /data/postgres-13 /data/postgres-13/data sudo chown 0:0 /data/postgres-13 /data/postgres-13/data ``` -Or, you can also try `999:0` as owner/group for the directory. +Or, you can also try `` as owner/group for the directory. ```bash sudo chmod 755 /data/postgres-13 /data/postgres-13/data sudo chown 999:0 /data/postgres-13 /data/postgres-13/data ``` -`999` is [the UID of the `postgres` user which used in the container](https://github.com/docker-library/postgres/blob/master/12/bullseye/Dockerfile#L23). +`999` is [the UID of the `postgres` user which used in the container](https://github.com/docker-library/postgres/blob/master/13/bullseye/Dockerfile#L13). + +For the PostgreSQL that deployed by **AWX Operator 2.13.0 or later**, if you followed my guide, it would be `/data/postgres-15`. There is additional `data` directory created by K3s under `/data/postgres-15`. + +```bash +$ ls -ld /data/postgres-15 /data/postgres-15/data +drwxr-xr-x. 2 root root 18 Aug 20 10:09 /data/postgres-15 +drwxr-xr-x. 3 root root 20 Aug 20 10:09 /data/postgres-15/data +``` + +In my environment, `755` and `26:0` works correctly. So you can try: + +```bash +sudo chmod 755 /data/postgres-15 /data/postgres-15/data +sudo chown 26:0 /data/postgres-15 /data/postgres-15/data +``` + +`26` is [the UID of the user which used in the container](https://github.com/sclorg/postgresql-container/blob/master/15/Dockerfile.c9s#L86). ## Troubles during Daily Use diff --git a/tips/uninstall.md b/tips/uninstall.md index 26da62c..f9c7790 100644 --- a/tips/uninstall.md +++ b/tips/uninstall.md @@ -28,7 +28,7 @@ awx.awx.ansible.com/awx created 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 -n awx delete pvc postgres-15-awx-postgres-15-0 --wait=false $ kubectl delete -k base secret "awx-admin-password" deleted secret "awx-postgres-configuration" deleted diff --git a/tips/upgrade-operator.md b/tips/upgrade-operator.md index 592b91a..9c70fe6 100644 --- a/tips/upgrade-operator.md +++ b/tips/upgrade-operator.md @@ -33,6 +33,32 @@ 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] +> If you are planning to upgrade AWX Operator **from `2.12.2` or earlier to `2.13.0` or later**, note that since the bundled PostgreSQL version will be changed to 15, so the following additional tasks are required. +> +> ```bash +> # Required only when upgrading from 2.12.2 or earlier to 2.13.0 or later +> sudo mkdir -p /data/postgres-15 +> sudo chmod 755 /data/postgres-15 +> cat < pv-postgres-15.yaml +> --- +> apiVersion: v1 +> kind: PersistentVolume +> metadata: +> name: awx-postgres-15-volume +> spec: +> accessModes: +> - ReadWriteOnce +> persistentVolumeReclaimPolicy: Retain +> capacity: +> storage: 8Gi +> storageClassName: awx-postgres-volume +> hostPath: +> path: /data/postgres-15 +> EOF +> kubectl apply -f pv-postgres-15.yaml +> ``` + > [!WARNING] > 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. > From 5ad54201a9b6f954c777950e4bf03d3fd77c3b4c Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:37:27 +0900 Subject: [PATCH 2/8] docs: add notes to clean old pv up --- tips/upgrade-operator.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tips/upgrade-operator.md b/tips/upgrade-operator.md index 9c70fe6..621e0c4 100644 --- a/tips/upgrade-operator.md +++ b/tips/upgrade-operator.md @@ -130,13 +130,23 @@ PLAY RECAP ********************************************************************* localhost : ok=56 changed=0 unreachable=0 failed=0 skipped=35 rescued=0 ignored=0 ``` -If your AWX Operator has upgraded from `0.25.0` or earlier to `0.26.0` or later, old PV for PostgreSQL 12 can be removed since new AWX is running with new PV for PostgreSQL 13. +> [!NOTE] +> If your AWX Operator has upgraded from `2.12.2` or earlier to `2.13.0` or later, old PV for PostgreSQL 13 can be removed since new AWX is running with new PV for PostgreSQL 15. +> +> ```bash +> # Recommended only when upgraded from 2.12.2 or earlier to 2.13.0 or later +> kubectl delete pv awx-postgres-13-volume +> sudo rm -rf /data/postgres-13 +> ``` -```bash -# Recommended only when upgraded from 0.25.0 or earlier to 0.26.0 or later -kubectl delete pv awx-postgres-volume -sudo rm -rf /data/postgres -``` +> [!NOTE] +> If your AWX Operator has upgraded from `0.25.0` or earlier to `0.26.0` or later, old PV for PostgreSQL 12 can be removed since new AWX is running with new PV for PostgreSQL 13. +> +> ```bash +> # Recommended only when upgraded from 0.25.0 or earlier to 0.26.0 or later +> kubectl delete pv awx-postgres-volume +> sudo rm -rf /data/postgres +> ``` ## πŸ“ Upgrade from `0.13.0` (e.g. from `0.13.0` to `0.14.0`) From 165eeff88bb8b9da646caabf2b4aa9fe6a1e3053 Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Thu, 14 Mar 2024 13:26:34 +0900 Subject: [PATCH 3/8] feat: bump operator version to 2.13.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 afdb951..17d81d3 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.6+k3s2 + - K3s v1.28.7+k3s1 - Products that will be deployed: - - AWX Operator 2.12.2 - - AWX 23.9.0 + - AWX Operator 2.13.0 + - AWX 24.0.0 - PostgreSQL 15 ## References - [K3s - Lightweight Kubernetes](https://docs.k3s.io/) -- [INSTALL.md on ansible/awx](https://github.com/ansible/awx/blob/23.9.0/INSTALL.md) @23.9.0 -- [README.md on ansible/awx-operator](https://github.com/ansible/awx-operator/blob/2.12.2/README.md) @2.12.2 +- [INSTALL.md on ansible/awx](https://github.com/ansible/awx/blob/24.0.0/INSTALL.md) @24.0.0 +- [README.md on ansible/awx-operator](https://github.com/ansible/awx-operator/blob/2.13.0/README.md) @2.13.0 ## Requirements @@ -80,11 +80,14 @@ sudo dnf install -y git curl Install a specific version of K3s with `--write-kubeconfig-mode 644` to make the config file (`/etc/rancher/k3s/k3s.yaml`) readable by non-root users. ```bash -curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.6+k3s2 sh -s - --write-kubeconfig-mode 644 +curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.7+k3s1 sh -s - --write-kubeconfig-mode 644 ``` ### Install AWX Operator +> [!CAUTION] +> AWX Operator 2.13.0 has [a bug that potentially causes data loss](https://forum.ansible.com/t/attention-do-not-upgrade-to-awx-operator-to-2-13-0/4363/3), and its image is already removed from `quay.io`. Use AWX Operator 2.13.1 or later instead. + > [!NOTE] > From AWX Operator 2.13.0, Default PostgreSQL version is bumped from 13 to 15. If you have a plan to upgrade existing AWX Operator and AWX, refer to [πŸ“Tips: Upgrade AWX Operator and AWX](tips/upgrade-operator.md) to perform additional tasks to database migration. @@ -96,7 +99,7 @@ If you want to use files suitable for a specific version of AWX Operator, [refer cd ~ git clone https://github.com/kurokobo/awx-on-k3s.git cd awx-on-k3s -git checkout 2.12.2 +git checkout 2.13.0 ``` Then invoke `kubectl apply -k operator` to deploy AWX Operator. diff --git a/acme/README.md b/acme/README.md index e7d5065..666082e 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.14.3/cert-manager.yaml +kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.14.4/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 28d28cd..f59c480 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.2/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.13.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 5552cb7..2c18f52 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.2 + - github.com/ansible/awx-operator/config/default?ref=2.13.0 images: - name: quay.io/ansible/awx-operator - newTag: 2.12.2 + newTag: 2.13.0 diff --git a/runner/README.md b/runner/README.md index 713a3ae..4a71ab4 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.5 +- Ansible Runner 2.3.6 ## Install diff --git a/tips/upgrade-operator.md b/tips/upgrade-operator.md index 621e0c4..404d893 100644 --- a/tips/upgrade-operator.md +++ b/tips/upgrade-operator.md @@ -33,6 +33,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. +> [!CAUTION] +> AWX Operator 2.13.0 has [a bug that potentially causes data loss](https://forum.ansible.com/t/attention-do-not-upgrade-to-awx-operator-to-2-13-0/4363/3), and its image is already removed from `quay.io`. Use AWX Operator 2.13.1 or later instead. + > [!WARNING] > If you are planning to upgrade AWX Operator **from `2.12.2` or earlier to `2.13.0` or later**, note that since the bundled PostgreSQL version will be changed to 15, so the following additional tasks are required. > diff --git a/tips/version-mapping.md b/tips/version-mapping.md index 83ff0ec..39037a9 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.13.0 | 24.0.0 | | 2.12.2 | 23.9.0 | | 2.12.1 | 23.8.1 | | 2.12.0 | 23.8.0 | From f57cc7ae28bb1980e6b2242775f34dcb6f7d8682 Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Thu, 14 Mar 2024 21:49:22 +0900 Subject: [PATCH 4/8] feat: bump operator version to 2.13.1 --- README.md | 74 +++++++++++++++++++------------------ backup/README.md | 17 ++++----- backup/ansible/README.md | 2 +- containergroup/README.md | 4 +- galaxy/README.md | 2 +- operator/kustomization.yaml | 4 +- restore/README.md | 7 ++-- rulebooks/README.md | 2 +- tips/troubleshooting.md | 30 +++++++++------ tips/upgrade-operator.md | 18 ++++----- tips/version-mapping.md | 1 + 11 files changed, 84 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index 17d81d3..7161542 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ An example implementation of AWX on single node K3s using AWX Operator, with eas - CentOS Stream 8 (Minimal) - K3s v1.28.7+k3s1 - Products that will be deployed: - - AWX Operator 2.13.0 + - AWX Operator 2.13.1 - AWX 24.0.0 - PostgreSQL 15 @@ -39,7 +39,7 @@ An example implementation of AWX on single node K3s using AWX Operator, with eas - [K3s - Lightweight Kubernetes](https://docs.k3s.io/) - [INSTALL.md on ansible/awx](https://github.com/ansible/awx/blob/24.0.0/INSTALL.md) @24.0.0 -- [README.md on ansible/awx-operator](https://github.com/ansible/awx-operator/blob/2.13.0/README.md) @2.13.0 +- [README.md on ansible/awx-operator](https://github.com/ansible/awx-operator/blob/2.13.1/README.md) @2.13.1 ## Requirements @@ -85,9 +85,6 @@ curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.7+k3s1 sh -s - --write- ### Install AWX Operator -> [!CAUTION] -> AWX Operator 2.13.0 has [a bug that potentially causes data loss](https://forum.ansible.com/t/attention-do-not-upgrade-to-awx-operator-to-2-13-0/4363/3), and its image is already removed from `quay.io`. Use AWX Operator 2.13.1 or later instead. - > [!NOTE] > From AWX Operator 2.13.0, Default PostgreSQL version is bumped from 13 to 15. If you have a plan to upgrade existing AWX Operator and AWX, refer to [πŸ“Tips: Upgrade AWX Operator and AWX](tips/upgrade-operator.md) to perform additional tasks to database migration. @@ -99,7 +96,7 @@ If you want to use files suitable for a specific version of AWX Operator, [refer cd ~ git clone https://github.com/kurokobo/awx-on-k3s.git cd awx-on-k3s -git checkout 2.13.0 +git checkout 2.13.1 ``` Then invoke `kubectl apply -k operator` to deploy AWX Operator. @@ -171,9 +168,10 @@ Modify the two `password` entries in `base/kustomization.yaml`. Note that the `p Prepare directories for Persistent Volumes defined in `base/pv.yaml`. These directories will be used to store your databases and project files. Note that the size of the PVs and PVCs are specified in some of the files in this repository, but since their backends are `hostPath`, its value is just like a label and there is no actual capacity limitation. ```bash -sudo mkdir -p /data/postgres-15 +sudo mkdir -p /data/postgres-15/data sudo mkdir -p /data/projects -sudo chmod 755 /data/postgres-15 +sudo chmod 700 /data/postgres-15/data +sudo chown 26:0 /data/postgres-15/data sudo chown 1000:0 /data/projects ``` @@ -198,7 +196,7 @@ $ kubectl -n awx logs -f deployments/awx-operator-controller-manager ... ----- Ansible Task Status Event StdOut (awx.ansible.com/v1beta1, Kind=AWX, awx/awx) ----- PLAY RECAP ********************************************************************* -localhost : ok=85 changed=1 unreachable=0 failed=0 skipped=78 rescued=0 ignored=1 +localhost : ok=90 changed=0 unreachable=0 failed=0 skipped=81 rescued=0 ignored=1 ``` The required objects should now have been deployed next to AWX Operator in the `awx` namespace. @@ -206,45 +204,49 @@ The required objects should now have been deployed next to AWX Operator in the ` ```bash $ kubectl -n awx get awx,all,ingress,secrets NAME AGE -awx.awx.ansible.com/awx 6m15s +awx.awx.ansible.com/awx 6m48s -NAME READY STATUS RESTARTS AGE -pod/awx-operator-controller-manager-57867569c4-ggl29 2/2 Running 0 6m50s -pod/awx-postgres-15-0 1/1 Running 0 5m56s -pod/awx-task-5d8cd9b6b9-8ptjt 4/4 Running 0 5m25s -pod/awx-web-66f89bc9cf-6zck5 3/3 Running 0 4m39s +NAME READY STATUS RESTARTS AGE +pod/awx-operator-controller-manager-59b86c6fb-4zz9r 2/2 Running 0 7m22s +pod/awx-postgres-15-0 1/1 Running 0 6m33s +pod/awx-web-549f7fdbc5-htpl9 3/3 Running 0 6m5s +pod/awx-migration-24.0.0-kglht 0/1 Completed 0 4m36s +pod/awx-task-7d4fcdd449-mqkp2 4/4 Running 0 6m4s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -service/awx-operator-controller-manager-metrics-service ClusterIP 10.43.18.30 8443/TCP 7m -service/awx-postgres-15 ClusterIP None 5432/TCP 5m55s -service/awx-service ClusterIP 10.43.237.218 80/TCP 5m28s +service/awx-operator-controller-manager-metrics-service ClusterIP 10.43.58.194 8443/TCP 7m33s +service/awx-postgres-15 ClusterIP None 5432/TCP 6m33s +service/awx-service ClusterIP 10.43.180.226 80/TCP 6m7s NAME READY UP-TO-DATE AVAILABLE AGE -deployment.apps/awx-operator-controller-manager 1/1 1 1 7m -deployment.apps/awx-task 1/1 1 1 5m25s -deployment.apps/awx-web 1/1 1 1 4m39s +deployment.apps/awx-operator-controller-manager 1/1 1 1 7m33s +deployment.apps/awx-web 1/1 1 1 6m5s +deployment.apps/awx-task 1/1 1 1 6m4s -NAME DESIRED CURRENT READY AGE -replicaset.apps/awx-operator-controller-manager-57867569c4 1 1 1 6m50s -replicaset.apps/awx-task-5d8cd9b6b9 1 1 1 5m25s -replicaset.apps/awx-web-66f89bc9cf 1 1 1 4m39s +NAME DESIRED CURRENT READY AGE +replicaset.apps/awx-operator-controller-manager-59b86c6fb 1 1 1 7m22s +replicaset.apps/awx-web-549f7fdbc5 1 1 1 6m5s +replicaset.apps/awx-task-7d4fcdd449 1 1 1 6m4s NAME READY AGE -statefulset.apps/awx-postgres-15 1/1 5m56s +statefulset.apps/awx-postgres-15 1/1 6m33s + +NAME COMPLETIONS DURATION AGE +job.batch/awx-migration-24.0.0 1/1 2m4s 4m36s NAME CLASS HOSTS ADDRESS PORTS AGE -ingress.networking.k8s.io/awx-ingress traefik awx.example.com 192.168.0.219 80, 443 5m27s +ingress.networking.k8s.io/awx-ingress traefik awx.example.com 192.168.0.219 80, 443 6m6s NAME TYPE DATA AGE -secret/redhat-operators-pull-secret Opaque 1 7m11s -secret/awx-admin-password Opaque 1 6m15s -secret/awx-postgres-configuration Opaque 6 6m15s -secret/awx-secret-tls kubernetes.io/tls 2 6m15s -secret/awx-app-credentials Opaque 3 5m30s -secret/awx-secret-key Opaque 1 6m6s -secret/awx-broadcast-websocket Opaque 1 6m2s -secret/awx-receptor-ca kubernetes.io/tls 2 5m37s -secret/awx-receptor-work-signing Opaque 2 5m33s +secret/redhat-operators-pull-secret Opaque 1 7m33s +secret/awx-admin-password Opaque 1 6m48s +secret/awx-postgres-configuration Opaque 6 6m48s +secret/awx-secret-tls kubernetes.io/tls 2 6m48s +secret/awx-app-credentials Opaque 3 6m9s +secret/awx-secret-key Opaque 1 6m41s +secret/awx-broadcast-websocket Opaque 1 6m38s +secret/awx-receptor-ca kubernetes.io/tls 2 6m14s +secret/awx-receptor-work-signing Opaque 2 6m12s ``` Now your AWX is available at `https://awx.example.com/` or the hostname you specified. diff --git a/backup/README.md b/backup/README.md index 2d52679..018701f 100644 --- a/backup/README.md +++ b/backup/README.md @@ -7,9 +7,6 @@ This guide is specifically designed to use with the AWX which deployed using [th You can also refer [the official instructions](https://github.com/ansible/awx-operator/tree/devel/roles/backup) for more information. -> [!WARNING] -> AWX Operator 2.12.2 can not create any backup due to [a known issue](https://github.com/ansible/awx-operator/issues/1734). - ## Table of Contents @@ -26,6 +23,8 @@ Prepare directories for Persistent Volumes to store backup files that defined in ```bash sudo mkdir -p /data/backup +sudo chmod 700 /data/backup +sudo chown 26:0 /data/backup ``` Then deploy Persistent Volume and Persistent Volume Claim. @@ -78,15 +77,15 @@ awxbackup-2021-06-06 6m47s ``` ```bash -$ ls -l /data/backup/ +$ sudo ls -l /data/backup/ total 0 -drwxr-xr-x. 2 root root 59 Jun 5 06:51 tower-openshift-backup-2021-06-06-105149 +drwxr-xr-x. 2 26 26 59 Jun 5 06:51 tower-openshift-backup-2021-06-06-105149 -$ ls -l /data/backup/tower-openshift-backup-2021-06-06-105149/ +$ sudo ls -l /data/backup/tower-openshift-backup-2021-06-06-105149/ total 736 --rw-------. 1 1001 root 1093 Jun 6 06:51 awx_object --rw-------. 1 1001 root 17085 Jun 6 06:51 secrets.yml --rw-rw----. 1 root root 833184 Jun 6 06:51 tower.db +-rw-------. 1 26 26 1093 Jun 6 06:51 awx_object +-rw-------. 1 26 26 17085 Jun 6 06:51 secrets.yml +-rw-r--r--. 1 26 26 833184 Jun 6 06:51 tower.db ``` ## Appendix: Back up AWX using Ansible diff --git a/backup/ansible/README.md b/backup/ansible/README.md index f59c480..56699b3 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.13.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.13.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/containergroup/README.md b/containergroup/README.md index 6adce7d..597c13b 100644 --- a/containergroup/README.md +++ b/containergroup/README.md @@ -35,7 +35,7 @@ Prepare directories for Persistent Volumes defined in `containergroup/case1/pv.y ```bash sudo mkdir -p /data/work -sudo chmod 755 /data/work +sudo chmod 700 /data/work sudo chown 1000:0 /data/work ``` @@ -188,7 +188,7 @@ Prepare directories for Persistent Volumes defined in `containergroup/case2/pv.y ```bash sudo mkdir -p /data/demo -sudo chmod 755 /data/demo +sudo chmod 700 /data/demo sudo chown 1000:0 /data/demo ``` diff --git a/galaxy/README.md b/galaxy/README.md index 94a56b0..3e2e313 100644 --- a/galaxy/README.md +++ b/galaxy/README.md @@ -123,7 +123,7 @@ Prepare directories for Persistent Volumes defined in `galaxy/galaxy/pv.yaml`. sudo mkdir -p /data/galaxy/postgres-13 sudo mkdir -p /data/galaxy/redis sudo mkdir -p /data/galaxy/file -sudo chmod 755 /data/galaxy/postgres-13 +sudo chmod 700 /data/galaxy/postgres-13 sudo chown 1000:0 /data/galaxy/file ``` diff --git a/operator/kustomization.yaml b/operator/kustomization.yaml index 2c18f52..115823e 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.13.0 + - github.com/ansible/awx-operator/config/default?ref=2.13.1 images: - name: quay.io/ansible/awx-operator - newTag: 2.13.0 + newTag: 2.13.1 diff --git a/restore/README.md b/restore/README.md index 69b1716..67fa9fa 100644 --- a/restore/README.md +++ b/restore/README.md @@ -39,9 +39,10 @@ sudo rm -rf /data/postgres-15 Then prepare directories for your PVs. `/data/projects` is required if you are restoring the entire AWX to a new environment. ```bash -sudo mkdir -p /data/postgres-15 +sudo mkdir -p /data/postgres-15/data sudo mkdir -p /data/projects -sudo chmod 755 /data/postgres-15 +sudo chmod 700 /data/postgres-15/data +sudo chown 26:0 /data/postgres-15/data sudo chown 1000:0 /data/projects ``` @@ -102,7 +103,7 @@ $ kubectl -n awx logs -f deployments/awx-operator-controller-manager ... ----- Ansible Task Status Event StdOut (awx.ansible.com/v1beta1, Kind=AWX, awx/awx) ----- PLAY RECAP ********************************************************************* -localhost : ok=87 changed=1 unreachable=0 failed=0 skipped=76 rescued=0 ignored=1 +localhost : ok=92 changed=0 unreachable=0 failed=0 skipped=79 rescued=0 ignored=1 ``` This will create AWXRestore object in the namespace, and now your AWX is restored. diff --git a/rulebooks/README.md b/rulebooks/README.md index 382dda6..21c0b21 100644 --- a/rulebooks/README.md +++ b/rulebooks/README.md @@ -117,7 +117,7 @@ Prepare directories for Persistent Volumes defined in `base/pv.yaml`. This direc ```bash sudo mkdir -p /data/eda/postgres-13/data -sudo chmod 755 /data/eda/postgres-13/data +sudo chmod 700 /data/eda/postgres-13/data sudo chown 26:0 /data/eda/postgres-13/data ``` diff --git a/tips/troubleshooting.md b/tips/troubleshooting.md index 6d7a12e..168a887 100644 --- a/tips/troubleshooting.md +++ b/tips/troubleshooting.md @@ -184,6 +184,11 @@ Typical solutions are one of the following: web_resource_requirements: {} πŸ‘ˆπŸ‘ˆπŸ‘ˆ task_resource_requirements: {} πŸ‘ˆπŸ‘ˆπŸ‘ˆ ee_resource_requirements: {} πŸ‘ˆπŸ‘ˆπŸ‘ˆ + init_container_resource_requirements: {} πŸ‘ˆπŸ‘ˆπŸ‘ˆ + postgres_init_container_resource_requirements: {} πŸ‘ˆπŸ‘ˆπŸ‘ˆ + postgres_resource_requirements: {} πŸ‘ˆπŸ‘ˆπŸ‘ˆ + redis_resource_requirements: {} πŸ‘ˆπŸ‘ˆπŸ‘ˆ + rsyslog_resource_requirements: {} πŸ‘ˆπŸ‘ˆπŸ‘ˆ ``` - You can specify more specific value for each containers. Refer [official documentation](https://ansible.readthedocs.io/projects/awx-operator/en/latest/user-guide/advanced-configuration/containers-resource-requirements.html) for details. @@ -286,13 +291,18 @@ awx-postgres-13-0 1/1 CrashLoopBackOff 5 awx-task-5d8cd9b6b9-8ptjt 0/4 Running 0 6m55s awx-web-66f89bc9cf-6zck5 0/3 Running 0 6m9s -$ kubectl -n awx logs statefulset/awx-postgres +# On PostgreSQL 13 +$ kubectl -n awx logs statefulset/awx-postgres-13 mkdir: cannot create directory '/var/lib/postgresql/data': Permission denied + +# On PostgreSQL 15 +$ kubectl -n awx logs statefulset/awx-postgres-13 +mkdir: cannot create directory '/var/lib/pgsql/data/userdata': Permission denied ``` You should check the permissions and the owner of directories where used as PV on your K3s host. -For the PostgreSQL that deployed by **AWX Operator 2.12.2 or earlier**, if you followed my guide, it would be `/data/postgres-13`. There is additional `data` directory created by K3s under `/data/postgres-13`. +For the PostgreSQL 13 that deployed by **AWX Operator 2.12.2 or earlier**, if you followed my guide, it would be `/data/postgres-13`. There is additional `data` directory created by K3s under `/data/postgres-13`. ```bash $ ls -ld /data/postgres-13 /data/postgres-13/data @@ -300,39 +310,35 @@ drwxr-xr-x. 2 root root 18 Aug 20 10:09 /data/postgres-13 drwxr-xr-x. 3 root root 20 Aug 20 10:09 /data/postgres-13/data ``` -In my environment, `755` and `root:root` (`0:0`) works correctly. So you can try: +In my environment, `755` and `root:root` (`0:0`) works correctly. So you can try following commands. ```bash sudo chmod 755 /data/postgres-13 /data/postgres-13/data sudo chown 0:0 /data/postgres-13 /data/postgres-13/data ``` -Or, you can also try `` as owner/group for the directory. +Or, you can also try `999:0` as owner/group for the directory. `999` is [the UID of the `postgres` user which used in the container](https://github.com/docker-library/postgres/blob/master/13/bullseye/Dockerfile#L13). ```bash sudo chmod 755 /data/postgres-13 /data/postgres-13/data sudo chown 999:0 /data/postgres-13 /data/postgres-13/data ``` -`999` is [the UID of the `postgres` user which used in the container](https://github.com/docker-library/postgres/blob/master/13/bullseye/Dockerfile#L13). - -For the PostgreSQL that deployed by **AWX Operator 2.13.0 or later**, if you followed my guide, it would be `/data/postgres-15`. There is additional `data` directory created by K3s under `/data/postgres-15`. +For the PostgreSQL 15 that deployed by **AWX Operator 2.13.0 or later**, if you followed my guide, it would be `/data/postgres-15`. There is additional `data` directory created by K3s under `/data/postgres-15`. ```bash $ ls -ld /data/postgres-15 /data/postgres-15/data drwxr-xr-x. 2 root root 18 Aug 20 10:09 /data/postgres-15 -drwxr-xr-x. 3 root root 20 Aug 20 10:09 /data/postgres-15/data +drwxr-xr-x. 3 26 root 20 Aug 20 10:09 /data/postgres-15/data ``` -In my environment, `755` and `26:0` works correctly. So you can try: +In my environment, `700` and `26:0` works correctly. So you can try following commands. `26` is [the UID of the user which used in the container](https://github.com/sclorg/postgresql-container/blob/master/15/Dockerfile.c9s#L86). ```bash -sudo chmod 755 /data/postgres-15 /data/postgres-15/data +sudo chmod 700 /data/postgres-15 /data/postgres-15/data sudo chown 26:0 /data/postgres-15 /data/postgres-15/data ``` -`26` is [the UID of the user which used in the container](https://github.com/sclorg/postgresql-container/blob/master/15/Dockerfile.c9s#L86). - ## Troubles during Daily Use ### Job failed with no output diff --git a/tips/upgrade-operator.md b/tips/upgrade-operator.md index 404d893..9727b86 100644 --- a/tips/upgrade-operator.md +++ b/tips/upgrade-operator.md @@ -33,16 +33,14 @@ 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. -> [!CAUTION] -> AWX Operator 2.13.0 has [a bug that potentially causes data loss](https://forum.ansible.com/t/attention-do-not-upgrade-to-awx-operator-to-2-13-0/4363/3), and its image is already removed from `quay.io`. Use AWX Operator 2.13.1 or later instead. - > [!WARNING] -> If you are planning to upgrade AWX Operator **from `2.12.2` or earlier to `2.13.0` or later**, note that since the bundled PostgreSQL version will be changed to 15, so the following additional tasks are required. +> If you are planning to upgrade AWX Operator **from `2.12.2` or earlier to `2.13.1` or later**, note that since the bundled PostgreSQL version will be changed to 15, so the following additional tasks are required. > > ```bash -> # Required only when upgrading from 2.12.2 or earlier to 2.13.0 or later -> sudo mkdir -p /data/postgres-15 -> sudo chmod 755 /data/postgres-15 +> # Required only when upgrading from 2.12.2 or earlier to 2.13.1 or later +> sudo mkdir -p /data/postgres-15/data +> sudo chmod 700 /data/postgres-15/data +> sudo chown 26:0 /data/postgres-15/data > cat < pv-postgres-15.yaml > --- > apiVersion: v1 @@ -80,7 +78,7 @@ If you are using AWX Operator `0.14.0` or later and want to upgrade to newer ver > ```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 +> sudo chmod 700 /data/postgres-13 > cat < pv-postgres-13.yaml > --- > apiVersion: v1 @@ -134,10 +132,10 @@ localhost : ok=56 changed=0 unreachable=0 failed=0 s ``` > [!NOTE] -> If your AWX Operator has upgraded from `2.12.2` or earlier to `2.13.0` or later, old PV for PostgreSQL 13 can be removed since new AWX is running with new PV for PostgreSQL 15. +> If your AWX Operator has upgraded from `2.12.2` or earlier to `2.13.1` or later, old PV for PostgreSQL 13 can be removed since new AWX is running with new PV for PostgreSQL 15. > > ```bash -> # Recommended only when upgraded from 2.12.2 or earlier to 2.13.0 or later +> # Recommended only when upgraded from 2.12.2 or earlier to 2.13.1 or later > kubectl delete pv awx-postgres-13-volume > sudo rm -rf /data/postgres-13 > ``` diff --git a/tips/version-mapping.md b/tips/version-mapping.md index 39037a9..3547ca4 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.13.1 | 24.0.0 | | 2.13.0 | 24.0.0 | | 2.12.2 | 23.9.0 | | 2.12.1 | 23.8.1 | From ae1043aa34705c74ab7727c8a0412729dcf966f0 Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Thu, 14 Mar 2024 21:58:25 +0900 Subject: [PATCH 5/8] chore: fix minor issues --- README.md | 2 +- tips/troubleshooting.md | 2 +- tips/upgrade-operator.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7161542..4ca4850 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.7+k3s1 sh -s - --write- ### Install AWX Operator > [!NOTE] -> From AWX Operator 2.13.0, Default PostgreSQL version is bumped from 13 to 15. If you have a plan to upgrade existing AWX Operator and AWX, refer to [πŸ“Tips: Upgrade AWX Operator and AWX](tips/upgrade-operator.md) to perform additional tasks to database migration. +> From AWX Operator 2.13.0, Default PostgreSQL version is bumped from 13 to 15. If you have a plan to upgrade existing AWX Operator and AWX, refer to [πŸ“Tips: Upgrade AWX Operator and AWX](tips/upgrade-operator.md) to perform additional tasks to migrate database. Clone this repository and change directory. diff --git a/tips/troubleshooting.md b/tips/troubleshooting.md index 168a887..d2769d5 100644 --- a/tips/troubleshooting.md +++ b/tips/troubleshooting.md @@ -296,7 +296,7 @@ $ kubectl -n awx logs statefulset/awx-postgres-13 mkdir: cannot create directory '/var/lib/postgresql/data': Permission denied # On PostgreSQL 15 -$ kubectl -n awx logs statefulset/awx-postgres-13 +$ kubectl -n awx logs statefulset/awx-postgres-15 mkdir: cannot create directory '/var/lib/pgsql/data/userdata': Permission denied ``` diff --git a/tips/upgrade-operator.md b/tips/upgrade-operator.md index 9727b86..135b96a 100644 --- a/tips/upgrade-operator.md +++ b/tips/upgrade-operator.md @@ -78,7 +78,7 @@ If you are using AWX Operator `0.14.0` or later and want to upgrade to newer ver > ```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 700 /data/postgres-13 +> sudo chmod 755 /data/postgres-13 > cat < pv-postgres-13.yaml > --- > apiVersion: v1 From c4f59d9fa0ca004a59834570dae0b96a80e80cc9 Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Thu, 14 Mar 2024 23:44:11 +0900 Subject: [PATCH 6/8] docs: update guide to cleanup pvs after upgrade --- tips/upgrade-operator.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tips/upgrade-operator.md b/tips/upgrade-operator.md index 135b96a..95b8e89 100644 --- a/tips/upgrade-operator.md +++ b/tips/upgrade-operator.md @@ -132,10 +132,11 @@ localhost : ok=56 changed=0 unreachable=0 failed=0 s ``` > [!NOTE] -> If your AWX Operator has upgraded from `2.12.2` or earlier to `2.13.1` or later, old PV for PostgreSQL 13 can be removed since new AWX is running with new PV for PostgreSQL 15. +> If your AWX Operator has upgraded from `2.12.2` or earlier to `2.13.1` or later, old PVC and PV for PostgreSQL 13 can be removed since new AWX is running with new PV for PostgreSQL 15. > > ```bash > # Recommended only when upgraded from 2.12.2 or earlier to 2.13.1 or later +> kubectl -n awx delete pvc postgres-13-awx-postgres-13-0 > kubectl delete pv awx-postgres-13-volume > sudo rm -rf /data/postgres-13 > ``` From 04f4ad026d11ce2d12b5caffb9df70a1d2a12afc Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Sat, 16 Mar 2024 23:58:13 +0900 Subject: [PATCH 7/8] docs: change command order --- README.md | 2 +- backup/README.md | 2 +- containergroup/README.md | 4 ++-- galaxy/README.md | 2 +- restore/README.md | 2 +- rulebooks/README.md | 2 +- tips/troubleshooting.md | 10 +++++----- tips/upgrade-operator.md | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4ca4850..7312d30 100644 --- a/README.md +++ b/README.md @@ -170,9 +170,9 @@ Prepare directories for Persistent Volumes defined in `base/pv.yaml`. These dire ```bash sudo mkdir -p /data/postgres-15/data sudo mkdir -p /data/projects -sudo chmod 700 /data/postgres-15/data sudo chown 26:0 /data/postgres-15/data sudo chown 1000:0 /data/projects +sudo chmod 700 /data/postgres-15/data ``` ### Deploy AWX diff --git a/backup/README.md b/backup/README.md index 018701f..5fc3493 100644 --- a/backup/README.md +++ b/backup/README.md @@ -23,8 +23,8 @@ Prepare directories for Persistent Volumes to store backup files that defined in ```bash sudo mkdir -p /data/backup -sudo chmod 700 /data/backup sudo chown 26:0 /data/backup +sudo chmod 700 /data/backup ``` Then deploy Persistent Volume and Persistent Volume Claim. diff --git a/containergroup/README.md b/containergroup/README.md index 597c13b..ffc1649 100644 --- a/containergroup/README.md +++ b/containergroup/README.md @@ -35,8 +35,8 @@ Prepare directories for Persistent Volumes defined in `containergroup/case1/pv.y ```bash sudo mkdir -p /data/work -sudo chmod 700 /data/work sudo chown 1000:0 /data/work +sudo chmod 700 /data/work ``` Create PV and PVC. @@ -188,8 +188,8 @@ Prepare directories for Persistent Volumes defined in `containergroup/case2/pv.y ```bash sudo mkdir -p /data/demo -sudo chmod 700 /data/demo sudo chown 1000:0 /data/demo +sudo chmod 700 /data/demo ``` Create Namespace, PV, and PVC. diff --git a/galaxy/README.md b/galaxy/README.md index 3e2e313..f3ff66d 100644 --- a/galaxy/README.md +++ b/galaxy/README.md @@ -123,8 +123,8 @@ Prepare directories for Persistent Volumes defined in `galaxy/galaxy/pv.yaml`. sudo mkdir -p /data/galaxy/postgres-13 sudo mkdir -p /data/galaxy/redis sudo mkdir -p /data/galaxy/file -sudo chmod 700 /data/galaxy/postgres-13 sudo chown 1000:0 /data/galaxy/file +sudo chmod 700 /data/galaxy/postgres-13 ``` ### Deploy Galaxy NG diff --git a/restore/README.md b/restore/README.md index 67fa9fa..bc6bd4e 100644 --- a/restore/README.md +++ b/restore/README.md @@ -41,9 +41,9 @@ Then prepare directories for your PVs. `/data/projects` is required if you are r ```bash sudo mkdir -p /data/postgres-15/data sudo mkdir -p /data/projects -sudo chmod 700 /data/postgres-15/data sudo chown 26:0 /data/postgres-15/data sudo chown 1000:0 /data/projects +sudo chmod 700 /data/postgres-15/data ``` Then deploy PV and PVC. It is recommended that making the size of PVs and PVCs same as the PVs which your AWX used when the backup was taken. diff --git a/rulebooks/README.md b/rulebooks/README.md index 21c0b21..95546f3 100644 --- a/rulebooks/README.md +++ b/rulebooks/README.md @@ -117,8 +117,8 @@ Prepare directories for Persistent Volumes defined in `base/pv.yaml`. This direc ```bash sudo mkdir -p /data/eda/postgres-13/data -sudo chmod 700 /data/eda/postgres-13/data sudo chown 26:0 /data/eda/postgres-13/data +sudo chmod 700 /data/eda/postgres-13/data ``` ### Deploy EDA Server diff --git a/tips/troubleshooting.md b/tips/troubleshooting.md index d2769d5..491da92 100644 --- a/tips/troubleshooting.md +++ b/tips/troubleshooting.md @@ -310,18 +310,18 @@ drwxr-xr-x. 2 root root 18 Aug 20 10:09 /data/postgres-13 drwxr-xr-x. 3 root root 20 Aug 20 10:09 /data/postgres-13/data ``` -In my environment, `755` and `root:root` (`0:0`) works correctly. So you can try following commands. +For example, `755` and `root:root` (`0:0`) should work. So you can try following commands. ```bash -sudo chmod 755 /data/postgres-13 /data/postgres-13/data sudo chown 0:0 /data/postgres-13 /data/postgres-13/data +sudo chmod 755 /data/postgres-13 /data/postgres-13/data ``` Or, you can also try `999:0` as owner/group for the directory. `999` is [the UID of the `postgres` user which used in the container](https://github.com/docker-library/postgres/blob/master/13/bullseye/Dockerfile#L13). ```bash -sudo chmod 755 /data/postgres-13 /data/postgres-13/data sudo chown 999:0 /data/postgres-13 /data/postgres-13/data +sudo chmod 755 /data/postgres-13 /data/postgres-13/data ``` For the PostgreSQL 15 that deployed by **AWX Operator 2.13.0 or later**, if you followed my guide, it would be `/data/postgres-15`. There is additional `data` directory created by K3s under `/data/postgres-15`. @@ -332,11 +332,11 @@ drwxr-xr-x. 2 root root 18 Aug 20 10:09 /data/postgres-15 drwxr-xr-x. 3 26 root 20 Aug 20 10:09 /data/postgres-15/data ``` -In my environment, `700` and `26:0` works correctly. So you can try following commands. `26` is [the UID of the user which used in the container](https://github.com/sclorg/postgresql-container/blob/master/15/Dockerfile.c9s#L86). +For example, `700` and `26:0` should work. So you can try following commands. `26` is [the UID of the user which used in the container](https://github.com/sclorg/postgresql-container/blob/master/15/Dockerfile.c9s#L86). ```bash -sudo chmod 700 /data/postgres-15 /data/postgres-15/data sudo chown 26:0 /data/postgres-15 /data/postgres-15/data +sudo chmod 700 /data/postgres-15 /data/postgres-15/data ``` ## Troubles during Daily Use diff --git a/tips/upgrade-operator.md b/tips/upgrade-operator.md index 95b8e89..735f3fb 100644 --- a/tips/upgrade-operator.md +++ b/tips/upgrade-operator.md @@ -39,8 +39,8 @@ If you are using AWX Operator `0.14.0` or later and want to upgrade to newer ver > ```bash > # Required only when upgrading from 2.12.2 or earlier to 2.13.1 or later > sudo mkdir -p /data/postgres-15/data -> sudo chmod 700 /data/postgres-15/data > sudo chown 26:0 /data/postgres-15/data +> sudo chmod 700 /data/postgres-15/data > cat < pv-postgres-15.yaml > --- > apiVersion: v1 From 2126e6c7e12b321bd5162f046bee4efcabf664c3 Mon Sep 17 00:00:00 2001 From: kurokobo <2920259+kurokobo@users.noreply.github.com> Date: Sun, 17 Mar 2024 00:39:10 +0900 Subject: [PATCH 8/8] docs: add note for 2.13.x --- README.md | 6 ++++-- tips/upgrade-operator.md | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7312d30..e0d97ea 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,10 @@ curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.7+k3s1 sh -s - --write- ### Install AWX Operator -> [!NOTE] -> From AWX Operator 2.13.0, Default PostgreSQL version is bumped from 13 to 15. If you have a plan to upgrade existing AWX Operator and AWX, refer to [πŸ“Tips: Upgrade AWX Operator and AWX](tips/upgrade-operator.md) to perform additional tasks to migrate database. +> [!WARNING] +> AWX Operator 2.13.x introduces some major changes and some issues related to these changes are reported. If you don't have any strong reason to use 2.13.x, personally I recommend to use [2.12.1](https://github.com/kurokobo/awx-on-k3s/tree/2.12.1) instead until major issues are resolved. +> +> If you have a plan to upgrade existing AWX Operator and AWX from 2.12.x or earlier to 2.13.x anyway, some additional tasks are required. Refer to [πŸ“Tips: Upgrade AWX Operator and AWX](tips/upgrade-operator.md) to further information. Also do not forget creating backup before upgrading. Clone this repository and change directory. diff --git a/tips/upgrade-operator.md b/tips/upgrade-operator.md index 735f3fb..c329511 100644 --- a/tips/upgrade-operator.md +++ b/tips/upgrade-operator.md @@ -11,6 +11,11 @@ Note that once you upgrade AWX Operator, your AWX will also be upgraded automati [There is `image_version` parameter for AWX resource to change which image will be used](https://ansible.readthedocs.io/projects/awx-operator/en/latest/user-guide/advanced-configuration/deploying-a-specific-version-of-awx.html), but it appears that using a version of AWX other than the one bundled with the AWX Operator [is currently not supported](https://ansible.readthedocs.io/projects/awx-operator/en/latest/user-guide/advanced-configuration/deploying-a-specific-version-of-awx.html). Conversely, if you want to upgrade AWX, you need to plan to upgrade AWX Operator first. +> [!WARNING] +> AWX Operator 2.13.x introduces some major changes and some issues related to these changes are reported. If you don't have any strong reason to use 2.13.x, personally I recommend to use [2.12.1](https://github.com/kurokobo/awx-on-k3s/tree/2.12.1) instead until major issues are resolved. +> +> If you have a plan to upgrade existing AWX Operator and AWX from 2.12.x or earlier to 2.13.x anyway, some additional tasks are required. Refer to [the notes below](#-upgrade-from-0140-or-later-eg-from-0140-to-0150). + ## Table of Contents