반응형
Ansible AWX를 배포할 때 PVC를 설정하는 방법
Ansible AWX를 Kubernetes에 배포할 때 Persistent Volume Claim(PVC)를 설정하려면 AWX CR(AWX Custom Resource) 파일(awx-demo.yml)에서 spec 아래에 persistence 설정을 추가해야 합니다.
1. AWX가 자동으로 PVC를 생성하도록 설정
기본적으로 awx-demo.yml 파일에서 persistence.enabled: true를 설정하면 AWX가 PVC를 자동으로 생성합니다.
awx-demo.yml 수정
vim awx-demo.yml
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx-demo
spec:
service_type: NodePort
nodeport_port: 32080
# PVC 설정
persistence:
enabled: true
storage_class: "manual"
access_mode: ReadWriteOnce
size: 10Gi
existing_claim: awx-pvc
적용 방법
kubectl apply -f awx-demo.yml -n ansible-awx
2. 직접 PVC를 생성하여 사용하기
AWX에서 자동 생성된 PVC 대신 직접 PVC를 생성하여 사용할 수도 있습니다.
PVC 설정
vim awx-pvc.yml
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: awx-pvc
namespace: ansible-awx
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: "manual"
PVC 적용
kubectl apply -f awx-pvc.yml
awx-demo.yml에서 직접 생성한 PVC 사용 설정
vim awx-demo.yml
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx-demo
spec:
service_type: nodeport
nodeport_port: 32080
spec:
persistence:
enabled: true
existing_claim: awx-pvc
적용 방법
kubectl apply -f awx-demo.yml -n ansible-awx
3. 필요 시 PV(Persistent Volume) 직접 생성
Kubernetes 환경에 따라 Persistent Volume(PV)도 직접 생성해야 할 수 있습니다.
PV 설정
vim awx-pv.yml
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: awx-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: manual
hostPath:
path: "/home/ubuntu/awx-operator/data/awx"
PV 적용
kubectl apply -f awx-demo.yml -n ansible-awx
4. PVC 상태 확인
PVC가 정상적으로 생성되었는지 확인하려면 다음 명령어를 실행합니다.
kubectl get pvc -n ansible-awx
- STATUS가 Bound인지 확인합니다.
- Pending 상태라면 StorageClass 설정이 올바른지 확인해야 합니다.
참고URL
- 변군이글루 블로그 : Ansible AWX를 설치하는 방법
728x90
반응형
'리눅스' 카테고리의 다른 글
Ansible AWX를 설치하는 방법 (0) | 2025.03.11 |
---|---|
우분투에서 Minikube를 설치하고 실행하는 방법 (0) | 2025.03.09 |
Minikube Dashboard 활성화 및 외부 접근 설정 방법 (0) | 2025.03.09 |
CentOS 7에서 Ansible AWX 17을 설치하는 방법 (0) | 2025.03.06 |
우분투에서 Ansible AWX를 Minikube로 설치하는 방법 (0) | 2025.03.06 |