Update Containers/Kubernetes/Rancher RKE2/AWX Operator/Ansible Operator.md

This commit is contained in:
Nicole Rappe
2024-01-19 23:33:02 -07:00
parent d9bfad4019
commit 8e45e40ceb

View File

@ -2,30 +2,31 @@
Deploying a Rancher RKE2 Cluster-based Ansible AWX Operator server. This can scale to a larger more enterprise environment if needed. Deploying a Rancher RKE2 Cluster-based Ansible AWX Operator server. This can scale to a larger more enterprise environment if needed.
!!! note Prerequisites !!! note Prerequisites
This document assumes you are running **Ubuntu Server 20.04** or later with at least 8GB of memory and 4 CPU cores. This document assumes you are running **Ubuntu Server 20.04** or later with at least 8GB of memory, 4 CPU cores, and 64GB of storage.
![Ansible AWX WebUI](awx.png) ![Ansible AWX WebUI](awx.png)
## Deploy Rancher RKE2 Cluster ## Deploy Rancher RKE2 Cluster
You will need to deploy a [Rancher RKE2 Cluster](https://docs.bunny-lab.io/Containers/Kubernetes/Rancher%20RKE2/Rancher%20RKE2%20Cluster/) on an Ubuntu Server-based virtual machine. After this phase, you can focus on the Ansible AWX-specific deployment. A single ControlPlane node is all you need to set up AWX, additional infrastructure can be added after-the-fact. You will need to deploy a [Rancher RKE2 Cluster](https://docs.bunny-lab.io/Containers/Kubernetes/Rancher%20RKE2/Rancher%20RKE2%20Cluster/) on an Ubuntu Server-based virtual machine. After this phase, you can focus on the Ansible AWX-specific deployment. A single ControlPlane node is all you need to set up AWX, additional infrastructure can be added after-the-fact.
:::tip
If this is a virtual machine, after deploying the RKE2 cluster and validating it functions, now would be the best time to take a checkpoint / snapshot of the VM before moving forward, in case you need to perform rollbacks of the server(s) if you accidentally misconfigure something. !!! tip
::: If this is a virtual machine, after deploying the RKE2 cluster and validating it functions, now would be the best time to take a checkpoint / snapshot of the VM before moving forward, in case you need to perform rollbacks of the server(s) if you accidentally misconfigure something during deployment.
## Server Configuration ## Server Configuration
The AWX deployment will consist of 3 yaml files that configure the containers for AWX as well as the NGINX ingress networking-side of things. You will need all of them in the same folder for the deployment to be successful. For the purpose of this example, we will put all of them into a folder located at `/awx`. The AWX deployment will consist of 3 yaml files that configure the containers for AWX as well as the NGINX ingress networking-side of things. You will need all of them in the same folder for the deployment to be successful. For the purpose of this example, we will put all of them into a folder located at `/awx`.
### Make the deployment folder
``` ``` sh
# Make the deployment folder
mkdir -p /awx mkdir -p /awx
cd /awx cd /awx
```
### Run a command to adjust open file limits in Ubuntu Server (just-in-case) # Run a command to adjust open file limits in Ubuntu Server (just-in-case)
```
ulimit -n 4096 ulimit -n 4096
``` ```
### Create the AWX deployment configuration files ### Create the AWX deployment configuration files
You will need to create these files all in the same directory using the content of the examples below. Be sure to replace values such as the `spec.host=ansible.cyberstrawberry.net` in the `awx-ingress.yml` file to a hostname you can point a DNS server / record to. You will need to create these files all in the same directory using the content of the examples below. Be sure to replace values such as the `spec.host=awx.bunny-lab.io` in the `awx-ingress.yml` file to a hostname you can point a DNS server / record to.
```jsx title="nano /awx/kustomization.yml" ``` yaml jsx title="/awx/kustomization.yml"
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
@ -37,7 +38,7 @@ images:
newTag: 2.4.0 newTag: 2.4.0
namespace: awx namespace: awx
``` ```
```jsx title="nano /awx/awx.yml" ```yaml jsx title="/awx/awx.yml"
apiVersion: awx.ansible.com/v1beta1 apiVersion: awx.ansible.com/v1beta1
kind: AWX kind: AWX
metadata: metadata:
@ -45,14 +46,14 @@ metadata:
spec: spec:
service_type: ClusterIP service_type: ClusterIP
``` ```
```jsx title="nano /awx/awx-ingress.yml" ``` yaml jsx title="/awx/awx-ingress.yml"
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: awx-ingress name: awx-ingress
spec: spec:
rules: rules:
- host: ansible.cyberstrawberry.net - host: awx.bunny-lab.io
http: http:
paths: paths:
- pathType: Prefix - pathType: Prefix
@ -63,6 +64,7 @@ spec:
port: port:
number: 80 number: 80
``` ```
## Deploy AWX using Kustomize ## Deploy AWX using Kustomize
Now it is time to tell Rancher / Kubernetes to read the configuration files using Kustomize (built-in to newer versions of Kubernetes) to deploy AWX into the cluster. Be sure that you are still in the `/awx` folder before running this command. **Be Patient: ** The AWX deployment process can take a while. Go grab a cup of coffee and use the commands in the [Troubleshooting](https://docs.cyberstrawberry.net/Container%20Documentation/Kubernetes/Rancher%20RKE2/RKE2%20Ansible%20AWX#troubleshooting) Now it is time to tell Rancher / Kubernetes to read the configuration files using Kustomize (built-in to newer versions of Kubernetes) to deploy AWX into the cluster. Be sure that you are still in the `/awx` folder before running this command. **Be Patient: ** The AWX deployment process can take a while. Go grab a cup of coffee and use the commands in the [Troubleshooting](https://docs.cyberstrawberry.net/Container%20Documentation/Kubernetes/Rancher%20RKE2/RKE2%20Ansible%20AWX#troubleshooting)
section if you want to track the progress more directly. section if you want to track the progress more directly.