diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..f00c2d7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 La Rebelion Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..39cd444 --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +# QBot OTS App Template - Drift Detection + +This project is a template for creating a Kubernetes application that uses the QBot OTS (Off-The-Shelf) platform to detect drift in Kubernetes resources. + +This project requires the following resources: + +* [ ] - Kubernetes 1.16+ +* [ ] - Kustomize 3.0.0+ +* [ ] - Helm 3.0+ + +## Resources + +For more information about the project, see the following resources: + +./charts/drift-detection/README.md + +- [Project Details](./charts/drift-detection/README.md) +- [QBot](https://k1s.sh/qbot) +- [Agentico Tools](https://agentico.com/tools) + +## Motivation + +Maintaining a Kubernetes applications can be challenging, and even more so when the application is deployed in multiple environments. This project aims to provide a simple way to detect drift configurations in Kubernetes resources across multiple environments. The best part, it aims to do this leveraging AI agent by Agentico. 🤖 + +We are following the official Kubernetes best practices for [configuration management of OTS applications](https://kubectl.docs.kubernetes.io/guides/config_management/offtheshelf/), and we are using `helm` and `kustomize` to manage the Kubernetes resources. + +![OTS Drift Detection](https://kubectl.docs.kubernetes.io/images/new_ots.jpg) +> *Reference: [kubectl.docs.kubernetes.io](https://kubectl.docs.kubernetes.io/guides/config_management/offtheshelf/)* + +If you find this project useful, please consider giving it a star. ⭐ + +Also, star the [QBot](https://github.com/orgs/la-rebelion/repositories?q=qbot-) and the [Agentico Tools](https://github.com/orgs/agentico-dev/repositories) projects, we will appreciate it. 🙏 + +## Getting Started + +If you want to do it with QBot, you can follow the instructions in the [QBot](https://k1s.sh/qbot) website. If you want to do it manually, you can follow the instructions below. + +First of all, [fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) to your GitHub account. + +Example with the `gh` CLI: + +```bash +gh repo fork git@github.com:la-rebelion/qbot-base-template.git --clone=true --remote=true --remote-name "my-qbot-fork" +``` + +Then, clone the repository to your local machine with the following commands: + +```bash +# Repository was forked and cloned +# Change the directory +cd my-qbot-fork +# deploy the application in the dev environment +kubectl kustomize --enable-helm=true envs/dev/ | kubectl apply -f - +# also, you can deploy the application in multiple environments +kubectl kustomize --enable-helm=true envs/ | kubectl apply -f - +``` + +The last command will deploy the application in the `dev`, `staging`, and `prod` environments. Review the `envs` [kustomization](./envs/kustomization.yaml) files to see the different environments. + +## License + +This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details. + +## Acknowledgments + +- [Helm](https://helm.sh/) +- [Kubernetes](https://kubernetes.io/) +- [Bitnami](https://bitnami.com/) +- ["La Rebelion" GitHub](https://github.com/la-rebelion/) +- ["La Rebelion" Website](https://rebelion.la/) +- [Agentico](https://agentico.com/) +- [Agentico GitHub](https://github.com/agentico-dev/) \ No newline at end of file diff --git a/charts/drift-detection/.helmignore b/charts/drift-detection/.helmignore new file mode 100644 index 0000000..b2ab526 --- /dev/null +++ b/charts/drift-detection/.helmignore @@ -0,0 +1,18 @@ +# Ignore the following files and directories when packaging the Helm chart +*.tgz +*.zip +*.tar.gz +*.bak +*.swp +*.DS_Store +node_modules/ +vendor/ +charts/ +tmp/ +*.log +*.tmp +*.out +*.pid +*.seed +*.tgz +*.tgz.* \ No newline at end of file diff --git a/charts/drift-detection/Chart.yaml b/charts/drift-detection/Chart.yaml new file mode 100644 index 0000000..69bd4f6 --- /dev/null +++ b/charts/drift-detection/Chart.yaml @@ -0,0 +1,21 @@ +name: drift-detection +apiVersion: v2 +version: 0.1.0 +description: A Helm chart for deploying a sample application with database configuration and secrets +type: application +keywords: + - helm + - chart + - application + - database + - drift-detection + - qbot +maintainers: + - name: Adrian Escutia + - name: La Rebelion +sources: + - https://github.com/la-rebelion/drift-detection-template +# dependencies: +# - name: busybox +# version: 1.2.3 +# repository: https://kubernetes-charts.storage.googleapis.com \ No newline at end of file diff --git a/charts/drift-detection/README.md b/charts/drift-detection/README.md new file mode 100644 index 0000000..0a1bbcc --- /dev/null +++ b/charts/drift-detection/README.md @@ -0,0 +1,89 @@ +# My Helm Project + +This project is a Helm chart for deploying a sample application with two services, a stateful set, and a deployment. The application is configured to use BusyBox images and demonstrates how to manage configurations and secrets in Kubernetes. + +## Project Structure + +For easy listing and understanding, the file names are prefixed with a code that represents the type of file. The code is as follows: + +- `0-`: Application specific +- `conf-`: Configuration files, including ConfigMaps and Secrets. +- `netw-`: Network files, including Ingress, Services, and Endpoints. +- `wrkl-`: Workload files, including Deployments, StatefulSets, and Jobs. + +Deployment and statefulset resources are configured to use the `index-html` configmap and display the content of the `index.html` file, populated with all the config values; just a simple example to simulate a web application and its configurations - feel free to replace it with your own application. + +``` +drift-detection +├── Chart.yaml +├── README.md +├── templates +│   ├── 0-configmap-index-html.yaml +│   ├── NOTES.txt +│   ├── _helpers.tpl +│   ├── conf-secret-app.yaml +│   ├── conf-secret-db.yaml +│   ├── configmap-app.yaml +│   ├── configmap-db.yaml +│   ├── netw-ingress.yaml +│   ├── netw-service-app.yaml +│   ├── netw-service-db.yaml +│   ├── wrkl-deployment.yaml +│   └── wrkl-statefulset.yaml +└── values.yaml +``` + +## Installation + +To install the Helm chart, follow these steps: + +1. Ensure you have Helm installed on your machine. +2. Navigate to the project directory: + ``` + cd drift-detection + ``` +3. Install the chart: + ``` + helm install la-rebelion-drift-detection . + ``` + +## Configuration + +You can customize the deployment by modifying the `values.yaml` file. This file contains default values for the templates in the chart. + +## Services + +This project includes: +- A StatefulSet with 2 replicas for managing stateful applications. +- A Deployment with 2 replicas for stateless applications. +- ConfigMaps for application and database configurations. +- Secrets for sensitive information such as database credentials. + +## Cluster Requirements + +This chart requires a Kubernetes cluster where you can access the services using the NodePort service type. You can also use a LoadBalancer service type if your cluster supports it. + +If you don't have a cluster, you can create one, for your convenience I have created a [guide to install a Kubernetes cluster using K0s, K3s, minikube, or microk8s](https://rebelion.la/the-easiest-kubernetes-installations-ever). +Kubernetes in Docker ([Kind](https://kind.sigs.k8s.io)) is another great tool for testing Kubernetes configurations locally. +**Or you can use the ["K1s, a Serverless Kubernetes"](https://k1s.sh/serverless-kubernetes) to access a Kubernetes cluster in 1 second withouth any installation, no resource management, no cost.** + +Port-forward the services to access them from your local machine: + +``` +kubectl port-forward svc/db-service 5432:5432 +kubectl port-forward svc/app-service 8080:8080 +``` + +This will create two services with NodePort type that you can access from your local machine. Access the services by running the following command: + +``` +curl +``` + +## Usage + +Once the chart is installed, you can access the services as defined in the `service-app.yaml` and `service-db.yaml` templates. The application pods will print the environment variables configured from the ConfigMaps and Secrets. + +## License + +This project is licensed under the MIT License. \ No newline at end of file diff --git a/charts/drift-detection/templates/0-configmap-index-html.yaml b/charts/drift-detection/templates/0-configmap-index-html.yaml new file mode 100644 index 0000000..e0d674e --- /dev/null +++ b/charts/drift-detection/templates/0-configmap-index-html.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: index-html +data: + index.html: | + + + + Environment Variables + + + +

