Skip to content

Instantly share code, notes, and snippets.

@b0bu
Last active April 28, 2021 11:22
Show Gist options
  • Save b0bu/e1f62bfb929c122eb83cd53dc71053c0 to your computer and use it in GitHub Desktop.
Save b0bu/e1f62bfb929c122eb83cd53dc71053c0 to your computer and use it in GitHub Desktop.
build and test awx-operator (macos)

Working as of 18.0.0 and 19.0.0.

get code

gh repo clone ansible/awx-operator

set env, ensure pyenv and pyenv-virtualenvs are installed

pyenv virtualenv awx-operator
pyenv activate awx-operator
pip install -r requirements.txt

enable hyperkit for --vm=true (better isolation)

sudo chown root:wheel /Users/<user>/.minikube/bin/docker-machine-driver-hyperkit
minikube delete

start k8s and enable ingress. This will change your kubectl context to the new minikube instance.

minikube start --memory 2g --cpus 2 --vm=true --kubernetes-version=v1.19.4
minikube addons enable ingress

Edit source code then build operator you're wanting to build.

Run test suite, you can check them out with yq. This will build an operator from source and leave it running in your minikube instance.

cat molecule/test-minikube/converge.yml | yq r -C - # version ~= 3.x.x
cat molecule/test-minikube/converge.yml | yq e '.somepath' - # version ~= 4.x.x
molecule test -s test-minikube

once awx-operator is built you can deploy the awx.yaml to minikube.

kubectl apply -f awx.yaml

task container has psql installed on it for testing connections to db.

kubectl logs awx-<uid> -f -c awx-task

get ingress entrypoint

minikube service awx-service -n default --url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment