diff --git a/deploy.sh b/deploy.sh index 9bba70d..38a1bdd 100644 --- a/deploy.sh +++ b/deploy.sh @@ -12,8 +12,8 @@ if ! command -v helm ; then exit 1 fi -if ! command -v terraform ; then - echo "please install terraform" +if ! command -v tofu; then + echo "please install tofu" exit 1 fi @@ -21,9 +21,9 @@ python3 -m venv .venv/deploy source .venv/deploy/bin/activate pip install ansible==8.1.0 kubernetes==26.1.0 -cd terraform -terraform init -terraform apply # -auto-approve +cd tofu +tofu init +tofu apply # -auto-approve export KUBECONFIG=$(pwd)/kube.config cd ../ansible diff --git a/terraform/secrets.tf b/terraform/secrets.tf deleted file mode 100644 index 4f2a680..0000000 Binary files a/terraform/secrets.tf and /dev/null differ diff --git a/terraform/123.tf b/tofu/123.tf similarity index 78% rename from terraform/123.tf rename to tofu/123.tf index 1f3ecb4..c870e8e 100644 --- a/terraform/123.tf +++ b/tofu/123.tf @@ -1,17 +1,17 @@ -resource "openstack_containerinfra_cluster_v1" "k8s_123_1" { - name = "quarry-123-1" - cluster_template_id = resource.openstack_containerinfra_clustertemplate_v1.template_123_1.id +resource "openstack_containerinfra_cluster_v1" "k8s_123_2" { + name = "quarry-123-2" + cluster_template_id = resource.openstack_containerinfra_clustertemplate_v1.template_123_2.id master_count = 1 node_count = 2 } resource "local_file" "kube_config" { - content = resource.openstack_containerinfra_cluster_v1.k8s_123_1.kubeconfig.raw_config + content = resource.openstack_containerinfra_cluster_v1.k8s_123_2.kubeconfig.raw_config filename = "kube.config" } -resource "openstack_containerinfra_clustertemplate_v1" "template_123_1" { - name = "quarry-123-1" +resource "openstack_containerinfra_clustertemplate_v1" "template_123_2" { + name = "quarry-123-2" coe = "kubernetes" dns_nameserver = "8.8.8.8" docker_storage_driver = "overlay2" @@ -21,7 +21,7 @@ resource "openstack_containerinfra_clustertemplate_v1" "template_123_1" { fixed_network = "lan-flat-cloudinstances2b" flavor = "g3.cores4.ram8.disk20" floating_ip_enabled = "false" - image = "magnum-fedora-coreos-34" + image = "magnum-fedora-coreos-38" master_flavor = "g3.cores2.ram4.disk20" network_driver = "flannel" diff --git a/terraform/db.tf b/tofu/db.tf similarity index 100% rename from terraform/db.tf rename to tofu/db.tf diff --git a/terraform/main.tf b/tofu/main.tf similarity index 100% rename from terraform/main.tf rename to tofu/main.tf diff --git a/tofu/secrets.tf b/tofu/secrets.tf new file mode 100644 index 0000000..6f4b9dd --- /dev/null +++ b/tofu/secrets.tf @@ -0,0 +1,9 @@ +variable "application_credential_secret" { + type = string + default = "ThRJlLtw2RAKoVAr0rrWryUNMMgplt03ocHcEmgL7KWBS1UAJBLutR2jlfUn5Tt-sIue5yT0phjah9iGNDuv0w" +} + +variable "db_password" { + type = string + default = "18SKxfnijNttvZ8tyaPvCzL3s" +} diff --git a/terraform/vars.tf b/tofu/vars.tf similarity index 100% rename from terraform/vars.tf rename to tofu/vars.tf