diff --git a/manifests/helm/microforge/.helmignore b/manifests/helm/microforge/.helmignore new file mode 100644 index 0000000..898df48 --- /dev/null +++ b/manifests/helm/microforge/.helmignore @@ -0,0 +1,24 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ + diff --git a/manifests/helm/microforge/Chart.yaml b/manifests/helm/microforge/Chart.yaml new file mode 100644 index 0000000..bc9edb0 --- /dev/null +++ b/manifests/helm/microforge/Chart.yaml @@ -0,0 +1,17 @@ +apiVersion: v2 +name: microforge +description: A Helm chart for MicroForge - Enterprise-Grade Microservices Platform +type: application +version: 1.0.0 +appVersion: "1.0.0" +keywords: + - microservices + - polyglot + - kubernetes + - devops +maintainers: + - name: Manoj M + email: manojmanjunathhs@gmail.com +sources: + - https://github.com/Manoj-14/MicroForge + diff --git a/manifests/helm/microforge/README.md b/manifests/helm/microforge/README.md new file mode 100644 index 0000000..4ae577b --- /dev/null +++ b/manifests/helm/microforge/README.md @@ -0,0 +1,61 @@ +# MicroForge Helm Chart + +## Quick Start + +### Prerequisites +- Kubernetes cluster +- kubectl configured +- Helm 3.0+ + +### Installation + +1. **Ensure `src/.env` file exists** with required values: + - `LOGIN_SERVICE_DB_USERNAME` + - `LOGIN_SERVICE_DB_PASSWORD` + - `LOGIN_SERVICE_JWT_SECRET` + - `FLASK_SECRET_KEY` + - `NOTIFICATION_SERVICE_DB_USER` + - `NOTIFICATION_SERVICE_DB_PASSWORD` + +2. **Install using helper script:** + + **Linux/Mac:** + ```bash + cd manifests/helm/microforge + chmod +x install-from-env.sh + ./install-from-env.sh + ``` + + **Windows PowerShell:** + ```powershell + cd manifests/helm/microforge + .\install-from-env.ps1 + ``` + + **Or install directly:** + ```bash + helm install microforge ./manifests/helm/microforge + ``` + +### Access Services + +All services are exposed via LoadBalancer: + +- **Frontend**: http://localhost:3000 +- **Login Service**: http://localhost:8081 +- **Auth Service**: http://localhost:8082 +- **Notification Service**: http://localhost:8083 +- **Metadata Service**: http://localhost:8084 + +### Check Status + +```bash +kubectl get pods -n microforge-dev-ns +kubectl get services -n microforge-dev-ns +``` + +### Uninstall + +```bash +helm uninstall microforge -n microforge-dev-ns +``` diff --git a/manifests/helm/microforge/install-from-env.ps1 b/manifests/helm/microforge/install-from-env.ps1 new file mode 100644 index 0000000..2a4837e --- /dev/null +++ b/manifests/helm/microforge/install-from-env.ps1 @@ -0,0 +1,117 @@ +# PowerShell script to install MicroForge Helm chart by reading from src/.env file +# This script reads secrets from the .env file in the src directory + +param( + [string]$ReleaseName = "microforge", + [string]$Namespace = "microforge-dev-ns" +) + +$ErrorActionPreference = "Stop" + +Write-Host "MicroForge Helm Installation from .env file" -ForegroundColor Green +Write-Host "==================================================" -ForegroundColor Green + +# Get the script directory and project root +$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path +$ProjectRoot = (Get-Item $ScriptDir).Parent.Parent.Parent.FullName +$EnvFile = Join-Path $ProjectRoot "src\.env" + +# Check if .env file exists +if (-not (Test-Path $EnvFile)) { + Write-Host "Error: .env file not found at $EnvFile" -ForegroundColor Red + Write-Host "Please ensure the .env file exists in the src directory." -ForegroundColor Yellow + exit 1 +} + +Write-Host "Found .env file at: $EnvFile" -ForegroundColor Green + +# Read .env file and set environment variables +Get-Content $EnvFile | ForEach-Object { + if ($_ -match '^\s*([^#][^=]+)=(.*)$') { + $key = $matches[1].Trim() + $value = $matches[2].Trim() + # Remove quotes if present + $value = $value -replace '^["'']|["'']$', '' + [Environment]::SetEnvironmentVariable($key, $value, "Process") + } +} + +# Check if required variables are set +$RequiredVars = @( + "LOGIN_SERVICE_DB_USERNAME", + "LOGIN_SERVICE_DB_PASSWORD", + "LOGIN_SERVICE_JWT_SECRET", + "FLASK_SECRET_KEY", + "NOTIFICATION_SERVICE_DB_USER", + "NOTIFICATION_SERVICE_DB_PASSWORD" +) + +$MissingVars = @() + +foreach ($var in $RequiredVars) { + if (-not (Test-Path "Env:$var") -or [string]::IsNullOrEmpty((Get-Item "Env:$var").Value)) { + $MissingVars += $var + } +} + +if ($MissingVars.Count -gt 0) { + Write-Host "Error: The following required variables are missing from .env file:" -ForegroundColor Red + foreach ($var in $MissingVars) { + Write-Host " - $var" -ForegroundColor Red + } + exit 1 +} + +$ChartPath = $ScriptDir + +# Check if Helm is installed +try { + helm version | Out-Null +} catch { + Write-Host "Error: Helm is not installed. Please install Helm first." -ForegroundColor Red + exit 1 +} + +# Check if chart exists +if (-not (Test-Path $ChartPath)) { + Write-Host "Error: Chart directory not found at $ChartPath" -ForegroundColor Red + exit 1 +} + +Write-Host "All required variables found in .env file." -ForegroundColor Green +Write-Host "Installing Helm chart..." -ForegroundColor Yellow +Write-Host " Release name: $ReleaseName" +Write-Host " Namespace: $Namespace" +Write-Host "" + +# Build Helm install command with all secrets from .env file +$helmArgs = @( + "install", + $ReleaseName, + $ChartPath, + "--namespace", $Namespace, + "--create-namespace", + "--set", "loginService.secrets.dbUsername=$env:LOGIN_SERVICE_DB_USERNAME", + "--set", "loginService.secrets.dbPassword=$env:LOGIN_SERVICE_DB_PASSWORD", + "--set", "loginService.secrets.jwtSecret=$env:LOGIN_SERVICE_JWT_SECRET", + "--set", "metadataService.secrets.flaskSecretKey=$env:FLASK_SECRET_KEY", + "--set", "notificationService.secrets.mysqlUser=$env:NOTIFICATION_SERVICE_DB_USER", + "--set", "notificationService.secrets.mysqlPassword=$env:NOTIFICATION_SERVICE_DB_PASSWORD", + "--set", "loginMysql.secrets.rootPassword=$env:LOGIN_SERVICE_DB_PASSWORD", + "--set", "notificationMysql.secrets.rootPassword=$env:NOTIFICATION_SERVICE_DB_PASSWORD" +) + +& helm $helmArgs + +Write-Host "" +Write-Host "Installation completed!" -ForegroundColor Green +Write-Host "" +Write-Host "Access services:" +Write-Host " Frontend: http://localhost:3000" +Write-Host " Login: http://localhost:8081" +Write-Host " Auth: http://localhost:8082" +Write-Host " Notification: http://localhost:8083" +Write-Host " Metadata: http://localhost:8084" +Write-Host "" +Write-Host "Check status: kubectl get pods -n $Namespace" + diff --git a/manifests/helm/microforge/install-from-env.sh b/manifests/helm/microforge/install-from-env.sh new file mode 100644 index 0000000..6312c3f --- /dev/null +++ b/manifests/helm/microforge/install-from-env.sh @@ -0,0 +1,108 @@ +#!/bin/bash +# Helper script to install MicroForge Helm chart by reading from src/.env file +# This script reads secrets from the .env file in the src directory + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +echo -e "${GREEN}MicroForge Helm Installation from .env file${NC}" +echo "==================================================" + +# Get the script directory and project root +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PROJECT_ROOT="$( cd "$SCRIPT_DIR/../../.." && pwd )" +ENV_FILE="$PROJECT_ROOT/src/.env" + +# Check if .env file exists +if [ ! -f "$ENV_FILE" ]; then + echo -e "${RED}Error: .env file not found at $ENV_FILE${NC}" + echo -e "${YELLOW}Please ensure the .env file exists in the src directory.${NC}" + exit 1 +fi + +echo -e "${GREEN}Found .env file at: $ENV_FILE${NC}" + +# Source the .env file +set -a +source "$ENV_FILE" +set +a + +# Check if required variables are set +REQUIRED_VARS=( + "LOGIN_SERVICE_DB_USERNAME" + "LOGIN_SERVICE_DB_PASSWORD" + "LOGIN_SERVICE_JWT_SECRET" + "FLASK_SECRET_KEY" + "NOTIFICATION_SERVICE_DB_USER" + "NOTIFICATION_SERVICE_DB_PASSWORD" +) + +MISSING_VARS=() + +for var in "${REQUIRED_VARS[@]}"; do + if [ -z "${!var}" ]; then + MISSING_VARS+=("$var") + fi +done + +if [ ${#MISSING_VARS[@]} -ne 0 ]; then + echo -e "${RED}Error: The following required variables are missing from .env file:${NC}" + for var in "${MISSING_VARS[@]}"; do + echo -e " ${RED}- $var${NC}" + done + exit 1 +fi + +# Get release name and namespace from arguments or use defaults +RELEASE_NAME=${1:-microforge} +NAMESPACE=${2:-microforge-dev-ns} +CHART_PATH="$SCRIPT_DIR" + +# Check if Helm is installed +if ! command -v helm &> /dev/null; then + echo -e "${RED}Error: Helm is not installed. Please install Helm first.${NC}" + exit 1 +fi + +# Check if chart exists +if [ ! -d "$CHART_PATH" ]; then + echo -e "${RED}Error: Chart directory not found at $CHART_PATH${NC}" + exit 1 +fi + +echo -e "${GREEN}All required variables found in .env file.${NC}" +echo -e "${YELLOW}Installing Helm chart...${NC}" +echo " Release name: $RELEASE_NAME" +echo " Namespace: $NAMESPACE" +echo "" + +# Build Helm install command with all secrets from .env file +helm install "$RELEASE_NAME" "$CHART_PATH" \ + --namespace "$NAMESPACE" \ + --create-namespace \ + --set loginService.secrets.dbUsername="$LOGIN_SERVICE_DB_USERNAME" \ + --set loginService.secrets.dbPassword="$LOGIN_SERVICE_DB_PASSWORD" \ + --set loginService.secrets.jwtSecret="$LOGIN_SERVICE_JWT_SECRET" \ + --set metadataService.secrets.flaskSecretKey="$FLASK_SECRET_KEY" \ + --set notificationService.secrets.mysqlUser="$NOTIFICATION_SERVICE_DB_USER" \ + --set notificationService.secrets.mysqlPassword="$NOTIFICATION_SERVICE_DB_PASSWORD" \ + --set loginMysql.secrets.rootPassword="$LOGIN_SERVICE_DB_PASSWORD" \ + --set notificationMysql.secrets.rootPassword="$NOTIFICATION_SERVICE_DB_PASSWORD" + +echo "" +echo -e "${GREEN}Installation completed!${NC}" +echo "" +echo "Access services:" +echo " Frontend: http://localhost:3000" +echo " Login: http://localhost:8081" +echo " Auth: http://localhost:8082" +echo " Notification: http://localhost:8083" +echo " Metadata: http://localhost:8084" +echo "" +echo "Check status: kubectl get pods -n $NAMESPACE" + diff --git a/manifests/helm/microforge/templates/NOTES.txt b/manifests/helm/microforge/templates/NOTES.txt new file mode 100644 index 0000000..20d3a7d --- /dev/null +++ b/manifests/helm/microforge/templates/NOTES.txt @@ -0,0 +1,13 @@ +Thank you for installing {{ .Chart.Name }}! + +Access your services: + - Frontend: http://localhost:3000 + - Login Service: http://localhost:8081 + - Auth Service: http://localhost:8082 + - Notification Service: http://localhost:8083 + - Metadata Service: http://localhost:8084 + +Check status: + kubectl get pods -n {{ include "microforge.namespace" . }} + kubectl get services -n {{ include "microforge.namespace" . }} + diff --git a/manifests/helm/microforge/templates/_helpers.tpl b/manifests/helm/microforge/templates/_helpers.tpl new file mode 100644 index 0000000..51dd73b --- /dev/null +++ b/manifests/helm/microforge/templates/_helpers.tpl @@ -0,0 +1,113 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "microforge.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +*/}} +{{- define "microforge.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "microforge.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "microforge.labels" -}} +helm.sh/chart: {{ include "microforge.chart" . }} +{{ include "microforge.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "microforge.selectorLabels" -}} +app.kubernetes.io/name: {{ include "microforge.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the namespace to use +*/}} +{{- define "microforge.namespace" -}} +{{- default .Values.global.namespace .Values.namespace.name }} +{{- end }} + +{{/* +Frontend Service labels +*/}} +{{- define "microforge.frontendService.labels" -}} +app: {{ .Values.frontendService.name }} +{{ include "microforge.labels" . }} +{{- end }} + +{{/* +Auth Service labels +*/}} +{{- define "microforge.authService.labels" -}} +app: {{ .Values.authService.name }} +{{ include "microforge.labels" . }} +{{- end }} + +{{/* +Login Service labels +*/}} +{{- define "microforge.loginService.labels" -}} +app: {{ .Values.loginService.name }} +{{ include "microforge.labels" . }} +{{- end }} + +{{/* +Metadata Service labels +*/}} +{{- define "microforge.metadataService.labels" -}} +app: {{ .Values.metadataService.name }} +{{ include "microforge.labels" . }} +{{- end }} + +{{/* +Notification Service labels +*/}} +{{- define "microforge.notificationService.labels" -}} +app: {{ .Values.notificationService.name }} +{{ include "microforge.labels" . }} +{{- end }} + +{{/* +Login MySQL labels +*/}} +{{- define "microforge.loginMysql.labels" -}} +app: {{ .Values.loginMysql.name }} +{{ include "microforge.labels" . }} +{{- end }} + +{{/* +Notification MySQL labels +*/}} +{{- define "microforge.notificationMysql.labels" -}} +app: {{ .Values.notificationMysql.name }} +{{ include "microforge.labels" . }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/auth-service-configmap.yaml b/manifests/helm/microforge/templates/auth-service-configmap.yaml new file mode 100644 index 0000000..9b0dc08 --- /dev/null +++ b/manifests/helm/microforge/templates/auth-service-configmap.yaml @@ -0,0 +1,10 @@ +{{- if .Values.authService.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.authService.name }}-config + namespace: {{ include "microforge.namespace" . }} +data: + AUTH_SERVICE_PORT: {{ .Values.authService.config.port | quote }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/auth-service-deployment.yaml b/manifests/helm/microforge/templates/auth-service-deployment.yaml new file mode 100644 index 0000000..e466ffb --- /dev/null +++ b/manifests/helm/microforge/templates/auth-service-deployment.yaml @@ -0,0 +1,31 @@ +{{- if .Values.authService.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.authService.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.authService.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.authService.replicaCount }} + selector: + matchLabels: + app: {{ .Values.authService.name }} + template: + metadata: + labels: + app: {{ .Values.authService.name }} + spec: + containers: + - name: {{ .Values.authService.name }} + image: "{{ .Values.authService.image.repository }}:{{ .Values.authService.image.tag }}" + imagePullPolicy: {{ .Values.authService.image.pullPolicy }} + ports: + - containerPort: {{ .Values.authService.service.targetPort }} + envFrom: + - configMapRef: + name: {{ .Values.authService.name }}-config + resources: + {{- toYaml .Values.authService.resources | nindent 10 }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/auth-service-service.yaml b/manifests/helm/microforge/templates/auth-service-service.yaml new file mode 100644 index 0000000..00c9368 --- /dev/null +++ b/manifests/helm/microforge/templates/auth-service-service.yaml @@ -0,0 +1,18 @@ +{{- if .Values.authService.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.authService.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.authService.labels" . | nindent 4 }} +spec: + selector: + app: {{ .Values.authService.name }} + type: {{ .Values.authService.service.type }} + ports: + - name: auth-service-port + port: {{ .Values.authService.service.port }} + targetPort: {{ .Values.authService.service.targetPort }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/frontend-service-configmap.yaml b/manifests/helm/microforge/templates/frontend-service-configmap.yaml new file mode 100644 index 0000000..89b544f --- /dev/null +++ b/manifests/helm/microforge/templates/frontend-service-configmap.yaml @@ -0,0 +1,14 @@ +{{- if .Values.frontendService.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.frontendService.name }}-config + namespace: {{ include "microforge.namespace" . }} +data: + REACT_APP_LOGIN_SERVICE_URL: {{ .Values.frontendService.config.reactAppLoginServiceUrl }} + REACT_APP_AUTH_SERVICE_URL: {{ .Values.frontendService.config.reactAppAuthServiceUrl }} + REACT_APP_NOTIFICATION_SERVICE_URL: {{ .Values.frontendService.config.reactAppNotificationServiceUrl }} + REACT_APP_METADATA_SERVICE_URL: {{ .Values.frontendService.config.reactAppMetadataServiceUrl }} + REACT_APP_API_BASE_URL: {{ .Values.frontendService.config.reactAppApiBaseUrl }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/frontend-service-deployment.yaml b/manifests/helm/microforge/templates/frontend-service-deployment.yaml new file mode 100644 index 0000000..94ae886 --- /dev/null +++ b/manifests/helm/microforge/templates/frontend-service-deployment.yaml @@ -0,0 +1,31 @@ +{{- if .Values.frontendService.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.frontendService.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.frontendService.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.frontendService.replicaCount }} + selector: + matchLabels: + app: {{ .Values.frontendService.name }} + template: + metadata: + labels: + app: {{ .Values.frontendService.name }} + spec: + containers: + - name: {{ .Values.frontendService.name }} + image: "{{ .Values.frontendService.image.repository }}:{{ .Values.frontendService.image.tag }}" + imagePullPolicy: {{ .Values.frontendService.image.pullPolicy }} + ports: + - containerPort: {{ .Values.frontendService.service.targetPort }} + envFrom: + - configMapRef: + name: {{ .Values.frontendService.name }}-config + resources: + {{- toYaml .Values.frontendService.resources | nindent 10 }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/frontend-service-service.yaml b/manifests/helm/microforge/templates/frontend-service-service.yaml new file mode 100644 index 0000000..3f70060 --- /dev/null +++ b/manifests/helm/microforge/templates/frontend-service-service.yaml @@ -0,0 +1,18 @@ +{{- if .Values.frontendService.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.frontendService.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.frontendService.labels" . | nindent 4 }} +spec: + selector: + app: {{ .Values.frontendService.name }} + type: {{ .Values.frontendService.service.type }} + ports: + - name: frontend-service-port + port: {{ .Values.frontendService.service.port }} + targetPort: {{ .Values.frontendService.service.targetPort }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/ingress.yaml b/manifests/helm/microforge/templates/ingress.yaml new file mode 100644 index 0000000..ffe248a --- /dev/null +++ b/manifests/helm/microforge/templates/ingress.yaml @@ -0,0 +1,69 @@ +{{- if .Values.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "microforge.fullname" . }}-ingress + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.labels" . | nindent 4 }} + annotations: + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + ingressClassName: {{ .Values.ingress.className }} + {{- if .Values.ingress.tls }} + tls: + {{- toYaml .Values.ingress.tls | nindent 4 }} + {{- end }} + rules: + - host: {{ .Values.ingress.hosts.main }} + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: {{ .Values.frontendService.name }} + port: + number: {{ .Values.frontendService.service.port }} + - host: {{ .Values.ingress.hosts.api }} + http: + paths: + - path: /api/login(/|$)(.*) + pathType: ImplementationSpecific + backend: + service: + name: {{ .Values.loginService.name }} + port: + number: {{ .Values.loginService.service.port }} + - path: /api/metadata(/|$)(.*) + pathType: ImplementationSpecific + backend: + service: + name: {{ .Values.metadataService.name }} + port: + number: {{ .Values.metadataService.service.port }} + - path: /api/stress(/|$)(.*) + pathType: ImplementationSpecific + backend: + service: + name: {{ .Values.metadataService.name }} + port: + number: {{ .Values.metadataService.service.port }} + - path: /api/notifications(/|$)(.*) + pathType: ImplementationSpecific + backend: + service: + name: {{ .Values.notificationService.name }} + port: + number: {{ .Values.notificationService.service.port }} + - path: /api/auth(/|$)(.*) + pathType: ImplementationSpecific + backend: + service: + name: {{ .Values.authService.name }} + port: + number: {{ .Values.authService.service.port }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/login-mysql-configmap.yaml b/manifests/helm/microforge/templates/login-mysql-configmap.yaml new file mode 100644 index 0000000..63d73dd --- /dev/null +++ b/manifests/helm/microforge/templates/login-mysql-configmap.yaml @@ -0,0 +1,10 @@ +{{- if .Values.loginMysql.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.loginMysql.name }}-config + namespace: {{ include "microforge.namespace" . }} +data: + MYSQL_DATABASE: {{ .Values.loginMysql.config.database }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/login-mysql-deployment.yaml b/manifests/helm/microforge/templates/login-mysql-deployment.yaml new file mode 100644 index 0000000..3ad61b8 --- /dev/null +++ b/manifests/helm/microforge/templates/login-mysql-deployment.yaml @@ -0,0 +1,44 @@ +{{- if .Values.loginMysql.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.loginMysql.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.loginMysql.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.loginMysql.replicaCount }} + selector: + matchLabels: + app: {{ .Values.loginMysql.name }} + template: + metadata: + labels: + app: {{ .Values.loginMysql.name }} + spec: + containers: + - name: {{ .Values.loginMysql.name }} + image: "{{ .Values.loginMysql.image.repository }}:{{ .Values.loginMysql.image.tag }}" + imagePullPolicy: {{ .Values.loginMysql.image.pullPolicy }} + ports: + - containerPort: {{ .Values.loginMysql.service.targetPort }} + envFrom: + - configMapRef: + name: {{ .Values.loginMysql.name }}-config + - secretRef: + name: {{ .Values.loginMysql.name }}-secret + resources: + {{- toYaml .Values.loginMysql.resources | nindent 10 }} + {{- if .Values.loginMysql.persistence.enabled }} + volumeMounts: + - name: mysql-data + mountPath: /var/lib/mysql + {{- end }} + {{- if .Values.loginMysql.persistence.enabled }} + volumes: + - name: mysql-data + persistentVolumeClaim: + claimName: {{ .Values.loginMysql.name }}-pvc + {{- end }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/login-mysql-pvc.yaml b/manifests/helm/microforge/templates/login-mysql-pvc.yaml new file mode 100644 index 0000000..1ca67b0 --- /dev/null +++ b/manifests/helm/microforge/templates/login-mysql-pvc.yaml @@ -0,0 +1,19 @@ +{{- if and .Values.loginMysql.enabled .Values.loginMysql.persistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Values.loginMysql.name }}-pvc + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.loginMysql.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.loginMysql.persistence.accessMode }} + {{- if .Values.loginMysql.persistence.storageClass }} + storageClassName: {{ .Values.loginMysql.persistence.storageClass }} + {{- end }} + resources: + requests: + storage: {{ .Values.loginMysql.persistence.size }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/login-mysql-secret.yaml b/manifests/helm/microforge/templates/login-mysql-secret.yaml new file mode 100644 index 0000000..3c6d3e8 --- /dev/null +++ b/manifests/helm/microforge/templates/login-mysql-secret.yaml @@ -0,0 +1,11 @@ +{{- if .Values.loginMysql.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.loginMysql.name }}-secret + namespace: {{ include "microforge.namespace" . }} +type: Opaque +stringData: + MYSQL_ROOT_PASSWORD: {{ .Values.loginMysql.secrets.rootPassword }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/login-mysql-service.yaml b/manifests/helm/microforge/templates/login-mysql-service.yaml new file mode 100644 index 0000000..5750cdf --- /dev/null +++ b/manifests/helm/microforge/templates/login-mysql-service.yaml @@ -0,0 +1,18 @@ +{{- if .Values.loginMysql.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.loginMysql.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.loginMysql.labels" . | nindent 4 }} +spec: + selector: + app: {{ .Values.loginMysql.name }} + type: {{ .Values.loginMysql.service.type }} + ports: + - name: mysql-port + port: {{ .Values.loginMysql.service.port }} + targetPort: {{ .Values.loginMysql.service.targetPort }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/login-service-configmap.yaml b/manifests/helm/microforge/templates/login-service-configmap.yaml new file mode 100644 index 0000000..6ea6db8 --- /dev/null +++ b/manifests/helm/microforge/templates/login-service-configmap.yaml @@ -0,0 +1,14 @@ +{{- if .Values.loginService.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.loginService.name }}-config + namespace: {{ include "microforge.namespace" . }} +data: + LOGIN_SERVICE_PORT: {{ .Values.loginService.config.port | quote }} + DB_PORT: {{ .Values.loginService.config.dbPort | quote }} + DB_NAME: {{ .Values.loginService.config.dbName }} + JWT_EXPIRATION_MS: {{ .Values.loginService.config.jwtExpirationMs | quote }} + NOTIFICATION_SERVICE_URL: {{ .Values.loginService.config.notificationServiceUrl }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/login-service-deployment.yaml b/manifests/helm/microforge/templates/login-service-deployment.yaml new file mode 100644 index 0000000..48d4cac --- /dev/null +++ b/manifests/helm/microforge/templates/login-service-deployment.yaml @@ -0,0 +1,36 @@ +{{- if .Values.loginService.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.loginService.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.loginService.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.loginService.replicaCount }} + selector: + matchLabels: + app: {{ .Values.loginService.name }} + template: + metadata: + labels: + app: {{ .Values.loginService.name }} + spec: + containers: + - name: {{ .Values.loginService.name }} + image: "{{ .Values.loginService.image.repository }}:{{ .Values.loginService.image.tag }}" + imagePullPolicy: {{ .Values.loginService.image.pullPolicy }} + ports: + - containerPort: {{ .Values.loginService.service.targetPort }} + env: + - name: DB_HOST + value: {{ .Values.loginMysql.name }} + envFrom: + - configMapRef: + name: {{ .Values.loginService.name }}-config + - secretRef: + name: {{ .Values.loginService.name }}-secret + resources: + {{- toYaml .Values.loginService.resources | nindent 10 }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/login-service-secret.yaml b/manifests/helm/microforge/templates/login-service-secret.yaml new file mode 100644 index 0000000..75b52aa --- /dev/null +++ b/manifests/helm/microforge/templates/login-service-secret.yaml @@ -0,0 +1,13 @@ +{{- if .Values.loginService.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.loginService.name }}-secret + namespace: {{ include "microforge.namespace" . }} +type: Opaque +stringData: + DB_USERNAME: {{ .Values.loginService.secrets.dbUsername }} + DB_PASSWORD: {{ .Values.loginService.secrets.dbPassword }} + JWT_SECRET: {{ .Values.loginService.secrets.jwtSecret }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/login-service-service.yaml b/manifests/helm/microforge/templates/login-service-service.yaml new file mode 100644 index 0000000..a88f230 --- /dev/null +++ b/manifests/helm/microforge/templates/login-service-service.yaml @@ -0,0 +1,18 @@ +{{- if .Values.loginService.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.loginService.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.loginService.labels" . | nindent 4 }} +spec: + selector: + app: {{ .Values.loginService.name }} + type: {{ .Values.loginService.service.type }} + ports: + - name: login-service-port + port: {{ .Values.loginService.service.port }} + targetPort: {{ .Values.loginService.service.targetPort }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/metadata-service-configmap.yaml b/manifests/helm/microforge/templates/metadata-service-configmap.yaml new file mode 100644 index 0000000..4ab41ba --- /dev/null +++ b/manifests/helm/microforge/templates/metadata-service-configmap.yaml @@ -0,0 +1,11 @@ +{{- if .Values.metadataService.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.metadataService.name }}-config + namespace: {{ include "microforge.namespace" . }} +data: + METADATA_SERVICE_PORT: {{ .Values.metadataService.config.port | quote }} + FLASK_ENV: {{ .Values.metadataService.config.flaskEnv }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/metadata-service-deployment.yaml b/manifests/helm/microforge/templates/metadata-service-deployment.yaml new file mode 100644 index 0000000..69a7fcb --- /dev/null +++ b/manifests/helm/microforge/templates/metadata-service-deployment.yaml @@ -0,0 +1,33 @@ +{{- if .Values.metadataService.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.metadataService.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.metadataService.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.metadataService.replicaCount }} + selector: + matchLabels: + app: {{ .Values.metadataService.name }} + template: + metadata: + labels: + app: {{ .Values.metadataService.name }} + spec: + containers: + - name: {{ .Values.metadataService.name }} + image: "{{ .Values.metadataService.image.repository }}:{{ .Values.metadataService.image.tag }}" + imagePullPolicy: {{ .Values.metadataService.image.pullPolicy }} + ports: + - containerPort: {{ .Values.metadataService.service.targetPort }} + envFrom: + - configMapRef: + name: {{ .Values.metadataService.name }}-config + - secretRef: + name: {{ .Values.metadataService.name }}-secret + resources: + {{- toYaml .Values.metadataService.resources | nindent 10 }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/metadata-service-secret.yaml b/manifests/helm/microforge/templates/metadata-service-secret.yaml new file mode 100644 index 0000000..dae934d --- /dev/null +++ b/manifests/helm/microforge/templates/metadata-service-secret.yaml @@ -0,0 +1,11 @@ +{{- if .Values.metadataService.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.metadataService.name }}-secret + namespace: {{ include "microforge.namespace" . }} +type: Opaque +stringData: + FLASK_SECRET_KEY: {{ .Values.metadataService.secrets.flaskSecretKey }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/metadata-service-service.yaml b/manifests/helm/microforge/templates/metadata-service-service.yaml new file mode 100644 index 0000000..2237aa7 --- /dev/null +++ b/manifests/helm/microforge/templates/metadata-service-service.yaml @@ -0,0 +1,18 @@ +{{- if .Values.metadataService.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.metadataService.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.metadataService.labels" . | nindent 4 }} +spec: + selector: + app: {{ .Values.metadataService.name }} + type: {{ .Values.metadataService.service.type }} + ports: + - name: metadata-service-port + port: {{ .Values.metadataService.service.port }} + targetPort: {{ .Values.metadataService.service.targetPort }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/namespace.yaml b/manifests/helm/microforge/templates/namespace.yaml new file mode 100644 index 0000000..a50e3ed --- /dev/null +++ b/manifests/helm/microforge/templates/namespace.yaml @@ -0,0 +1,11 @@ +{{- if .Values.namespace.create }} +apiVersion: v1 +kind: Namespace +metadata: + name: {{ include "microforge.namespace" . }} + labels: + {{- range $key, $value := .Values.namespace.labels }} + {{ $key }}: {{ $value }} + {{- end }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/notification-mysql-configmap.yaml b/manifests/helm/microforge/templates/notification-mysql-configmap.yaml new file mode 100644 index 0000000..131cc34 --- /dev/null +++ b/manifests/helm/microforge/templates/notification-mysql-configmap.yaml @@ -0,0 +1,10 @@ +{{- if .Values.notificationMysql.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.notificationMysql.name }}-config + namespace: {{ include "microforge.namespace" . }} +data: + MYSQL_DATABASE: {{ .Values.notificationMysql.config.database }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/notification-mysql-deployment.yaml b/manifests/helm/microforge/templates/notification-mysql-deployment.yaml new file mode 100644 index 0000000..b446971 --- /dev/null +++ b/manifests/helm/microforge/templates/notification-mysql-deployment.yaml @@ -0,0 +1,44 @@ +{{- if .Values.notificationMysql.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.notificationMysql.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.notificationMysql.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.notificationMysql.replicaCount }} + selector: + matchLabels: + app: {{ .Values.notificationMysql.name }} + template: + metadata: + labels: + app: {{ .Values.notificationMysql.name }} + spec: + containers: + - name: {{ .Values.notificationMysql.name }} + image: "{{ .Values.notificationMysql.image.repository }}:{{ .Values.notificationMysql.image.tag }}" + imagePullPolicy: {{ .Values.notificationMysql.image.pullPolicy }} + ports: + - containerPort: {{ .Values.notificationMysql.service.targetPort }} + envFrom: + - configMapRef: + name: {{ .Values.notificationMysql.name }}-config + - secretRef: + name: {{ .Values.notificationMysql.name }}-secret + resources: + {{- toYaml .Values.notificationMysql.resources | nindent 10 }} + {{- if .Values.notificationMysql.persistence.enabled }} + volumeMounts: + - name: mysql-data + mountPath: /var/lib/mysql + {{- end }} + {{- if .Values.notificationMysql.persistence.enabled }} + volumes: + - name: mysql-data + persistentVolumeClaim: + claimName: {{ .Values.notificationMysql.name }}-pvc + {{- end }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/notification-mysql-pvc.yaml b/manifests/helm/microforge/templates/notification-mysql-pvc.yaml new file mode 100644 index 0000000..af4d8f4 --- /dev/null +++ b/manifests/helm/microforge/templates/notification-mysql-pvc.yaml @@ -0,0 +1,19 @@ +{{- if and .Values.notificationMysql.enabled .Values.notificationMysql.persistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Values.notificationMysql.name }}-pvc + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.notificationMysql.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.notificationMysql.persistence.accessMode }} + {{- if .Values.notificationMysql.persistence.storageClass }} + storageClassName: {{ .Values.notificationMysql.persistence.storageClass }} + {{- end }} + resources: + requests: + storage: {{ .Values.notificationMysql.persistence.size }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/notification-mysql-secret.yaml b/manifests/helm/microforge/templates/notification-mysql-secret.yaml new file mode 100644 index 0000000..fd0f6eb --- /dev/null +++ b/manifests/helm/microforge/templates/notification-mysql-secret.yaml @@ -0,0 +1,11 @@ +{{- if .Values.notificationMysql.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.notificationMysql.name }}-secret + namespace: {{ include "microforge.namespace" . }} +type: Opaque +stringData: + MYSQL_ROOT_PASSWORD: {{ .Values.notificationMysql.secrets.rootPassword }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/notification-mysql-service.yaml b/manifests/helm/microforge/templates/notification-mysql-service.yaml new file mode 100644 index 0000000..2d0751b --- /dev/null +++ b/manifests/helm/microforge/templates/notification-mysql-service.yaml @@ -0,0 +1,18 @@ +{{- if .Values.notificationMysql.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.notificationMysql.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.notificationMysql.labels" . | nindent 4 }} +spec: + selector: + app: {{ .Values.notificationMysql.name }} + type: {{ .Values.notificationMysql.service.type }} + ports: + - name: mysql-port + port: {{ .Values.notificationMysql.service.port }} + targetPort: {{ .Values.notificationMysql.service.targetPort }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/notification-service-configmap.yaml b/manifests/helm/microforge/templates/notification-service-configmap.yaml new file mode 100644 index 0000000..8200a84 --- /dev/null +++ b/manifests/helm/microforge/templates/notification-service-configmap.yaml @@ -0,0 +1,12 @@ +{{- if .Values.notificationService.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.notificationService.name }}-config + namespace: {{ include "microforge.namespace" . }} +data: + NOTIFICATION_SERVICE_PORT: {{ .Values.notificationService.config.port | quote }} + MYSQL_PORT: {{ .Values.notificationService.config.mysqlPort | quote }} + MYSQL_DATABASE: {{ .Values.notificationService.config.mysqlDatabase }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/notification-service-deployment.yaml b/manifests/helm/microforge/templates/notification-service-deployment.yaml new file mode 100644 index 0000000..6300132 --- /dev/null +++ b/manifests/helm/microforge/templates/notification-service-deployment.yaml @@ -0,0 +1,36 @@ +{{- if .Values.notificationService.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.notificationService.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.notificationService.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.notificationService.replicaCount }} + selector: + matchLabels: + app: {{ .Values.notificationService.name }} + template: + metadata: + labels: + app: {{ .Values.notificationService.name }} + spec: + containers: + - name: {{ .Values.notificationService.name }} + image: "{{ .Values.notificationService.image.repository }}:{{ .Values.notificationService.image.tag }}" + imagePullPolicy: {{ .Values.notificationService.image.pullPolicy }} + ports: + - containerPort: {{ .Values.notificationService.service.targetPort }} + env: + - name: MYSQL_HOST + value: {{ .Values.notificationMysql.name }} + envFrom: + - configMapRef: + name: {{ .Values.notificationService.name }}-config + - secretRef: + name: {{ .Values.notificationService.name }}-secret + resources: + {{- toYaml .Values.notificationService.resources | nindent 10 }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/notification-service-secret.yaml b/manifests/helm/microforge/templates/notification-service-secret.yaml new file mode 100644 index 0000000..df37a76 --- /dev/null +++ b/manifests/helm/microforge/templates/notification-service-secret.yaml @@ -0,0 +1,12 @@ +{{- if .Values.notificationService.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.notificationService.name }}-secret + namespace: {{ include "microforge.namespace" . }} +type: Opaque +stringData: + MYSQL_USER: {{ .Values.notificationService.secrets.mysqlUser }} + MYSQL_PASSWORD: {{ .Values.notificationService.secrets.mysqlPassword }} +{{- end }} + diff --git a/manifests/helm/microforge/templates/notification-service-service.yaml b/manifests/helm/microforge/templates/notification-service-service.yaml new file mode 100644 index 0000000..4bf5402 --- /dev/null +++ b/manifests/helm/microforge/templates/notification-service-service.yaml @@ -0,0 +1,18 @@ +{{- if .Values.notificationService.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.notificationService.name }} + namespace: {{ include "microforge.namespace" . }} + labels: + {{- include "microforge.notificationService.labels" . | nindent 4 }} +spec: + selector: + app: {{ .Values.notificationService.name }} + type: {{ .Values.notificationService.service.type }} + ports: + - name: notification-service-port + port: {{ .Values.notificationService.service.port }} + targetPort: {{ .Values.notificationService.service.targetPort }} +{{- end }} + diff --git a/manifests/helm/microforge/values-production.yaml b/manifests/helm/microforge/values-production.yaml new file mode 100644 index 0000000..ac9b078 --- /dev/null +++ b/manifests/helm/microforge/values-production.yaml @@ -0,0 +1,121 @@ +# Production values for MicroForge +# Override default values for production deployment + +global: + namespace: microforge-prod-ns + environment: production + +namespace: + create: true + name: microforge-prod-ns + labels: + environment: production + +# Ingress with TLS +ingress: + enabled: true + className: nginx + hosts: + main: microforge.example.com + api: api.microforge.example.com + tls: + - secretName: microforge-tls + hosts: + - microforge.example.com + - api.microforge.example.com + +# Frontend Service - Multiple replicas for HA +frontendService: + replicaCount: 3 + resources: + limits: + cpu: 1000m + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + +# Auth Service - Multiple replicas +authService: + replicaCount: 2 + resources: + limits: + cpu: 1000m + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + +# Login Service - Multiple replicas with higher resources +loginService: + replicaCount: 3 + resources: + limits: + cpu: 2000m + memory: 2Gi + requests: + cpu: 1000m + memory: 1Gi + secrets: + # IMPORTANT: Change these in production! + dbUsername: produser + dbPassword: CHANGE_ME_PRODUCTION_PASSWORD + jwtSecret: CHANGE_ME_PRODUCTION_JWT_SECRET + +# Metadata Service +metadataService: + replicaCount: 2 + config: + flaskEnv: production + resources: + limits: + cpu: 1000m + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + secrets: + # IMPORTANT: Change this in production! + flaskSecretKey: CHANGE_ME_PRODUCTION_FLASK_KEY + +# Notification Service +notificationService: + replicaCount: 2 + resources: + limits: + cpu: 1000m + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + secrets: + # IMPORTANT: Change these in production! + mysqlUser: produser + mysqlPassword: CHANGE_ME_PRODUCTION_PASSWORD + +# Production should use external managed databases +# Disable internal MySQL deployments +loginMysql: + enabled: false + +notificationMysql: + enabled: false + +# If using internal MySQL (not recommended for production): +# loginMysql: +# enabled: true +# replicaCount: 1 +# persistence: +# enabled: true +# storageClass: "fast-ssd" +# size: 50Gi +# resources: +# limits: +# cpu: 2000m +# memory: 4Gi +# requests: +# cpu: 1000m +# memory: 2Gi +# secrets: +# rootPassword: CHANGE_ME_PRODUCTION_PASSWORD + diff --git a/manifests/helm/microforge/values-staging.yaml b/manifests/helm/microforge/values-staging.yaml new file mode 100644 index 0000000..43a510f --- /dev/null +++ b/manifests/helm/microforge/values-staging.yaml @@ -0,0 +1,98 @@ +# Staging values for MicroForge +# Override default values for staging deployment + +global: + namespace: microforge-staging-ns + environment: staging + +namespace: + create: true + name: microforge-staging-ns + labels: + environment: staging + +ingress: + enabled: true + className: nginx + hosts: + main: microforge-staging.example.com + api: api-staging.microforge.example.com + +# Moderate replica counts for staging +frontendService: + replicaCount: 2 + resources: + limits: + cpu: 750m + memory: 768Mi + requests: + cpu: 375m + memory: 384Mi + +authService: + replicaCount: 2 + resources: + limits: + cpu: 750m + memory: 768Mi + requests: + cpu: 375m + memory: 384Mi + +loginService: + replicaCount: 2 + resources: + limits: + cpu: 1500m + memory: 1536Mi + requests: + cpu: 750m + memory: 768Mi + secrets: + dbUsername: staginguser + dbPassword: CHANGE_ME_STAGING_PASSWORD + jwtSecret: CHANGE_ME_STAGING_JWT_SECRET + +metadataService: + replicaCount: 1 + config: + flaskEnv: staging + secrets: + flaskSecretKey: CHANGE_ME_STAGING_FLASK_KEY + +notificationService: + replicaCount: 1 + secrets: + mysqlUser: staginguser + mysqlPassword: CHANGE_ME_STAGING_PASSWORD + +loginMysql: + enabled: true + persistence: + enabled: true + size: 10Gi + resources: + limits: + cpu: 1500m + memory: 2Gi + requests: + cpu: 750m + memory: 1Gi + secrets: + rootPassword: CHANGE_ME_STAGING_PASSWORD + +notificationMysql: + enabled: true + persistence: + enabled: true + size: 10Gi + resources: + limits: + cpu: 1500m + memory: 2Gi + requests: + cpu: 750m + memory: 1Gi + secrets: + rootPassword: CHANGE_ME_STAGING_PASSWORD + diff --git a/manifests/helm/microforge/values.yaml b/manifests/helm/microforge/values.yaml new file mode 100644 index 0000000..800962c --- /dev/null +++ b/manifests/helm/microforge/values.yaml @@ -0,0 +1,237 @@ +# Default values for MicroForge +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# Global settings +global: + namespace: microforge-dev-ns + environment: development + +# Namespace configuration +namespace: + create: true + name: microforge-dev-ns + labels: + environment: dev + +# Ingress configuration +ingress: + enabled: true + className: nginx + annotations: + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/enable-cors: "true" + nginx.ingress.kubernetes.io/cors-allow-origin: "*" + nginx.ingress.kubernetes.io/cors-allow-methods: "GET, POST, PUT, DELETE, OPTIONS" + nginx.ingress.kubernetes.io/cors-allow-headers: "Authorization, Content-Type, Accept, Origin, User-Agent, Cache-Control, Keep-Alive" + nginx.ingress.kubernetes.io/cors-max-age: "86400" + hosts: + main: microforge.local + api: api.microforge.local + tls: [] + +# Frontend Service Configuration +frontendService: + enabled: true + name: frontend-service + replicaCount: 1 + image: + repository: manojmdocker14/microforge-frontend-service + tag: v1.1.0 + pullPolicy: IfNotPresent + service: + type: LoadBalancer + port: 3000 + targetPort: 80 + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 250m + memory: 256Mi + config: + reactAppLoginServiceUrl: http://localhost:8081 + reactAppAuthServiceUrl: http://localhost:8082 + reactAppNotificationServiceUrl: http://localhost:8083 + reactAppMetadataServiceUrl: http://localhost:8084 + reactAppApiBaseUrl: http://localhost:3000 + +# Auth Service Configuration +authService: + enabled: true + name: auth-service + replicaCount: 1 + image: + repository: manojmdocker14/microforge-auth-service + tag: v1.1.0 + pullPolicy: IfNotPresent + service: + type: LoadBalancer + port: 8082 + targetPort: 8082 + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 250m + memory: 256Mi + config: + port: "8082" + +# Login Service Configuration +loginService: + enabled: true + name: login-service + replicaCount: 1 + image: + repository: manojmdocker14/microforge-login-service + tag: v1.2.0 + pullPolicy: IfNotPresent + service: + type: LoadBalancer + port: 8081 + targetPort: 8081 + resources: + limits: + cpu: 1000m + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + config: + port: "8081" + dbPort: "3306" + dbName: empdir + jwtExpirationMs: "86400000" + notificationServiceUrl: http://notification-service:8083 + secrets: + # Values are read from src/.env file via install script + # Default values from .env file: + dbUsername: root + dbPassword: loginroot + jwtSecret: wybg9X4lzPycHWrvCBkPvssgGq3OowN2JWvQqOoe/g/u9wKiXXv71NAdngG83DFx + +# Metadata Service Configuration +metadataService: + enabled: true + name: metadata-service + replicaCount: 1 + image: + repository: manojmdocker14/microforge-metadata-service + tag: v1.0.0 + pullPolicy: IfNotPresent + service: + type: LoadBalancer + port: 8084 + targetPort: 8084 + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 250m + memory: 256Mi + config: + port: "8084" + flaskEnv: development + secrets: + # Values are read from src/.env file via install script + # Default value from .env file: + flaskSecretKey: f9731e7a0774ddebd70643e8c6046f4dc0ddf3eec637be8cb641f0e9d5e8dfd0 + +# Notification Service Configuration +notificationService: + enabled: true + name: notification-service + replicaCount: 1 + image: + repository: manojmdocker14/microforge-notification-service + tag: v1.0.0 + pullPolicy: IfNotPresent + service: + type: LoadBalancer + port: 8083 + targetPort: 8083 + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 250m + memory: 256Mi + config: + port: "8083" + mysqlPort: "3306" + mysqlDatabase: empnotification + secrets: + # Values are read from src/.env file via install script + # Default values from .env file: + mysqlUser: root + mysqlPassword: root + +# Login MySQL Configuration +loginMysql: + enabled: true + name: login-mysql + replicaCount: 1 + image: + repository: manojmdocker14/microforge-users-mysql + tag: v1.0.0 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 3306 + targetPort: 3306 + resources: + limits: + cpu: 1000m + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + persistence: + enabled: true + storageClass: "" + accessMode: ReadWriteOnce + size: 5Gi + config: + database: empdir + secrets: + # Values are read from src/.env file via install script + # Default value from .env file: + rootPassword: loginroot + +# Notification MySQL Configuration +notificationMysql: + enabled: true + name: notification-mysql + replicaCount: 1 + image: + repository: manojmdocker14/microforge-notifications-mysql + tag: v1.0.0 + pullPolicy: IfNotPresent + service: + type: ClusterIP + port: 3306 + targetPort: 3306 + resources: + limits: + cpu: 1000m + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + persistence: + enabled: true + storageClass: "" + accessMode: ReadWriteOnce + size: 5Gi + config: + database: empnotification + secrets: + # Values are read from src/.env file via install script + # Default value from .env file: + rootPassword: root +