CRIB SHEET: Installing Ansible AWX with Kubernetes On Ubuntu 20.04.
As of writing (September 2023) this is the quickest and lightest way I've found of installing Ansible AWX on a fresh Ubuntu 20.04 build. This build 2.5.3 supports Execution Environments. It is assumed that the reader has basic knowledge of Kubernetes and this article is written as Crib Notes only, mainly as I have a memory like a Sieve.
sudo apt update && sudo apt upgrade -y
sudo apt install git
curl -sfL https://get.k3s.io | sh -
sudo chown user:group /etc/rancher/k3s/k3s.yaml
kubectl version
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
sudo mv kustomize /usr/local/bin
Create Kustomization.yaml definition file can be found at this link https://github.com/ansible/awx-operator/blob/devel/docs/installation/basic-install.md
Replace <tag> with latest version (currently 2.5.3)
领英推荐
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# Find the latest tag here: https://github.com/ansible/awx-operator/releases
- github.com/ansible/awx-operator/config/default?ref=<tag>
# Set the image tags to match the git version from above
images:
- name: quay.io/ansible/awx-operator
newTag: <tag>
# Specify a custom namespace in which to install AWX
namespace: awx
kustomize build .| kubectl apply -f-
kubectl get pods --namespace awx
Create awx.yaml file.
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx
spec:
service_type: nodeport
nodeport_port: 30080
Edit kustomize.yaml file and add the line
- awx.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# Find the latest tag here: https://github.com/ansible/awx-operator/releases
- github.com/ansible/awx-operator/config/default?ref=<tag>
- awx.yaml
# Set the image tags to match the git version from above
images:
- name: quay.io/ansible/awx-operator
newTag: <tag>
# Specify a custom namespace in which to install AWX
namespace: awx
Build
kustomize build .| kubectl apply -f-
wait till all containers are up in
kubectl get pods --namespace awx
When all containers are up (after a few minutes) grab the admin password
kubectl get secret --namespace awx awx-demo-admin-password -o jsonpath="{.data.password}" | base64 --decode ; echo
The password should now be displayed. Copy it and browse to your Ubuntu machines IP address on port 30080 in your web browser.
https://x.x.x.x:30080
Now login to AWX as admin and the password you've just copied.
Network Engineer
5 个月Awesome - kick the tyres on it by running it on kind as well great for prototyping https://kind.sigs.k8s.io/
Thank you, great job!