Environment Variables

+

+    
+    
diff --git a/charts/drift-detection/templates/NOTES.txt b/charts/drift-detection/templates/NOTES.txt
new file mode 100644
index 0000000..aa9f962
--- /dev/null
+++ b/charts/drift-detection/templates/NOTES.txt
@@ -0,0 +1,20 @@
+Thank you for installing {{ .Chart.Name }} v{{ .Chart.Version }}.
+Your release is named {{ .Release.Name }}.
+
+A sample skeleton for the drift detection configuration using helm charts.
+
+To access the application go to http://:/
+To access the database go to http://:/
+
+Firts, you need to port-forward the services to access the application and the database.
+
+kubectl port-forward svc/db-service 5432:5432
+kubectl port-forward svc/app-service 8080:8080
+
+http://localhost:8080/ - for the deployment
+http://localhost:5432/ - for the statefulset
+
+The example uses the `index-html` configmap to populate the `index.html` file with the values from the `values.yaml` file.
+
+Enjoy, and happy drifting! Go Rebels! ✊🏻
+
diff --git a/charts/drift-detection/templates/_helpers.tpl b/charts/drift-detection/templates/_helpers.tpl
new file mode 100644
index 0000000..e395d9d
--- /dev/null
+++ b/charts/drift-detection/templates/_helpers.tpl
@@ -0,0 +1,16 @@
+{{- define "la-rebelion.fullname" -}}
+{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{- define "la-rebelion.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create -}}
+{{- .Release.Name }}-{{ .Chart.Name }}-sa
+{{- else -}}
+{{- .Values.serviceAccount.name -}}
+{{- end -}}
+{{- end -}}
+
+{{- define "la-rebelion.labels" -}}
+app: {{ .Chart.Name }}
+release: {{ .Release.Name }}
+{{- end -}}
\ No newline at end of file
diff --git a/charts/drift-detection/templates/conf-secret-app.yaml b/charts/drift-detection/templates/conf-secret-app.yaml
new file mode 100644
index 0000000..91eea82
--- /dev/null
+++ b/charts/drift-detection/templates/conf-secret-app.yaml
@@ -0,0 +1,8 @@
+apiVersion: v1
+kind: Secret
+metadata:
+  name: app-secret
+type: Opaque
+data:
+  app-username: {{ .Values.secrets.app.username }}
+  app-password: {{ .Values.secrets.app.password | b64enc | quote }}
\ No newline at end of file
diff --git a/charts/drift-detection/templates/conf-secret-db.yaml b/charts/drift-detection/templates/conf-secret-db.yaml
new file mode 100644
index 0000000..60b4beb
--- /dev/null
+++ b/charts/drift-detection/templates/conf-secret-db.yaml
@@ -0,0 +1,8 @@
+apiVersion: v1
+kind: Secret
+metadata:
+  name: db-secret
+type: Opaque
+data:
+  username: {{ .Values.secrets.db.username | quote }}
+  password: {{ .Values.secrets.db.password | quote | b64enc }}
\ No newline at end of file
diff --git a/charts/drift-detection/templates/configmap-app.yaml b/charts/drift-detection/templates/configmap-app.yaml
new file mode 100644
index 0000000..f6a37c2
--- /dev/null
+++ b/charts/drift-detection/templates/configmap-app.yaml
@@ -0,0 +1,10 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: app-config
+data:
+  APP_ENV: "production"
+  APP_LOG_LEVEL: "info"
+  DB_SERVER: "{{ .Values.db.server }}"
+  DB_PORT: "{{ .Values.db.port }}"
+  DB_NAME: "{{ .Values.db.name }}"
\ No newline at end of file
diff --git a/charts/drift-detection/templates/configmap-db.yaml b/charts/drift-detection/templates/configmap-db.yaml
new file mode 100644
index 0000000..9744ebf
--- /dev/null
+++ b/charts/drift-detection/templates/configmap-db.yaml
@@ -0,0 +1,7 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: db-config
+data:
+  DB_SERVER: "{{ .Values.db.server }}"
+  DB_PORT: "{{ .Values.db.port }}"
\ No newline at end of file
diff --git a/charts/drift-detection/templates/ingress.yaml b/charts/drift-detection/templates/ingress.yaml
new file mode 100644
index 0000000..87903b9
--- /dev/null
+++ b/charts/drift-detection/templates/ingress.yaml
@@ -0,0 +1,22 @@
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: la-rebelion-ingress
+spec:
+  rules:
+  - http:
+      paths:
+      - pathType: Prefix
+        path: /
+        backend:
+          service:
+            name: app-service
+            port:
+              number: 8080
+      - pathType: Prefix
+        path: /db
+        backend:
+          service:
+            name: db-service            
+            port:
+              number: 5432
diff --git a/charts/drift-detection/templates/netw-service-app.yaml b/charts/drift-detection/templates/netw-service-app.yaml
new file mode 100644
index 0000000..2abd577
--- /dev/null
+++ b/charts/drift-detection/templates/netw-service-app.yaml
@@ -0,0 +1,16 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: app-service
+  labels:
+    app: la-rebelion
+    tier: frontend
+spec:
+  type: NodePort
+  ports:
+    - port: 8080
+      targetPort: 8080
+      nodePort: 30080
+  selector:
+    app: la-rebelion
+    tier: frontend
\ No newline at end of file
diff --git a/charts/drift-detection/templates/netw-service-db.yaml b/charts/drift-detection/templates/netw-service-db.yaml
new file mode 100644
index 0000000..3efd0dd
--- /dev/null
+++ b/charts/drift-detection/templates/netw-service-db.yaml
@@ -0,0 +1,16 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: db-service
+  labels:
+    app: la-rebelion
+    tier: backend
+spec:
+  type: NodePort
+  ports:
+    - port: 5432
+      targetPort: 5432
+      nodePort: 32345
+  selector:
+    app: la-rebelion
+    tier: backend
\ No newline at end of file
diff --git a/charts/drift-detection/templates/wrkl-deployment.yaml b/charts/drift-detection/templates/wrkl-deployment.yaml
new file mode 100644
index 0000000..551da16
--- /dev/null
+++ b/charts/drift-detection/templates/wrkl-deployment.yaml
@@ -0,0 +1,55 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: la-rebelion-deployment
+spec:
+  replicas: 2
+  selector:
+    matchLabels:
+      app: la-rebelion
+      tier: frontend
+  template:
+    metadata:
+      labels:
+        app: la-rebelion
+        tier: frontend
+    spec:
+      containers:
+        - name: la-rebelion-container
+          image: busybox
+          command: ["sh", "-c", "env && /bin/httpd -p 8080 -f -h /var/www/"]
+          env:
+            - name: DB_SERVER
+              valueFrom:
+                configMapKeyRef:
+                  name: db-config
+                  key: DB_SERVER
+            - name: APP_CONFIG
+              valueFrom:
+                configMapKeyRef:
+                  name: app-config
+                  key: APP_ENV
+            - name: DB_USERNAME
+              valueFrom:
+                secretKeyRef:
+                  name: db-secret
+                  key: username
+            - name: DB_PASSWORD
+              valueFrom:
+                secretKeyRef:
+                  name: db-secret
+                  key: password
+          ports:
+            - containerPort: 8080
+          volumeMounts:
+            - name: www-data
+              mountPath: /var/www/
+            - name: index-html
+              mountPath: /var/www/index.html
+              subPath: index.html
+      volumes:
+        - name: www-data
+          emptyDir: {}
+        - name: index-html
+          configMap:
+            name: index-html
\ No newline at end of file
diff --git a/charts/drift-detection/templates/wrkl-statefulset.yaml b/charts/drift-detection/templates/wrkl-statefulset.yaml
new file mode 100644
index 0000000..4a42d24
--- /dev/null
+++ b/charts/drift-detection/templates/wrkl-statefulset.yaml
@@ -0,0 +1,59 @@
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+  name: la-rebelion-db
+spec:
+  # serviceName: "la-rebelion-db"
+  replicas: 2
+  selector:
+    matchLabels:
+      app: la-rebelion
+      tier: backend
+  template:
+    metadata:
+      labels:
+        app: la-rebelion
+        tier: backend
+    spec:
+      containers:
+      - name: la-rebelion
+        image: busybox
+        command: ['sh', '-c', 'env && /bin/httpd -p 5432 -f -h /var/www/']
+        env:
+        - name: DB_SERVER
+          valueFrom:
+            configMapKeyRef:
+              name: db-config
+              key: DB_SERVER
+        - name: DB_USERNAME
+          valueFrom:
+            secretKeyRef:
+              name: db-secret
+              key: username
+        - name: DB_PASSWORD
+          valueFrom:
+            secretKeyRef:
+              name: db-secret
+              key: password
+        ports:
+          - containerPort: 5432
+        volumeMounts:
+          - name: www-data
+            mountPath: /var/www/
+          - name: index-html
+            mountPath: /var/www/index.html
+            subPath: index.html
+      volumes:
+        - name: www-data
+          emptyDir: {}
+        - name: index-html
+          configMap:
+            name: index-html
+  volumeClaimTemplates:
+  - metadata:
+      name: la-rebelion-db-storage
+    spec:
+      accessModes: ["ReadWriteOnce"]
+      resources:
+        requests:
+          storage: 1Gi
\ No newline at end of file
diff --git a/charts/drift-detection/values.yaml b/charts/drift-detection/values.yaml
new file mode 100644
index 0000000..41a5b73
--- /dev/null
+++ b/charts/drift-detection/values.yaml
@@ -0,0 +1,13 @@
+app:
+  env: "production"
+db:
+  server: "dummy-db.rebelion.la"
+  port: 5432
+  name: "mydatabase"
+secrets:
+  db:
+    username: "dbuser"
+    password: "dbpassword"
+  app:
+    username: "appuser"
+    password: "apppassword"
\ No newline at end of file
diff --git a/envs/base/kustomization.yaml b/envs/base/kustomization.yaml
new file mode 100644
index 0000000..ccf076c
--- /dev/null
+++ b/envs/base/kustomization.yaml
@@ -0,0 +1,8 @@
+# https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/helmcharts/
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+metadata:
+  name: base
+
+namePrefix: deleteme-
+namespace: test
diff --git a/envs/base/values.yaml b/envs/base/values.yaml
new file mode 100644
index 0000000..782d2e7
--- /dev/null
+++ b/envs/base/values.yaml
@@ -0,0 +1,13 @@
+app:
+  env: "production"
+db:
+  server: "dummy-db.rebelion.la"
+  port: 5432
+  name: "mydatabase"
+secrets:
+  db:
+    username: "dbusername"
+    password: "dbpassword"
+  app:
+    username: "appuser"
+    password: "apppassword"
\ No newline at end of file
diff --git a/envs/dev/kustomization.yaml b/envs/dev/kustomization.yaml
new file mode 100644
index 0000000..d1c7f63
--- /dev/null
+++ b/envs/dev/kustomization.yaml
@@ -0,0 +1,15 @@
+resources: 
+- ../base
+namePrefix: dev-
+namespace: dev-namespace
+
+helmGlobals:
+  chartHome: ../../charts
+helmCharts:
+  - name: drift-detection
+    version: v0.1.0
+    releaseName: test
+    includeCRDs: false
+    valuesFile: ./values.yaml
+    additionalValuesFiles:
+    - ./values-file-1.yaml
diff --git a/envs/dev/values-file-1.yaml b/envs/dev/values-file-1.yaml
new file mode 100644
index 0000000..f40d7dd
--- /dev/null
+++ b/envs/dev/values-file-1.yaml
@@ -0,0 +1,4 @@
+secrets:
+  app:
+    username: "devappuser"
+    password: "devapppassword"
\ No newline at end of file
diff --git a/envs/dev/values.yaml b/envs/dev/values.yaml
new file mode 100644
index 0000000..acde5da
--- /dev/null
+++ b/envs/dev/values.yaml
@@ -0,0 +1,8 @@
+app:
+  env: "development"
+db:
+  server: "dev-db.rebelion.la"
+  name: "mydevdb"
+secrets:
+  db:
+    password: "devdbpassword"
\ No newline at end of file
diff --git a/envs/kustomization.yaml b/envs/kustomization.yaml
new file mode 100644
index 0000000..2298170
--- /dev/null
+++ b/envs/kustomization.yaml
@@ -0,0 +1,9 @@
+# Off The Shelf App - https://kubectl.docs.kubernetes.io/guides/config_management/offtheshelf/
+resources:
+# - namespace-patch.yaml
+- ./dev
+- ./staging
+- ./prod
+namePrefix: cluster-qbot-
+
+# run: kubectl kustomize --enable-helm=true
diff --git a/envs/prod/kustomization.yaml b/envs/prod/kustomization.yaml
new file mode 100644
index 0000000..cdb6666
--- /dev/null
+++ b/envs/prod/kustomization.yaml
@@ -0,0 +1,17 @@
+resources: 
+- ../base
+namePrefix: prod-
+namespace: prod-ns
+
+helmGlobals:
+  chartHome: ../../charts
+helmCharts:
+  - name: drift-detection
+    version: v0.1.0
+    releaseName: test
+    includeCRDs: false
+    # valuesFile: ../charts/drift-detection/values.yaml
+    valuesFile: ./values.yaml
+    # additionalValuesFiles:
+    # - ./values-file-1.yaml
+    # - ./values-file-2.yaml
diff --git a/envs/prod/values.yaml b/envs/prod/values.yaml
new file mode 100644
index 0000000..2589381
--- /dev/null
+++ b/envs/prod/values.yaml
@@ -0,0 +1,11 @@
+app:
+  env: "prod"
+db:
+  server: "prod-db.rebelion.la"
+  name: "myproddb"
+secrets:
+  db:
+    password: "proddbpassword"
+  app:
+    username: "prodappuser"
+    password: "prodapppassword"
\ No newline at end of file
diff --git a/envs/qa/kustomization.yaml b/envs/qa/kustomization.yaml
new file mode 100644
index 0000000..d361da7
--- /dev/null
+++ b/envs/qa/kustomization.yaml
@@ -0,0 +1,2 @@
+resources: []
+namePrefix: qa-
diff --git a/envs/sandbox/kustomization.yaml b/envs/sandbox/kustomization.yaml
new file mode 100644
index 0000000..3ea2339
--- /dev/null
+++ b/envs/sandbox/kustomization.yaml
@@ -0,0 +1,2 @@
+resources: []
+namePrefix: sandbox-
diff --git a/envs/staging/kustomization.yaml b/envs/staging/kustomization.yaml
new file mode 100644
index 0000000..33124b3
--- /dev/null
+++ b/envs/staging/kustomization.yaml
@@ -0,0 +1,17 @@
+resources:
+  - ../base
+namePrefix: staging-
+namespace: staging
+
+helmGlobals:
+  chartHome: ../../charts
+helmCharts:
+  - name: drift-detection
+    version: v0.1.0
+    releaseName: test
+    includeCRDs: false
+    # valuesFile: ../charts/drift-detection/values.yaml
+    valuesFile: ./values.yaml
+    # additionalValuesFiles:
+    # - ./values-file-1.yaml
+    # - ./values-file-2.yaml
diff --git a/envs/staging/values.yaml b/envs/staging/values.yaml
new file mode 100644
index 0000000..41a5b73
--- /dev/null
+++ b/envs/staging/values.yaml
@@ -0,0 +1,13 @@
+app:
+  env: "production"
+db:
+  server: "dummy-db.rebelion.la"
+  port: 5432
+  name: "mydatabase"
+secrets:
+  db:
+    username: "dbuser"
+    password: "dbpassword"
+  app:
+    username: "appuser"
+    password: "apppassword"
\ No newline at end of file
diff --git a/envs/test/kustomization.yaml b/envs/test/kustomization.yaml
new file mode 100644
index 0000000..ca3fbdf
--- /dev/null
+++ b/envs/test/kustomization.yaml
@@ -0,0 +1,2 @@
+resources: []
+namePrefix: test-
diff --git a/envs/uat/kustomization.yaml b/envs/uat/kustomization.yaml
new file mode 100644
index 0000000..9d31af2
--- /dev/null
+++ b/envs/uat/kustomization.yaml
@@ -0,0 +1,2 @@
+resources: []
+namePrefix: uat-
diff --git a/snapshots/.empty b/snapshots/.empty
new file mode 100644
index 0000000..e69de29
diff --git a/templates/.empty b/templates/.empty
new file mode 100644
index 0000000..e69de29