From b672b7a46b46312046dc69b2d708b58afa3667e2 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Fri, 20 Aug 2021 19:31:04 +0700 Subject: [PATCH] Rename infra layer to cluster --- .drone.yml | 2 +- Makefile | 10 +++++----- README.md | 6 +++--- apps/Makefile | 2 +- {infra => cluster}/Makefile | 0 {infra => cluster}/README.md | 6 +++--- {infra => cluster}/bootstrap.tf | 0 infra/cluster.tf => cluster/rke.tf | 0 {infra => cluster}/terraform.tf | 0 {infra => cluster}/values/argocd.yaml | 0 docs/diagrams/provision.py | 2 +- metal/roles/tfstate/tasks/main.yml | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) rename {infra => cluster}/Makefile (100%) rename {infra => cluster}/README.md (57%) rename {infra => cluster}/bootstrap.tf (100%) rename infra/cluster.tf => cluster/rke.tf (100%) rename {infra => cluster}/terraform.tf (100%) rename {infra => cluster}/values/argocd.yaml (100%) diff --git a/.drone.yml b/.drone.yml index 54ff1dc4..9cfa7aa1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,7 @@ type: kubernetes name: default steps: -- name: infra +- name: cluster image: hashicorp/terraform:1.0.0 commands: - plan diff --git a/Makefile b/Makefile index cbb9a53e..ae64e2df 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,9 @@ default: apply metal: make -C metal -.PHONY: infra -infra: - make -C infra +.PHONY: cluster +cluster: + make -C cluster .PHONY: apps apps: @@ -23,12 +23,12 @@ docs: make -C docs .PHONY: apply -apply: metal infra apps +apply: metal cluster apps lint: # TODO (feature) Add lint checks for everything make -C metal lint - make -C infra lint + make -C cluster lint hooks: cp ./scripts/hooks/* .git/hooks/ diff --git a/README.md b/README.md index c5d37fe3..f6bc6ae2 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ A single `make` command will automatically: - Build the `./metal` layer: - Create an ephemeral, stateless PXE server - Install Linux on all servers in parallel -- Build the `./infra` layer: - - Create a Kubernetes [cluster](./infra/cluster.tf) using RKE - - Install some [Helm chart for bootstrap](./infra/bootstrap.tf) +- Build the `./cluster` layer: + - Create a Kubernetes [cluster](./cluster/cluster.tf) using RKE + - Install some [Helm chart for bootstrap](./cluster/bootstrap.tf) - Build the `./apps` layer: - Kustomize creates Argo [applications](./apps/resources) - ArgoCD install those applications diff --git a/apps/Makefile b/apps/Makefile index 8887d8e9..893bd012 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -1,7 +1,7 @@ .POSIX: .EXPORT_ALL_VARIABLES: -KUBECONFIG = ../infra/kubeconfig.yaml +KUBECONFIG = ../cluster/kubeconfig.yaml default: apply diff --git a/infra/Makefile b/cluster/Makefile similarity index 100% rename from infra/Makefile rename to cluster/Makefile diff --git a/infra/README.md b/cluster/README.md similarity index 57% rename from infra/README.md rename to cluster/README.md index a9a5d8ff..f53d6beb 100644 --- a/infra/README.md +++ b/cluster/README.md @@ -1,9 +1,9 @@ -# Private cloud infrastructure +# Kubernetes cluster -## Kubernetes cluster `./cluster.tf` +## `./cluster.tf` Using Rancher Kubernetes Engine, with some config specific to CoreOS -## Bootstrap `./bootstrap.tf` +## `./bootstrap.tf` Install some essential Helm charts (network, storage,...) diff --git a/infra/bootstrap.tf b/cluster/bootstrap.tf similarity index 100% rename from infra/bootstrap.tf rename to cluster/bootstrap.tf diff --git a/infra/cluster.tf b/cluster/rke.tf similarity index 100% rename from infra/cluster.tf rename to cluster/rke.tf diff --git a/infra/terraform.tf b/cluster/terraform.tf similarity index 100% rename from infra/terraform.tf rename to cluster/terraform.tf diff --git a/infra/values/argocd.yaml b/cluster/values/argocd.yaml similarity index 100% rename from infra/values/argocd.yaml rename to cluster/values/argocd.yaml diff --git a/docs/diagrams/provision.py b/docs/diagrams/provision.py index d9b01f14..3c6b6fed 100644 --- a/docs/diagrams/provision.py +++ b/docs/diagrams/provision.py @@ -26,7 +26,7 @@ with Diagram("Provision (separated by logical layers)", graph_attr=graph_attr, o pxe >> os os >> bare_metal_machines - with Cluster("./infra"): + with Cluster("./cluster"): terraform = Terraform("RKE") kubernetes_nodes = Node("Kuberentes node(s)") argocd = ArgoCD("ArgoCD") diff --git a/metal/roles/tfstate/tasks/main.yml b/metal/roles/tfstate/tasks/main.yml index 6507f6bd..122e9149 100644 --- a/metal/roles/tfstate/tasks/main.yml +++ b/metal/roles/tfstate/tasks/main.yml @@ -8,4 +8,4 @@ delegate_to: localhost template: src: backend.tfvars.j2 - dest: "{{ playbook_dir }}/../infra/backend.tfvars" + dest: "{{ playbook_dir }}/../cluster/backend.tfvars"