Update Kind Docs (#12865)

* update kind docs formatting and update some commands

* add tested on fedora update
This commit is contained in:
Jake Jackson
2022-09-12 13:04:04 -04:00
committed by GitHub
parent f0c125efb3
commit 484db004db

View File

@@ -1,7 +1,7 @@
# Running Development Environment in Kubernetes using Kind Cluster # Running Development Environment in Kubernetes using Kind Cluster
## Start Kind Cluster ## Start Kind Cluster
Note: This environment has only been tested on MacOS with Docker. Note: This environment has been tested on MacOS and Fedora with Docker.
If you do not already have Kind, install it from: If you do not already have Kind, install it from:
https://kind.sigs.k8s.io/docs/user/quick-start/ https://kind.sigs.k8s.io/docs/user/quick-start/
@@ -21,13 +21,13 @@ nodes:
``` ```
Start Kind cluster Start Kind cluster
``` ```bash
$ kind create cluster --config kind-cluster.yaml kind create cluster --config kind-cluster.yaml
``` ```
Verify AWX source tree is mounted in the kind-control-plane container Verify AWX source tree is mounted in the kind-control-plane container
``` ```bash
$ docker exec -it kind-control-plane ls /awx_devel docker exec -it kind-control-plane ls /awx_devel
``` ```
## Deploy the AWX Operator ## Deploy the AWX Operator
@@ -36,8 +36,8 @@ Clone the [awx-operator](https://github.com/ansible/awx-operator).
For the following playbooks to work, you will need to: For the following playbooks to work, you will need to:
``` ```bash
$ pip install openshift pip install openshift
``` ```
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 follow the instructions in the awx-operator [README](https://github.com/ansible/awx-operator#basic-install). 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 follow the instructions in the awx-operator [README](https://github.com/ansible/awx-operator#basic-install).
@@ -47,15 +47,15 @@ of the awx-operator repo. If not, continue to the next section.
### Building and Deploying a Custom AWX Operator Image ### Building and Deploying a Custom AWX Operator Image
``` ```bash
# in awx-operator repo on the branch you want to use # in awx-operator repo on the branch you want to use
$ export IMAGE_TAG_BASE=quay.io/<username>/awx-operator export IMAGE_TAG_BASE=quay.io/<username>/awx-operator
$ make docker-build docker-push deploy make docker-build docker-push deploy
``` ```
Check the operator deployment Check the operator deployment
``` ```bash
$ kubectl get deployments kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE NAME READY UP-TO-DATE AVAILABLE AGE
awx-operator-controller-manager 1/1 1 1 16h awx-operator-controller-manager 1/1 1 1 16h
``` ```
@@ -68,8 +68,8 @@ command. If you need to test out changes to the Dockerfile, see the
In the root of awx-operator: In the root of awx-operator:
``` ```bash
$ ansible-playbook ansible/instantiate-awx-deployment.yml \ ansible-playbook ansible/instantiate-awx-deployment.yml \
-e development_mode=yes \ -e development_mode=yes \
-e image=ghcr.io/ansible/awx_kube_devel \ -e image=ghcr.io/ansible/awx_kube_devel \
-e image_version=devel \ -e image_version=devel \
@@ -79,14 +79,14 @@ $ ansible-playbook ansible/instantiate-awx-deployment.yml \
``` ```
Check the operator with the following commands: Check the operator with the following commands:
``` ```bash
# Check the operator deployment # Check the operator deployment
$ kubectl get deployments kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE NAME READY UP-TO-DATE AVAILABLE AGE
awx 1/1 1 1 16h awx 1/1 1 1 16h
awx-operator-controller-manager 1/1 1 1 16h awx-operator-controller-manager 1/1 1 1 16h
$ kubectl get pods kubectl get pods
NAME READY STATUS RESTARTS AGE NAME READY STATUS RESTARTS AGE
awx-operator-controller-manager-b775bfc7c-fn995 2/2 Running 0 16h awx-operator-controller-manager-b775bfc7c-fn995 2/2 Running 0 16h
``` ```
@@ -95,20 +95,25 @@ If there are errors in the image pull, check that it is using the right tag. You
### Custom AWX Development Image for Kubernetes ### Custom AWX Development Image for Kubernetes
Set these environmental variables before starting:
```bash
export DEV_DOCKER_TAG_BASE=quay.io/<USERNAME>
export COMPOSE_TAG=<IMAGE_TAG>
```
In the root of the AWX repo: In the root of the AWX repo:
``` ```bash
$ make awx-kube-dev-build make awx-kube-dev-build
$ docker push ghcr.io/ansible/awx_kube_devel:${COMPOSE_TAG} docker push $DEV_DOCKER_TAG_BASE/awx_kube_devel:$COMPOSE_TAG
``` ```
In the root of awx-operator: In the root of awx-operator:
``` ```bash
$ ansible-playbook ansible/instantiate-awx-deployment.yml \ ansible-playbook ansible/instantiate-awx-deployment.yml \
-e development_mode=yes \ -e development_mode=yes \
-e image=ghcr.io/ansible/awx_kube_devel \ -e image=$DEV_DOCKER_TAG_BASE/awx_kube_devel \
-e image_version=${COMPOSE_TAG} \ -e image_version=$COMPOSE_TAG \
-e image_pull_policy=Always \ -e image_pull_policy=Always \
-e service_type=nodeport \ -e service_type=nodeport \
-e namespace=$NAMESPACE -e namespace=$NAMESPACE
@@ -125,28 +130,28 @@ http://localhost:30080
``` ```
To retrieve your admin password To retrieve your admin password
``` ```bash
$ kubectl get secrets awx-admin-password -o json | jq '.data.password' | xargs | base64 -d kubectl get secrets awx-admin-password -o json | jq '.data.password' | xargs | base64 -d
``` ```
To tail logs from the task containers To tail logs from the task containers
``` ```bash
$ kubectl logs -f deployment/awx -n awx -c awx-web kubectl logs -f deployment/awx -n awx -c awx-web
``` ```
To tail logs from the web containers To tail logs from the web containers
``` ```bash
$ kubectl logs -f deployment/awx -n awx -c awx-web kubectl logs -f deployment/awx -n awx -c awx-web
``` ```
NOTE: If there's multiple replica of the awx deployment you can use `stern` to tail logs from all replicas. For more information about `stern` check out https://github.com/wercker/stern. NOTE: If there's multiple replica of the awx deployment you can use `stern` to tail logs from all replicas. For more information about `stern` check out https://github.com/wercker/stern.
To exec in to the a instance of the awx-task container: To exec in to the a instance of the awx-task container:
``` ```bash
$ kubectl exec -it deployment/awx -c awx-task bash kubectl exec -it deployment/awx -n awx -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. 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.
``` ```bash
oc delete pod -l app.kubernetes.io/component=awx oc delete pod -l app.kubernetes.io/component=awx
``` ```