Initial commit - production deployment
This commit is contained in:
6
infrastructure/cicd/flux/Chart.yaml
Normal file
6
infrastructure/cicd/flux/Chart.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: flux-cd
|
||||
description: A Helm chart for deploying Flux CD GitOps toolkit for Bakery-IA
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "2.2.3"
|
||||
15
infrastructure/cicd/flux/templates/gitrepository.yaml
Normal file
15
infrastructure/cicd/flux/templates/gitrepository.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- if .Values.gitRepository }}
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: GitRepository
|
||||
metadata:
|
||||
name: {{ .Values.gitRepository.name }}
|
||||
namespace: {{ .Values.gitRepository.namespace }}
|
||||
spec:
|
||||
interval: {{ .Values.gitRepository.interval }}
|
||||
url: {{ .Values.gitRepository.url }}
|
||||
ref:
|
||||
branch: {{ .Values.gitRepository.ref.branch }}
|
||||
secretRef:
|
||||
name: {{ .Values.gitRepository.secretRef.name }}
|
||||
timeout: {{ .Values.gitRepository.timeout }}
|
||||
{{- end }}
|
||||
43
infrastructure/cicd/flux/templates/kustomization.yaml
Normal file
43
infrastructure/cicd/flux/templates/kustomization.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
{{- if .Values.kustomization }}
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: {{ .Values.kustomization.name }}
|
||||
namespace: {{ .Values.kustomization.namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/name: bakery-ia
|
||||
app.kubernetes.io/component: flux
|
||||
spec:
|
||||
# Wait for GitRepository to be ready before reconciling
|
||||
dependsOn: []
|
||||
interval: {{ .Values.kustomization.interval }}
|
||||
path: {{ .Values.kustomization.path }}
|
||||
prune: {{ .Values.kustomization.prune }}
|
||||
sourceRef:
|
||||
kind: {{ .Values.kustomization.sourceRef.kind }}
|
||||
name: {{ .Values.kustomization.sourceRef.name }}
|
||||
targetNamespace: {{ .Values.kustomization.targetNamespace }}
|
||||
timeout: {{ .Values.kustomization.timeout }}
|
||||
retryInterval: {{ .Values.kustomization.retryInterval }}
|
||||
wait: {{ .Values.kustomization.wait }}
|
||||
{{- if .Values.kustomization.healthChecks }}
|
||||
healthChecks:
|
||||
{{- range .Values.kustomization.healthChecks }}
|
||||
- apiVersion: {{ .apiVersion }}
|
||||
kind: {{ .kind }}
|
||||
name: {{ .name }}
|
||||
namespace: {{ .namespace }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.kustomization.postBuild }}
|
||||
postBuild:
|
||||
substituteFrom:
|
||||
{{- range .Values.kustomization.postBuild.substituteFrom }}
|
||||
- kind: {{ .kind }}
|
||||
name: {{ .name }}
|
||||
{{- if .optional }}
|
||||
optional: {{ .optional }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
9
infrastructure/cicd/flux/templates/namespace.yaml
Normal file
9
infrastructure/cicd/flux/templates/namespace.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
{{- if .Values.createNamespace | default false }}
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ .Values.gitRepository.namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/name: flux
|
||||
kubernetes.io/metadata.name: {{ .Values.gitRepository.namespace }}
|
||||
{{- end }}
|
||||
73
infrastructure/cicd/flux/values.yaml
Normal file
73
infrastructure/cicd/flux/values.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
# Default values for flux-cd
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
gitRepository:
|
||||
name: bakery-ia
|
||||
namespace: flux-system
|
||||
interval: 1m
|
||||
url: http://gitea-http.gitea.svc.cluster.local:3000/bakery-admin/bakery-ia.git
|
||||
ref:
|
||||
branch: main
|
||||
secretRef:
|
||||
name: gitea-credentials
|
||||
timeout: 60s
|
||||
|
||||
kustomization:
|
||||
name: bakery-ia-prod
|
||||
namespace: flux-system
|
||||
interval: 5m
|
||||
path: ./infrastructure/environments/prod
|
||||
prune: true
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: bakery-ia
|
||||
targetNamespace: bakery-ia
|
||||
timeout: 10m
|
||||
retryInterval: 1m
|
||||
wait: true
|
||||
healthChecks:
|
||||
# Core Infrastructure
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: gateway
|
||||
namespace: bakery-ia
|
||||
# Authentication & Authorization
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: auth-service
|
||||
namespace: bakery-ia
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: tenant-service
|
||||
namespace: bakery-ia
|
||||
# Core Business Services
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: inventory-service
|
||||
namespace: bakery-ia
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: orders-service
|
||||
namespace: bakery-ia
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: pos-service
|
||||
namespace: bakery-ia
|
||||
# Data Services
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: forecasting-service
|
||||
namespace: bakery-ia
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: notification-service
|
||||
namespace: bakery-ia
|
||||
postBuild:
|
||||
substituteFrom:
|
||||
- kind: ConfigMap
|
||||
name: bakery-ia-config
|
||||
optional: true
|
||||
- kind: Secret
|
||||
name: bakery-ia-secrets
|
||||
optional: true
|
||||
Reference in New Issue
Block a user