From 22a334115ee1ca37b8cf8fb0d68817a82f28a3ab Mon Sep 17 00:00:00 2001 From: Jonathan Basniak Date: Sat, 18 Jan 2025 01:04:57 -0500 Subject: [PATCH] feat(iac): add production configuration for pizza time --- iac/README.md | 8 +++- .../environments/main/kustomization.yml | 32 +++++++++++++++ iac/zfgc.com/environments/main/namespace.yml | 4 ++ .../environments/production/kustomization.yml | 39 ------------------- 4 files changed, 43 insertions(+), 40 deletions(-) create mode 100644 iac/zfgc.com/environments/main/kustomization.yml create mode 100644 iac/zfgc.com/environments/main/namespace.yml delete mode 100644 iac/zfgc.com/environments/production/kustomization.yml diff --git a/iac/README.md b/iac/README.md index 244b4db..d781462 100644 --- a/iac/README.md +++ b/iac/README.md @@ -6,6 +6,7 @@ Pizza. - [ZFGBB IaC (Infrastructure as Code)](#zfgbb-iac-infrastructure-as-code) - [Table of Contents](#table-of-contents) + - [Projects](#projects) - [Environment Setup](#environment-setup) - [Development Process](#development-process) - [Scripts](#scripts) @@ -19,6 +20,10 @@ Pizza. - [Domain Structure](#domain-structure) - [Notes](#notes) +## Projects + +- [zfgc.com](./zfgc.com/README.md) + ## Environment Setup To setup your environment, follow the [setup instructions](../README.md#setup) in the main README. @@ -107,7 +112,6 @@ domain-name.tld │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ ├── service.yml -│ │ ├── secret-[dependency-service-A].yml ├── scripts │ ├── setup-environment-files.sh ``` @@ -115,3 +119,5 @@ domain-name.tld ## Notes Regarding the [Domain Structure](#domain-structure), for now, we're slightly breaking the convention and including `crystalrookarts` and legacy zfgc.com services under the `old-skool` service. This is because we're still using the old zfgc.com domain for legacy services, and we want to keep the domain name consistent. This will be addressed in the future. + +For more details, see the [ZFGBB IaC README](./zfgc.com/README.md). diff --git a/iac/zfgc.com/environments/main/kustomization.yml b/iac/zfgc.com/environments/main/kustomization.yml new file mode 100644 index 0000000..7523e69 --- /dev/null +++ b/iac/zfgc.com/environments/main/kustomization.yml @@ -0,0 +1,32 @@ +namespace: zfgbb-main + +resources: +- namespace.yml +- ../../base +- ../../services/zfgbb +- ../../services/old-skool + +configMapGenerator: +- behavior: merge + envs: + - .env + name: old-skool-config +- behavior: merge + envs: + - .env + name: zfgbb-config + +secretGenerator: +- behavior: merge + envs: + - .env + name: old-skool-secrets + type: Opaque +- behavior: merge + envs: + - .env.secret + name: zfgbb-secrets + type: Opaque + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization diff --git a/iac/zfgc.com/environments/main/namespace.yml b/iac/zfgc.com/environments/main/namespace.yml new file mode 100644 index 0000000..90bd8ea --- /dev/null +++ b/iac/zfgc.com/environments/main/namespace.yml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: zfgbb-main \ No newline at end of file diff --git a/iac/zfgc.com/environments/production/kustomization.yml b/iac/zfgc.com/environments/production/kustomization.yml deleted file mode 100644 index 9c87c2f..0000000 --- a/iac/zfgc.com/environments/production/kustomization.yml +++ /dev/null @@ -1,39 +0,0 @@ -resources: -- ../../base -- ../../services - -namespace: prod-${NAMESPACE} - -configMapGenerator: -- literals: - - hostDir=/prod/path/to/apache - name: apache-config -- literals: - - hostDir=/prod/path/to/mysql - name: mysql-config -- literals: - - hostDir=/prod/path/to/tomcat - name: tomcat-config -- literals: - - hostDir=/prod/path/to/postgres - name: postgres-config - -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -patches: -- patch: | - - op: remove - path: /spec/rules/0 - - op: remove - path: /spec/rules/1 - target: - group: networking.k8s.io - kind: Ingress - name: my-ingress - version: v1 -replacements: -- source: - fieldPath: metadata.name - kind: Namespace - name: prod-${NAMESPACE} -