Incorporates Minikube to devel environment

This commit is contained in:
Marcelo Moreira de Mello
2021-07-13 00:36:19 -04:00
parent 0e75193e3d
commit f6a71e770d
12 changed files with 241 additions and 5 deletions

View File

@@ -213,3 +213,24 @@ Certain features or bugs are only applicable when running a cluster of AWX nodes
`CLUSTER_NODE_COUNT` is configurable and defaults to 1, effectively a non-clustered AWX.
Note that you may see multiple messages of the form `2021-03-04 20:11:47,666 WARNING [-] awx.main.wsbroadcast Connection from awx_2 to awx_5 failed: 'Cannot connect to host awx_5:8013 ssl:False [Name or service not known]'.`. This can happen when you bring up a cluster of many nodes, say 10, then you bring up a cluster of less nodes, say 3. In this example, there will be 7 `Instance` records in the database that represent AWX instances. The AWX development environment mimics the VM deployment (vs. kubernetes) and expects the missing nodes to be brought back to healthy by the admin. The warning message you are seeing is all of the AWX nodes trying to connect the websocket backplane. You can manually delete the `Instance` records from the database i.e. `Instance.objects.get(hostname='awx_9').delete()` to stop the warnings.
### Start with Minikube
To bring up a 1 node AWX + minikube that is accessible from AWX run the following.
```bash
(host)$ make docker-compose-container-group
```
Alternatively, you can set the env var `MINIKUBE_CONTAINER_GROUP=true` to use the default dev env bring up. his way you can use other env flags like the cluster node count.
```bash
(host)$ MINIKUBE_CONTAINER_GROUP=true make docker-compose
```
If you want to clean all things once your are done, you can do:
```bash
(host)$ make docker-compose-container-group-clean
```

View File

@@ -6,3 +6,4 @@ pg_port: 5432
pg_username: 'awx'
pg_database: 'awx'
cluster_node_count: 1
minikube_container_group: false

View File

@@ -20,6 +20,9 @@ services:
RECEPTORCTL_SOCKET: /var/run/receptor/receptor.sock
{% if loop.index == 1 %}
RUN_MIGRATIONS: 1
{% endif %}
{% if minikube_container_group|bool %}
MINIKUBE_CONTAINER_GROUP: "true"
{% endif %}
links:
- postgres
@@ -47,6 +50,7 @@ services:
- "8888:8888" # jupyter notebook
- "8013:8013" # http
- "8043:8043" # https
- "2222:2222" # receptor foo node
{% endif %}
redis_{{ container_postfix }}:
image: redis:latest
@@ -98,3 +102,9 @@ volumes:
redis_socket_{{ container_postfix }}:
name: tools_redis_socket_{{ container_postfix }}
{% endfor -%}
{% if minikube_container_group|bool %}
networks:
default:
external:
name: minikube
{% endif %}

View File

@@ -34,3 +34,8 @@ awx-manage register_default_execution_environments
mkdir -p /awx_devel/awx/public/static
mkdir -p /awx_devel/awx/ui/static
mkdir -p /awx_devel/awx/ui_next/build/static
# Create resource entries when using Minikube
if [[ -n "$MINIKUBE_CONTAINER_GROUP" ]]; then
awx-manage shell_plus --quiet < /awx_devel/tools/docker-compose-minikube/_sources/bootstrap_minikube.py
fi

View File

@@ -1,12 +1,16 @@
---
- log-level: info
- node:
id: foo
- log-level: debug
- tcp-listener:
port: 2222
- control-service:
service: control
filename: /var/run/receptor/receptor.sock
- local-only:
- work-command:
worktype: local
command: ansible-runner