[#769] stub k8s/awx — split to KNEL/k8s + KNEL/awx

https://projects.knownelement.com/issues/769
This commit is contained in:
2026-09-05 05:20:08 -05:00
parent 9649b43b67
commit 080f5c9291
20 changed files with 8 additions and 1154 deletions
+4 -9
View File
@@ -1,10 +1,5 @@
# awx/README.md
# awx — SPLIT OUT
> **Documentation moved to Discourse — the canonical source of truth.**
>
> **Ansible AWX deployment on k3s**
>
> **Read it here:** https://community.turnsys.com/t/302
>
> *Migrated 2026-08-06. This file is kept as a pointer for git-browsing context.
> Do not update content here — edit the Discourse wiki topic instead.*
AWX control plane body of work moved to [KNEL/awx](https://git.knownelement.com/KNEL/awx)
on 2026-09-05 (split ticket [#769](https://projects.knownelement.com/issues/769),
bootstrap ticket [#707](https://projects.knownelement.com/issues/707)).
-46
View File
@@ -1,46 +0,0 @@
---
# AWX namespace
apiVersion: v1
kind: Namespace
metadata:
name: awx
---
# Admin password secret — the password is 'REDACTED_PASSWORD' (fleet standard)
apiVersion: v1
kind: Secret
metadata:
name: awx-admin-password
namespace: awx
type: Opaque
stringData:
password: REDACTED_PASSWORD
---
# AWX Custom Resource — single instance, LoadBalancer service
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: tsys-awx
namespace: awx
spec:
service_type: LoadBalancer
ingress_type: none
admin_user: admin
admin_password_secret: awx-admin-password
# PostgreSQL — bundled, stored on local disk via PVC (k3s local-path)
postgres_storage_class: local-path
postgres_storage_requirements:
requests:
storage: 8Gi
postgres_resource_requirements:
requests:
memory: 1Gi
# Resource limits — fit within 12 GB host RAM
web_resource_requirements:
requests:
memory: 1Gi
task_resource_requirements:
requests:
memory: 1Gi
-85
View File
@@ -1,85 +0,0 @@
#!/usr/bin/env bash
###############################################################################
# deploy-awx.sh — Deploy AWX Operator + instance on k3s.
#
# Prerequisites: k3s must be installed and running (install-k3s.sh).
# Intended to run ON the target VM (tsys-awx.knel.net) as root or via sudo.
#
# Usage: sudo bash deploy-awx.sh
###############################################################################
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export KUBECONFIG="${KUBECONFIG:-/etc/rancher/k3s/k3s.yaml}"
OPERATOR_VERSION="${OPERATOR_VERSION:-2.19.1}"
echo "=========================================================="
echo " AWX Operator deployment — version ${OPERATOR_VERSION}"
echo "=========================================================="
# ---------------------------------------------------------------------------
# Step 1: Create namespace
# ---------------------------------------------------------------------------
echo ""
echo "=== Step 1: Create namespace ==="
kubectl apply -f "${SCRIPT_DIR}/namespace.yaml"
# ---------------------------------------------------------------------------
# Step 2: Deploy AWX Operator
# ---------------------------------------------------------------------------
echo ""
echo "=== Step 2: Deploy AWX Operator ${OPERATOR_VERSION} ==="
# Clone the operator to get kustomize manifests
OPERATOR_DIR="/tmp/awx-operator-${OPERATOR_VERSION}"
rm -rf "${OPERATOR_DIR}"
git clone --branch "${OPERATOR_VERSION}" --depth 1 \
"https://github.com/ansible/awx-operator.git" "${OPERATOR_DIR}" 2>&1 | tail -3
# The operator's default namespace is 'awx' — matches our setup
# Apply the operator via kustomize (config/default has the full manifest set)
kubectl apply -k "${OPERATOR_DIR}/config/default" 2>&1 || {
echo "kustomize apply failed, trying raw manifests..."
kubectl apply -f "https://raw.githubusercontent.com/ansible/awx-operator/${OPERATOR_VERSION}/deploy/awx-operator.yaml"
}
# Fix kube-rbac-proxy image (gcr.io/kubebuilder/kube-rbac-proxy was removed;
# quay.io/brancz/kube-rbac-proxy is the maintained replacement)
echo ""
echo "=== Patching kube-rbac-proxy image ==="
kubectl set image deployment/awx-operator-controller-manager -n awx \
kube-rbac-proxy=quay.io/brancz/kube-rbac-proxy:v0.15.0 2>&1 || true
# Scale down any old replicasets that still reference the broken image
for rs in $(kubectl -n awx get rs -l control-plane=controller-manager -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' 2>/dev/null); do
img=$(kubectl -n awx get rs "${rs}" -o jsonpath='{.spec.template.spec.containers[?(@.name=="kube-rbac-proxy")].image}' 2>/dev/null)
if [[ "${img}" == *"gcr.io/kubebuilder"* ]]; then
echo "Scaling down old RS ${rs} (has broken gcr.io image)"
kubectl -n awx scale rs "${rs}" --replicas=0 2>&1
fi
done
echo ""
echo "Waiting for AWX Operator deployment to be ready..."
kubectl -n awx wait --for=condition=Available deployment/awx-operator-controller-manager \
--timeout=300s 2>&1 || {
echo "Operator not ready yet — checking status..."
kubectl -n awx get pods
}
# ---------------------------------------------------------------------------
# Step 3: Deploy AWX instance
# ---------------------------------------------------------------------------
echo ""
echo "=== Step 3: Deploy AWX instance ==="
kubectl apply -f "${SCRIPT_DIR}/awx-instance.yaml"
echo ""
echo "AWX instance created. Operator will now reconcile."
echo "This typically takes 5-10 minutes for the first deployment."
echo ""
echo "Monitor progress with:"
echo " kubectl -n awx get awx tsys-awx -o jsonpath='{.status.conditions}' | jq ."
echo " kubectl -n awx get pods -w"
echo " kubectl -n awx logs deployment/awx-operator-controller-manager -f"
-44
View File
@@ -1,44 +0,0 @@
#!/usr/bin/env bash
###############################################################################
# install-k3s.sh — Install k3s single-node on the tsys-awx VM.
#
# Intended to run ON the target VM (tsys-awx.knel.net) as root or via sudo.
# Installs k3s without Traefik (we use NodePort/LoadBalancer directly).
#
# Usage: sudo bash install-k3s.sh
###############################################################################
set -euo pipefail
NODE_NAME="${NODE_NAME:-tsys-awx}"
echo "=========================================================="
echo " k3s single-node install — ${NODE_NAME}"
echo "=========================================================="
if command -v k3s >/dev/null 2>&1 && k3s kubectl get nodes >/dev/null 2>&1; then
echo "k3s already installed and running. Skipping."
k3s kubectl get nodes
exit 0
fi
echo ""
echo "=== Installing k3s (this takes 1-2 minutes) ==="
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable=traefik --write-kubeconfig-mode=644" sh -
echo ""
echo "=== Waiting for k3s node to be Ready ==="
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
for i in $(seq 1 30); do
if k3s kubectl get nodes 2>/dev/null | grep -q ' Ready'; then
echo "Node is Ready!"
k3s kubectl get nodes
break
fi
echo " waiting... (${i}/30)"
sleep 5
done
echo ""
echo "=== k3s install complete ==="
echo "kubeconfig: /etc/rancher/k3s/k3s.yaml"
echo "kubectl: k3s kubectl (or set KUBECONFIG=/etc/rancher/k3s/k3s.yaml)"
-6
View File
@@ -1,6 +0,0 @@
---
# AWX Operator namespace
apiVersion: v1
kind: Namespace
metadata:
name: awx
-80
View File
@@ -1,80 +0,0 @@
#!/usr/bin/env bash
###############################################################################
# verify-awx.sh — Verify AWX deployment status and access.
#
# Intended to run ON the target VM (tsys-awx.knel.net).
# Usage: bash verify-awx.sh
###############################################################################
set -euo pipefail
export KUBECONFIG="${KUBECONFIG:-/etc/rancher/k3s/k3s.yaml}"
echo "=========================================================="
echo " AWX Deployment Verification — $(date)"
echo "=========================================================="
echo ""
echo "=== 1. k3s node ==="
kubectl get nodes
echo ""
echo "=== 2. AWX pods ==="
kubectl -n awx get pods
echo ""
echo "=== 3. AWX CR status ==="
kubectl -n awx get awx tsys-awx -o jsonpath='{range .status.conditions[*]}{.type}: {.message}{"\n"}{end}' 2>/dev/null || echo "AWX CR not found"
echo ""
echo "=== 4. Services ==="
kubectl -n awx get svc
echo ""
echo "=== 5. LoadBalancer / NodePort access ==="
LB_IP=$(kubectl -n awx get svc tsys-awx-service -o jsonpath='{.status.loadBalancer.ingress[0].ip}' 2>/dev/null || echo "")
LB_HOST=$(kubectl -n awx get svc tsys-awx-service -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null || echo "")
NODE_PORT=$(kubectl -n awx get svc tsys-awx-service -o jsonpath='{.spec.ports[0].nodePort}' 2>/dev/null || echo "")
if [ -n "${LB_IP}" ]; then
echo "LoadBalancer IP: ${LB_IP}"
ACCESS_URL="http://${LB_IP}"
elif [ -n "${LB_HOST}" ]; then
echo "LoadBalancer hostname: ${LB_HOST}"
ACCESS_URL="http://${LB_HOST}"
elif [ -n "${NODE_PORT}" ]; then
echo "NodePort: ${NODE_PORT}"
ACCESS_URL="http://$(hostname -I | awk '{print $1}'):${NODE_PORT}"
else
echo "Service not ready yet"
ACCESS_URL=""
fi
echo ""
echo "=== 6. Admin password ==="
ADMIN_PASS=$(kubectl -n awx get secret awx-admin-password -o jsonpath='{.data.password}' 2>/dev/null | base64 -d 2>/dev/null || echo "")
if [ -n "${ADMIN_PASS}" ]; then
echo "User: admin"
echo "Password: ${ADMIN_PASS}"
else
echo "Admin password secret not found"
fi
echo ""
echo "=== 7. HTTP check ==="
if [ -n "${ACCESS_URL}" ]; then
echo "Testing ${ACCESS_URL}..."
HTTP_CODE=$(curl -s -o /dev/null -w '%{http_code}' --max-time 10 "${ACCESS_URL}" 2>/dev/null || echo "failed")
echo "HTTP response: ${HTTP_CODE}"
if [ "${HTTP_CODE}" = "200" ] || [ "${HTTP_CODE}" = "302" ] || [ "${HTTP_CODE}" = "301" ]; then
echo "✓ AWX is accessible at ${ACCESS_URL}"
else
echo "✗ AWX not yet responding (HTTP ${HTTP_CODE})"
fi
fi
echo ""
echo "=========================================================="
if [ -n "${ACCESS_URL}" ]; then
echo " AWX Access URL: ${ACCESS_URL}"
fi
echo "=========================================================="