ajout install Kubernetes
This commit is contained in:
parent
5e63a0a076
commit
205866b2ff
81
HowtoAWX.md
81
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.
|
À 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: <https://ansible.readthedocs.io/projects/awx-operator/en/latest/installation/basic-install.html>
|
||||||
|
|
||||||
|
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
|
Copier le dépôt sur le serveur a partir d'une version stable: https://github.com/ansible/awx/releases/tag
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue