From 26388d60611497880177fa81ba68a00560612e95 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Wed, 31 Jul 2024 00:36:59 +0200 Subject: [PATCH] feat(kb/awx): demo instance on EKS --- knowledge base/awx.md | 110 +++++++++++++++++++++++++++++++++++------- 1 file changed, 93 insertions(+), 17 deletions(-) diff --git a/knowledge base/awx.md b/knowledge base/awx.md index 93c4fc2..ab8e002 100644 --- a/knowledge base/awx.md +++ b/knowledge base/awx.md @@ -3,7 +3,7 @@ 1. [Deployment](#deployment) 1. [Removal](#removal) 1. [Testing](#testing) - 1. [Create a demo instance](#create-a-demo-instance) + 1. [Create demo instances](#create-demo-instances) 1. [API](#api) 1. [Further readings](#further-readings) 1. [Sources](#sources) @@ -23,6 +23,12 @@ It is meant to provide a Kubernetes-native installation method for AWX via an AW The operator will use an Ansible role to create all the AWX resources under its hood.
See [Iterating on the installer without deploying the operator]. +Requirements: + +- An existing K8S cluster. +- The ability to create PersistentVolumeClaims and PersistentVolumes in said K8S cluster. +- The ability for the cluster to create load balancers if setting the service type to load balancer. +
Using kustomize @@ -207,7 +213,7 @@ kubectl delete ns 'awx' ## Testing -### Create a demo instance +### Create demo instances
Run: follow the basic installation guide @@ -422,24 +428,13 @@ $ minikube kubectl -- delete ns 'awx'
Run: kustomized helm chart +> #### Warning +> +> Remember to include the CRDs from the helm chart. +
1. AMD64, OpenSUSE Leap 15.5, minikube -
-
Warning
- -Mind including the CRDs from the helm chart. - -
- ```sh $ minikube start --cpus=4 --memory=6g --addons=ingress 😄 minikube v1.29.0 on Opensuse-Leap 15.5 @@ -509,6 +504,87 @@ DgHIaA9onZj106osEmvECigzsBqutHqI $ xdg-open $(minikube service -n 'awx' 'awx-demo-service' --url) $ minikube kubectl -- delete -f <(minikube kubectl -- kustomize --enable-helm) +``` + +
+ +
+ 1. AMD64, Mac OS X, EKS + +```sh +$ mkdir -p '/tmp/awx' +$ cd '/tmp/awx' + +$ cat < 'namespace.yaml' +--- +apiVersion: v1 +kind: Namespace +metadata: + name: awx +EOF +$ cat < 'kustomization.yaml' +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: awx +resources: + - namespace.yaml +helmCharts: + - name: awx-operator + repo: https://ansible.github.io/awx-operator/ + version: 2.19.1 + releaseName: awx-operator + includeCRDs: true +EOF +$ kubectl kustomize --enable-helm | kubectl apply -f - +namespace/awx created +… +deployment.apps/awx-operator-controller-manager created +$ kubectl get pods -n 'awx' +NAME READY STATUS RESTARTS AGE +awx-operator-controller-manager-3361cfab38-tdgt3 2/2 Running 0 13s + +$ cat < 'awx-demo.yaml' +--- +apiVersion: awx.ansible.com/v1beta1 +kind: AWX +metadata: + name: awx-demo +spec: + admin_email: me@example.org + no_log: false + node_selector: | + kubernetes.io/arch: amd64 + service_type: LoadBalancer + ingress_type: ingress + ingress_annotations: | + kubernetes.io/ingress.class: alb +EOF +$ yq -iy '.resources+=["awx-demo.yaml"]' 'kustomization.yaml' +$ kubectl kustomize --enable-helm | kubectl apply -f - +namespace/awx unchanged +… +deployment.apps/awx-operator-controller-manager unchanged +awx.awx.ansible.com/awx-demo created +$ kubectl -n 'awx' get pods +NAME READY STATUS RESTARTS AGE +awx-demo-migration-24.1.0-zwv8w 0/1 Completed 0 115s +awx-demo-postgres-15-0 1/1 Running 0 10m +awx-demo-task-8e34efc56-w5rc5 4/4 Running 0 8m3s +awx-demo-web-545gbdgg7b-q2q4m 3/3 Running 0 8m4s +awx-operator-controller-manager-3361cfab38-tdgt3 2/2 Running 0 14m + +$ # Default user is 'admin'. +$ kubectl -n 'awx' get secret 'awx-demo-admin-password' -o jsonpath="{.data.password}" | base64 --decode +IDwYOgL9k2ckaXmqMm6PT4d6TXdJcocd +$ kubectl -n 'awx' get ingress 'awx-demo-ingress' -o jsonpath='{.status.loadBalancer.ingress[*].hostname}' \ + | xargs -I{} open http://{} + +$ kubectl kustomize --enable-helm | kubectl delete -f - +namespace "awx" deleted +… +awx.awx.ansible.com "awx-demo" deleted +deployment.apps "awx-operator-controller-manager" deleted ```