From 205866b2fff5df389923052f9ec05a50434b550d Mon Sep 17 00:00:00 2001 From: Tom David--Broglio Date: Thu, 18 Jan 2024 20:01:32 +0100 Subject: [PATCH] ajout install Kubernetes --- HowtoAWX.md | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/HowtoAWX.md b/HowtoAWX.md index 333349cc..5e7b9754 100644 --- a/HowtoAWX.md +++ b/HowtoAWX.md @@ -15,7 +15,86 @@ title: How to AWX À partir de 18.0 il est recommandé de l'installer à travers [AWX Operator](https://github.com/ansible/awx-operator) qui dépend de kubernetes. Il est aussi possible d'utiliser une image docker. -### Docker +### Kubernetes + +Documentation: + +Déploiement de AWX Operator sur un cluster Kubernetes : + +> Si vous n'avez pas de cluster Kubernetes, on peut facilement en créer un cluster *mono-neud* avec k3s par exemple voir [HowtoK3s](/HowtoK3s.md) + +Nous allons créer un dossier awx contenant notre configuration : + +~~~{.bash} +$ tree awx +awx +├── awx-demo-instance.yaml +└── kustomization.yaml +... +TODO +~~~ + +* un fichier kustomize qui va assembler `awx/kustomization.yaml` + +~~~{.yaml} +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + # Prendre le dernier release tag : https://github.com/ansible/awx-operator/releases + - github.com/ansible/awx-operator/config/default?ref=2.10.0 + # fichier(s) d'instance(s) + - awx-demo-instance.yaml +# le tag de l'image doit etre le meme que celui du release tag ci-dessus +images: + - name: quay.io/ansible/awx-operator + newTag: 2.10.0 + +# Specifier le namespace de awx +namespace: awx +~~~ + +* un fichier d'instance `awx/awx-demo-instance.yaml` + +~~~{.yaml} +apiVersion: awx.ansible.com/v1beta1 +kind: AWX +metadata: + name: awx-demo +spec: + service_type: nodeport +~~~ + +Lancer le Déploiement : + +~~~{.bash} +$ kubectl apply -k awx +namespace/awx created +customresourcedefinition.apiextensions.k8s.io/awxbackups.awx.ansible.com created +customresourcedefinition.apiextensions.k8s.io/awxrestores.awx.ansible.com created +customresourcedefinition.apiextensions.k8s.io/awxs.awx.ansible.com created +serviceaccount/awx-operator-controller-manager created +role.rbac.authorization.k8s.io/awx-operator-awx-manager-role created +role.rbac.authorization.k8s.io/awx-operator-leader-election-role created +clusterrole.rbac.authorization.k8s.io/awx-operator-metrics-reader created +clusterrole.rbac.authorization.k8s.io/awx-operator-proxy-role created +rolebinding.rbac.authorization.k8s.io/awx-operator-awx-manager-rolebinding created +rolebinding.rbac.authorization.k8s.io/awx-operator-leader-election-rolebinding created +clusterrolebinding.rbac.authorization.k8s.io/awx-operator-proxy-rolebinding created +configmap/awx-operator-awx-manager-config created +service/awx-operator-controller-manager-metrics-service created +deployment.apps/awx-operator-controller-manager created +~~~{.bash} + +~~~{.bash} +# voir ou en l'installation +$ kubectl -n awx logs -f deployments/awx-operator-controller-manager +# suivre le lancement d'instance(s) +$kubectl logs -n awx -f deployments/awx-operator-controller-manager -c awx-manager +# Récuperer le mot de passe d'une instance +$ kubectl get secret -n awx awx-demo-admin-password -o jsonpath="{.data.password}" | base64 --decode ; echo +~~~ + +### Docker (Déprécié) Copier le dépôt sur le serveur a partir d'une version stable: https://github.com/ansible/awx/releases/tag