orchestration-tests/k8s-test/Makefile

30 lines
960 B
Makefile
Raw Normal View History

2022-05-17 17:43:29 +00:00
KUBE_CONTEXT ?= kubernetes-admin@kubernetes
.PHONY: all
all: cluster core
venv/bin/ansible:
python3 -m venv venv
./venv/bin/pip install ansible
# ./venv/bin/pip install python-consul
.PHONY: cluster
cluster: venv/bin/ansible
./venv/bin/ansible-galaxy install -p ansible_roles -r ansible_roles/requirements.yml
env ANSIBLE_ROLES_PATH=./ansible_roles ./venv/bin/ansible-playbook -K -vv \
-i ansible_hosts.yml ./cluster-bootstrap.yml
.PHONY: core
core:
cd core && terraform init
cd core && terraform apply -var "kube_config_context=$(KUBE_CONTEXT)"
.PHONY: destroy-core
destroy-core:
cd core && terraform destroy -var "kube_config_context=$(KUBE_CONTEXT)"
# Install CNI on hosts?
# curl -L -o cni-plugins.tgz "https://github.com/containernetworking/plugins/releases/download/v1.0.0/cni-plugins-linux-$( [ $(uname -m) = aarch64 ] && echo arm64 || echo amd64)"-v1.0.0.tgz
# sudo mkdir -p /opt/cni/bin
# sudo tar -C /opt/cni/bin -xzf cni-plugins.tgz