3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWX 10.0.0 を10分で構築

Posted at

はじめに

以前にAWX9.0.1を構築した際は、まだk8s v1.16に対応しておらず色々手を加えましたが、最新の10.0.0ではそんな事をする必要もなくなっています。
細かい設定などを考慮せず、ただ動かすだけなら(マシンパワーやNW速度によりますが)
10分程度で動かせてしまうくらい楽チンです。

環境

Ubuntu Server 19.04

手順

k3sインストール

$ curl -sfL https://get.k3s.io | sh -
$ mkdir ~/.kube
$ sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config

helmインストール

$ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

Ansibleインストール

$ sudo apt update
$ sudo apt install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible

AWXダウンロード

$ wget https://github.com/ansible/awx/archive/10.0.0.tar.gz
$ tar xvfz 10.0.0.tar.gz

Inventoryファイル編集

$ cd awx-10.0.0/installer
$ vi inventory

以下の項目の行頭のコメントアウトを外し、値を設定

kubernetes_context=default
kubernetes_namespace=awx
pg_persistence_storageClass=local-path

AWXインストール

$ sudo ansible-playbook -i inventory install.yml

おしまい。

ブラウザで接続

ポート番号を以下で確認。

$ sudo kubectl get svc -n awx
NAME                      TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
awx-postgresql-headless   ClusterIP   None           <none>        5432/TCP       13m
awx-postgresql            ClusterIP   10.43.79.219   <none>        5432/TCP       13m
awx-web-svc               NodePort    10.43.48.255   <none>        80:32367/TCP   12m

上記であれば、http://<UbuntuマシンのIP>:32367/へアクセスすればAWXのログイン画面が見れるはずです。
ユーザー名:admin
パスワード:password
でログインできます。

おわりに

上記のように簡単に動かせます。データベースもPersistentVolumeで永続化されるので、再起動してもデータが消えることはありません。

不要になって消したくなったら、

$ k3s-uninstall.sh

を実行すればk3sの環境ごと綺麗に消すこともできます。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?