スポンサーリンク
sudo apt update -y
sudo apt upgrade -y
sudo apt install ansible -y
ansible --version
sudo apt install git make -y
sudo reboot
sudo apt install -y curl wget apt-transport-https
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube version
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
kubectl version -o yaml
sudo apt update
sudo apt install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
newgrp docker
minikube start --driver=docker
minikube start --addons=ingress --cpus=2 --cni=flannel --install-addons=true --kubernetes-version=stable --memory=6g
minikube status
kubectl cluster-info
kubectl get nodes
minikube addons list
sudo gpasswd -a $(whoami) docker
sudo chgrp docker /var/run/docker.sock
sudo service docker restart
minikube start
minikube dashboard

Ctrl + C

minikube addons enable ingress
kubectl create deployment my-nginx --image=nginx
kubectl get deployments.apps my-nginx
kubectl get pods
kubectl expose deployment my-nginx --name=my-nginx-svc --type=NodePort --port=80
kubectl get svc my-nginx-svc
minikube start --vm-driver=docker --addons=ingress
minikube status
kubectl get pods -A
git clone https://github.com/ansible/awx-operator.git
cd awx-operator/

*以下のコードの2.7.2は現在のバージョン

最新バージョンは以下のサイトから確認

https://github.com/ansible/awx-operator/releases

git checkout 2.7.2
export NAMESPACE=ansible-awx
make deploy
kubectl get pods -n ansible-awx
cat awx-demo.yml
kubectl create -f awx-demo.yml -n ansible-awx

以下のコード結果の「NAME」をこの後使用する

kubectl get pods -n ansible-awx
kubectl get svc -n ansible-awx

*{NAME}は先ほどのコード結果「NAME」の最後の値と置き換える

kubectl logs {NAME} -n ansible-awx -f
kubectl get pods -n ansible-awx
kubectl get svc -n ansible-awx

以下の実行結果からログインURLを確認し、コンソールを起動

minikube service awx-demo-service --url -n ansible-awx
外部PCからアクセスする場合
kubectl port-forward service/awx-demo-service -n ansible-awx --address 0.0.0.0 10445:80

http://<Ubuntu-System-IP-Address>:10445

ログインパスワードを取得。

IDはadmin

パスワードは以下コードの実行結果

kubectl get secret awx-demo-admin-password -o jsonpath="{.data.password}" -n ansible-awx | base64 --decode; echo

Twitterでフォローしよう

おすすめの記事