반응형
AWX란?
Ansible을 기반으로 그래픽 인터페이스를 통해 Ansible 플레이북, 인벤토리 및 작업 일정을 중앙 집중화하고
제어할 수 있으므로 인프라 전체에서 자동화 작업을 더 쉽게 관리하고 모니터링할 수 있게 해주는 오픈소스 툴 입니다.
이제 쿠버네티스 클러스터에서 설치를 해보도록 하겠습니다.
AWX 설치
1. 필요한 패키지 설치
# apt install -y git make
2. awx-operator 설치
2-1. 해당 주소에 있는 git 레포지토리에서 파일을 받아옵니다.
# git clone https://github.com/ansible/awx-operator.git
2-2. git 레포지토리에서 0.17.0 버전으로 변경 (브랜치)
# cd awx-operator
# git checkout 0.17.0
2-3. awx 설치하는 동안 네임스페이스를 default가 아닌 ansible-awx로 변경 후 deploy
# export NAMESPACE=ansible-awx
# make deploy
2-4. 정상적으로 deploy 되는 지 확인
# kubectl get pods
=> 결과
NAME READY STATUS RESTARTS AGE
awx-operator-controller-manager-5d4bb48989-pfzpc 2/2 Running 0 79m
2-5. AWX yaml 내용 변경
# cp awx-demo.yml ansible-awx.yml
# vi ansible-awx.yml
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: <원하는 이름으로 변경>
spec:
service_type: nodeport
2-6. AWX yaml 적용
# kubectl config set-context --current --namespace=$NAMESPACE
# kubectl apply -f ansible-awx.yml
2-7. AWX.yaml 정상 설치 확인
# kubectl get pods
=> 결과
NAME READY STATUS RESTARTS AGE
ansible-awx-f5c964dcb-x42kr 4/4 Running 0 25m
ansible-awx-postgres-0 1/1 Running 0 47m
awx-operator-controller-manager-5d4bb48989-pfzpc 2/2 Running 0 89m
# kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ansible-awx-postgres ClusterIP None <none> 5432/TCP 47m
ansible-awx-service NodePort 10.106.204.5 <none> 80:32483/TCP 29m
awx-operator-controller-manager-metrics-service ClusterIP 10.98.157.217 <none> 8443/TCP 89m
ansible-awx.yml 적용 시 에러
원인: ansible-awx.yml 파일을 적용하니, ansible-awx-postgres가 정상적으로 생성되지 않아서 문제가 무엇인지
확인해보니 postgres용 pv가 없어서 생성되지 않았습니다.해결: pv 생성
apiVersion: v1 kind: PersistentVolume metadata: name: awx-postgres spec: capacity: storage: 250Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain # storageClassName: default hostPath: path: /awx
AWX 페이지 접속
저는 서비스 타입을 NodePort로 해놓았기 때문에, <ansibe-awx 파드가 설치된 노드IP>:{NodePort}로 접속 하였습니다.

초기 ID: admin
초기에 접속 하기 위해서는 password를 찾아야 합니다.
방법: kubectl get secret ansible-awx-admin-password -o jsonpath="{.data.password}" | base64 --decode; echo

반응형
'Ansible' 카테고리의 다른 글
AWX 컬렉션 설치 (requirements.yml) (2) | 2024.05.17 |
---|---|
AWX 시작해보기 (Inventory, Credentials, Projects, Templates) (0) | 2024.05.14 |
Ansible 사용하여 vSphere 환경에서 가상머신 생성 (0) | 2024.03.27 |
Ansible 사용하여 nginx 설치 및 index 페이지 변경 (0) | 2024.02.14 |
Ansible 사용하여 WordPress, Haproxy 설정 해보기 (0) | 2024.02.11 |