Skip to content

Instantly share code, notes, and snippets.

@UbuntuEvangelist
Forked from dmccuk/install_awx_operator.md
Created August 19, 2021 07:47
Show Gist options
  • Save UbuntuEvangelist/cba352a9822dc52f771e643e889e6b62 to your computer and use it in GitHub Desktop.
Save UbuntuEvangelist/cba352a9822dc52f771e643e889e6b62 to your computer and use it in GitHub Desktop.
Install AWX-operator on Ubuntu 20 using Minikube
I’ve had a few requests for this demo as It seems like a lot of people are having issues setting up the new version of AWX. Before v18, (v17) you could simply install AWX on a server with enough resources. Now, the preferred way to install AWX is via the AWX-operator. So you need a Kubernetes or OpenShift cluster. For this demo, I’m using Minikube.
(if you get any errors, check the bottom of this page for the fix)
I’m using minikube because it’s a single node cluster and it keeps the price down. I did try this on a t2.medium, but there just weren’t enough resources to get it working.
This demo will cover the following:
• Install and setup kubectl and docker.
• Installing and setting up Minikube in EC2 [t3a.xlarge – 4 x cpu / 16gb memory]
o ami-0194c3e07668a7e36
o You might be able to get away with less resources)
• Setup the AWX-operator (latest version – 0.10.0) and deploy.
• Get the AWX admin password.
• Forward the service port so we can access it from the internet and use minikube tunnel.
• Login to AWX and take a quick tour.
• All commands will be added into the description.
Links:
https://github.com/ansible/awx-operator
https://github.com/ansible/awx-operator/tags
If you like the demo, hit subscribe for more videos like this and give it a like.
COMMANDS:
--setup the repo's:
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version --client
sudo apt-get update -y && sudo apt-get install -y docker.io
-- install minikube:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
sudo usermod -aG docker $USER
LOGOUT & BACK IN AGAIN
groups $USER
-- minikube start
minikube start --addons=ingress --cpus=2 --install-addons=true --kubernetes-version=stable --memory=6g
-- Check its working:
kubectl get nodes
kubectl get pods
kubectl get pods -A
-- INstall the AWX Operator:
kubectl apply -f https://raw.githubusercontent.com/ansible/awx-operator/0.10.0/deploy/awx-operator.yaml
kubectl get pods
-- Create the deployment file:
vi awx-demo.yml
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx-demo
spec:
service_type: nodeport
ingress_type: none
hostname: awx-demo.example.com
Run the deployment:
kubectl apply -f awx-demo.yml
kubectl get pods -l "app.kubernetes.io/managed-by=awx-operator"
kubectl get svc -l "app.kubernetes.io/managed-by=awx-operator"
WAIT A FEW MINS...
Get the Admin user password:
kubectl get secrets
kubectl get secret awx-demo-admin-password -o jsonpath="{.data.password}" | base64 --decode
Expose the deployment:
kubectl expose deployment awx-demo --type=LoadBalancer --port=8080
Enable AWX to be access via the Internet:
kubectl port-forward svc/awx-demo-service --address 0.0.0.0 30886:80
Now visit https://your_ip:high_port
** You may need to update your FW rules to be able to connect to the AWX login screen **
** ISSUES **
1) Starting minikube tunnel - Exiting due to GUEST_STATUS: state: unknown state "minikube": docker container inspect minikube --format=: exit status 1
ANS: sudo chmod 666 /var/run/docker.sock ; sudo usermod -aG docker ${USER}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment