ansible awx

wx安装在kubernetes平台,先在kubernetes平台上跑一个operator, 这个operator其实就是一个kubernetes 自定义资源CRD,然后再跑一个awx CRD 实例,在这过程中需要PV卷

前提条件,利用nfs 提供PV卷

1
2
3
4
5
https://github.com/ansible/awx-operator

[root@k8smaster pvc]# showmount -e 192.168.1.10
Export list for 12.19.2.10:
/vols/v20 12.19.2.0/24

pv yaml文件定义

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
apiVersion: v1
kind: PersistentVolume
metadata:
name: pg
labels:
storesys: nfs
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
- ReadWriteOnce
- ReadOnlyMany
persistentVolumeReclaimPolicy: Retain
nfs:
server: 12.19.2.10
path: /vols/v20

awx-operator.yaml文件

1
wget   https://raw.githubusercontent.com/ansible/awx-operator/devel/deploy/awx-operator.yaml

myawx.yaml

1
2
3
4
5
6
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx
spec:
tower_ingress_type: Ingress

kubectl apply

1
2
3
4
5
6
kubectl apply  -f pg-pv.yaml
kubectl apply -f awx-operator.yaml
kubectl apply -f myawx.yaml
kubectl get pods
kubectl get svc
kubectl get ingress

界面访问

1
2
3
4
url access web;
username: admin
password: kubectl get secret awx-admin-password -o jsonpath='{.data.password}' | base64 --decode
gVEQRpzMtaFqLTung4TBF4b7HarECM7L

总结