Upgrading AWX is made very simple when using the operator since it just requires changing the version of the deployment.
I'll be using a awx-deployment in okd-4.13 using the awx operator installed using these yaml files:
$ cat 0-awx-namespace.yml
---
apiVersion: v1
kind: Namespace
metadata:
name: awx
...
$ cat 1-awx-operatorgroup.yml
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: awx-operatorgroup
namespace: awx
spec:
upgradeStrategy: Default
targetNamespaces:
- awx
...
$ cat 2-awx-subscription.yml
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: awx-operator
namespace: awx
spec:
channel: alpha
installPlanApproval: Automatic
name: awx-operator
source: community-operators
sourceNamespace: openshift-marketplace
startingCSV: awx-operator.v2.5.3
...
$ cat 4-awx-deployment.yml
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx
spec:
admin_user: root
admin_email: admins@archyslife.lan
admin_password_secret: awx-admin-password
image: quay.io/ansible/awx
image_version: 23.0.0
service_type: clusterip
ingress_type: Route
route_host: awx.apps.okd.archyslife.lan
...
I'm skipping the yaml file for the secret since it's not necessary for the upgrade.
Now for the actual upgrade, adjust the 'spec.image_version' to the latest version, for me it's '23.1.0':
$ sed -i 's/23.0.0/23.1.0/g' 4-awx-deployment.yml
Now apply the deployment:
$ oc -n awx apply -f 4-awx-deployment.yml
You can watch the upgrade proceed by running:
$ oc -n awx get pods -o wide -w
The upgrade took about 5 minutes for me but it heavily depends on your available infrastructure.
Feel free to comment and / or suggest a topic.
Comments
Post a Comment