Update minikube docs

Replace reference to a non-existent playbook with current directions from awx-operator
Also add some tips about how to interact with the deployment
This commit is contained in:
Elijah DeLee 2022-01-27 08:16:49 -05:00
parent b678d61318
commit 598c8a1c4d

View File

@ -35,10 +35,15 @@ For the following playbooks to work, you will need to:
$ pip install openshift
```
If you are not changing any code in the operator itself, simply run:
If you are not changing any code in the operator itself, git checkout the latest version from https://github.com/ansible/awx-operator/releases, and then run the following command (from the awx-operator repo):
```
$ ansible-playbook ansible/deploy-operator.yml
$ alias kubectl="minikube kubectl --"
$ export NAMESPACE=my-namespace
$ kubectl create namespace $NAMESPACE
$ kubectl config set-context --current --namespace=$NAMESPACE
$ make deploy
```
If making changes to the operator itself, run the following command in the root
@ -70,8 +75,23 @@ $ ansible-playbook ansible/instantiate-awx-deployment.yml \
-e image_version=devel \
-e image_pull_policy=Always \
-e service_type=nodeport \
-e namespace=default
-e namespace=$NAMESPACE
```
Check the operator with the following commands:
```
# Check the operator deployment
$ kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
awx 1/1 1 1 16h
awx-operator-controller-manager 1/1 1 1 16h
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
awx-operator-controller-manager-b775bfc7c-fn995 2/2 Running 0 16h
```
If there are errors in the image pull, check that it is using the right tag. You can update the tag that it will pull by editing the deployment.
### Custom AWX Development Image for Kubernetes
@ -102,6 +122,39 @@ the AWX Pod. A new Pod will respawn with the latest revision.
## Accessing AWX
To access via the web browser, run the following command:
```
$ minikube service awx-service --url
```
To retreive your admin password
```
$ kubectl get secrets awx-admin-password -o json | jq '.data.password' | xargs | base64 -d
```
To tail logs from the containers
```
# Find the awx pod name
kubectl get pods
NAME READY STATUS RESTARTS AGE
awx-56fbfbb6c8-jkhzl 4/4 Running 0 13h
awx-operator-controller-manager-b775bfc7c-fn995 2/2 Running 0 16h
awx-postgres-0 1/1 Running 0 16h
# now you know the pod name, tail logs from task container in pod
kubectl logs -f awx-56fbfbb6c8-jkhzl -n awx -c awx-task
# alternatively, or in a different window tail logs from the web container in pod
kubectl logs -f awx-56fbfbb6c8-jkhzl -n awx -c awx-web
```
To exec in to the container:
```
# Using same pod name we found above from "kubectl get pods"
$ kubectl exec -it awx-56fbfbb6c8-k6p82 -c awx-task bash
```
The application will live reload when files are edited just like in the development environment. Just like in the development environment, if the application totally crashes because files are invalid syntax or other fatal problem, you will get an error like "no python application" in the web container. Delete the whole control plane pod and wait until a new one spins up automatically.
```
$ kubectl delete pod awx-56fbfbb6c8-k6p82
```