Add helm chart contents (not as submodule)

This commit is contained in:
Vaibhav Pathak 2026-01-05 17:48:44 +05:30
parent 911f8d28a1
commit 4af16bfecb
20 changed files with 9904 additions and 1 deletions

1
helm

@ -1 +0,0 @@
Subproject commit f52bd12a9af6b44277d1277b505691511e92eca6

6
helm/hades/Chart.lock Normal file
View File

@ -0,0 +1,6 @@
dependencies:
- name: mysql
repository: https://helm.wso2.com
version: 1.6.9
digest: sha256:bdbd774f845f1f0f4b7346e75b80f6c2e244cf92cf9feacf3d4807f8e50f9bce
generated: "2025-12-04T17:14:59.470658+05:30"

22
helm/hades/Chart.yaml Normal file
View File

@ -0,0 +1,22 @@
apiVersion: v2
name: hades
description: Hades V2 - Authentication and Authorization Service
type: application
version: 1.0.0
appVersion: "3.0"
keywords:
- authentication
- authorization
- java
- servlet
home: https://github.com/yourorg/hades-service
sources:
- https://github.com/yourorg/hades-service
maintainers:
- name: Platform Team
email: platform-team@company.com
dependencies:
- name: mysql
version: 1.6.9
repository: https://helm.wso2.com
condition: mysql.enabled

View File

@ -0,0 +1,4 @@
-- Database hades_db is automatically created by MySQL Helm chart
-- This file runs first to ensure proper migration ordering
SELECT 'Database migration starting for hades_db' AS message;

View File

@ -0,0 +1,5 @@
-- Database initialization
-- Note: The original query attempted to write to OUTFILE which requires FILE privilege
-- and is not suitable for containerized environments.
-- If you need to truncate tables, add explicit TRUNCATE statements here.
SELECT 'Database hades_db is ready for migrations' as status;

2954
helm/hades/sql/002_dump.sql Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,71 @@
use hades_db;
SET FOREIGN_KEY_CHECKS = 0;
-- source /var/lib/mysql-files/truncate.sql;
-- Note: The truncate.sql file is not being generated anymore.
-- If you need to truncate tables, add explicit TRUNCATE statements here.
SET FOREIGN_KEY_CHECKS = 1;
ALTER TABLE agencies_id_generator AUTO_INCREMENT = 1000;
ALTER TABLE clients_id_generator AUTO_INCREMENT = 2000;
ALTER TABLE mccs_id_generator AUTO_INCREMENT = 3000;
ALTER TABLE users_v3 AUTO_INCREMENT = 10000;
ALTER TABLE auth_provider_metadata_v2 AUTO_INCREMENT = 20000;
INSERT IGNORE INTO status_types (name) VALUES ('ACTIVE');
INSERT IGNORE INTO status_types (name) VALUES ('INACTIVE');
INSERT IGNORE INTO status_types (name) VALUES ('BLOCKED');
INSERT IGNORE INTO organization_types (name) VALUES ('CLIENT');
INSERT IGNORE INTO organization_types (name) VALUES ('AGENCY');
INSERT IGNORE INTO access_roles (name) VALUES ('READ');
INSERT IGNORE INTO access_roles (name) VALUES ('READ_WRITE');
INSERT IGNORE INTO access_roles (name) VALUES ('ADMIN');
INSERT IGNORE INTO auth_provider_types (name) VALUES ('EMAIL');
INSERT IGNORE INTO auth_provider_types (name) VALUES ('MOBILE');
INSERT IGNORE INTO teams (id, name, status_type_id) VALUES
(1, 'analytics', 1),
(2, 'branding', 1),
(4, 'core-reporting', 1),
(5, 'growth-apps', 1),
(6, 'heisenberg', 1),
(7, 'hercules', 1),
(8, 'infra', 1),
(9, 'iris', 1),
(10, 'iris-reporting', 1),
(11, 'lcs-analytics', 1),
(12, 'marketing', 1),
(13, 'merchandise', 1),
(14, 'platform', 1),
(15, 'revx', 1),
(16, 'scorpii', 1),
(17, 'smb-dev', 1),
(18, 'sokrati-dev', 1),
(19, 'tafStore', 1),
(20, 'tracking', 1),
(21, 'unified-tracking', 1);
INSERT IGNORE INTO auth_channels (id, name) VALUES(1, 'SOKRATI');
INSERT IGNORE INTO auth_channels (id, name) VALUES(2, 'LINKEDIN');
INSERT IGNORE INTO auth_channels (id, name) VALUES(3, 'SHOPIFY');
INSERT IGNORE INTO auth_channels (id, name) VALUES(4, 'BIGCOMMERCE');
INSERT IGNORE INTO auth_channels (id, name) VALUES(5, 'FACEBOOK');
INSERT IGNORE INTO auth_channels (id, name) VALUES(6, 'GOOGLE');
INSERT IGNORE INTO auth_channel_keys (auth_channel_id, `key`) VALUES (2, 'firstName');
INSERT IGNORE INTO auth_channel_keys (auth_channel_id, `key`) VALUES (2, 'lastName');
INSERT IGNORE INTO auth_channel_keys (auth_channel_id, `key`) VALUES (2, 'headline');
INSERT IGNORE INTO auth_channel_keys (auth_channel_id, `key`) VALUES (2, 'pictureUrl');
INSERT IGNORE INTO entity_types(id, name) VALUES (1, 'CLIENT'), (2, 'AGENCY'), (3, 'MCC');
INSERT IGNORE INTO access_permissions(id, name) VALUES (1, 'OPEN_END_POINT'), (2, 'ACL_FREE'), (3, 'ACL_APP'), (4, 'ACL_TOKEN_CHECK'), (5, 'ACL_READ'), (6, 'ACL_WRITE'), (7, 'ACL_ADMIN');
INSERT IGNORE INTO access_role_permission_mappings(access_role_id, permission_id) VALUES (1, 5), (2, 5), (2, 6), (3, 5), (3, 6), (3, 7);
INSERT IGNORE INTO apps (id, name, token) VALUES (1, 'HADES', '9d4a2fc3024a600f96c1b7c589ea164b');
INSERT IGNORE INTO app_ips_accesses (app_id, ipaddress) VALUES (1, '127.0.0.1');

2802
helm/hades/sql/004_hades.sql Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,133 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "hades.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
*/}}
{{- define "hades.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 "hades.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "hades.labels" -}}
helm.sh/chart: {{ include "hades.chart" . }}
{{ include "hades.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.commonLabels }}
{{ toYaml . }}
{{- end }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "hades.selectorLabels" -}}
app.kubernetes.io/name: {{ include "hades.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "hades.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "hades.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Get database host
*/}}
{{- define "hades.databaseHost" -}}
{{- if .Values.mysql.enabled }}
{{- if .Values.mysql.fullnameOverride }}
{{- .Values.mysql.fullnameOverride }}
{{- else }}
{{- printf "%s-mysql" (include "hades.fullname" .) }}
{{- end }}
{{- else }}
{{- .Values.database.host }}
{{- end }}
{{- end }}
{{/*
Get database port
*/}}
{{- define "hades.databasePort" -}}
{{- if .Values.mysql.enabled }}
{{- print "3306" }}
{{- else }}
{{- .Values.database.port }}
{{- end }}
{{- end }}
{{/*
Get database name
*/}}
{{- define "hades.databaseName" -}}
{{- if .Values.mysql.enabled }}
{{- .Values.mysql.mysqlDatabase }}
{{- else }}
{{- .Values.database.name }}
{{- end }}
{{- end }}
{{/*
Get database username
*/}}
{{- define "hades.databaseUsername" -}}
{{- if .Values.mysql.enabled }}
{{- .Values.mysql.mysqlUser }}
{{- else }}
{{- .Values.database.username }}
{{- end }}
{{- end }}
{{/*
Get database secret name
*/}}
{{- define "hades.databaseSecretName" -}}
{{- if .Values.mysql.enabled }}
{{- if .Values.mysql.fullnameOverride }}
{{- .Values.mysql.fullnameOverride }}
{{- else }}
{{- printf "%s-mysql" (include "hades.fullname" .) }}
{{- end }}
{{- else }}
{{- printf "%s-db" (include "hades.fullname" .) }}
{{- end }}
{{- end }}
{{/*
Create JDBC connection string
*/}}
{{- define "hades.jdbcUrl" -}}
{{- printf "jdbc:mysql://%s:%s/%s?useSSL=false&serverTimezone=UTC&characterEncoding=utf8" (include "hades.databaseHost" .) (include "hades.databasePort" .) (include "hades.databaseName" .) }}
{{- end }}

View File

@ -0,0 +1,13 @@
{{- if .Values.dbInit.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "hades.fullname" . }}-sql-migrations
labels:
{{- include "hades.labels" . | nindent 4 }}
app.kubernetes.io/component: dbinit
binaryData:
{{- range $path, $_ := .Files.Glob "sql/004_*.sql" }}
{{ base $path }}: {{ $.Files.Get $path | b64enc }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,12 @@
{{- if .Values.config.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "hades.fullname" . }}-config
labels:
{{- include "hades.labels" . | nindent 4 }}
data:
{{- with .Values.config.files }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,163 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "hades.fullname" . }}
labels:
{{- include "hades.labels" . | nindent 4 }}
annotations:
# ArgoCD sync wave - run after dbinit job (wave 0)
argocd.argoproj.io/sync-wave: "1"
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "hades.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "hades.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "hades.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
# Wait for MySQL to be ready
- name: wait-for-mysql
image: busybox:1.36
command:
- sh
- -c
- |
echo "Waiting for MySQL to be ready..."
until nc -z {{ include "hades.databaseHost" . }} {{ include "hades.databasePort" . }}; do
echo "MySQL is unavailable - sleeping"
sleep 2
done
echo "MySQL is up - waiting a bit more for it to fully initialize..."
sleep 10
echo "MySQL is ready!"
# Wait for database migrations to complete
- name: wait-for-db-migrations
image: mysql:8.0
env:
- name: MYSQL_HOST
value: {{ include "hades.databaseHost" . | quote }}
- name: MYSQL_PORT
value: {{ include "hades.databasePort" . | quote }}
- name: MYSQL_DATABASE
value: {{ include "hades.databaseName" . | quote }}
- name: MYSQL_USER
value: {{ include "hades.databaseUsername" . | quote }}
- name: MYSQL_PWD
valueFrom:
secretKeyRef:
name: {{ include "hades.databaseSecretName" . }}
key: mysql-password
command:
- sh
- -c
- |
echo "Checking if database migrations have been applied..."
# Wait for MySQL to accept connections
until mysql -h"${MYSQL_HOST}" -P"${MYSQL_PORT}" -u"${MYSQL_USER}" -e "SELECT 1" "${MYSQL_DATABASE}" &> /dev/null; do
echo "Waiting for MySQL to accept connections..."
sleep 2
done
# Check if tables exist (basic migration check)
echo "Verifying database schema..."
TABLE_COUNT=$(mysql -h"${MYSQL_HOST}" -P"${MYSQL_PORT}" -u"${MYSQL_USER}" "${MYSQL_DATABASE}" -sN -e "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='${MYSQL_DATABASE}';")
if [ "$TABLE_COUNT" -gt 0 ]; then
echo "✓ Database migrations completed - found $TABLE_COUNT tables"
else
echo "⚠ Warning: No tables found in database. Migrations may not have completed yet."
echo "Waiting 10 seconds for migrations to apply..."
sleep 10
fi
echo "Database is ready for application startup!"
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.targetPort }}
protocol: TCP
{{- if .Values.livenessProbe }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
{{- end }}
{{- if .Values.readinessProbe }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
{{- range .Values.env }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
# Database connection environment variables
- name: DB_HOST
value: {{ include "hades.databaseHost" . | quote }}
- name: DB_PORT
value: {{ include "hades.databasePort" . | quote }}
- name: DB_NAME
value: {{ include "hades.databaseName" . | quote }}
- name: DB_USERNAME
value: {{ include "hades.databaseUsername" . | quote }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "hades.databaseSecretName" . }}
key: mysql-password
- name: JDBC_URL
value: {{ include "hades.jdbcUrl" . | quote }}
# Hibernate configuration
- name: HIBERNATE_DIALECT
value: "org.hibernate.dialect.MySQL5Dialect"
- name: HIBERNATE_SHOW_SQL
value: "false"
- name: HIBERNATE_HBM2DDL_AUTO
value: "validate"
{{- if .Values.config.enabled }}
volumeMounts:
- name: config
mountPath: /etc/onlinesales/config/hades
readOnly: true
{{- end }}
{{- if .Values.config.enabled }}
volumes:
- name: config
configMap:
name: {{ include "hades.fullname" . }}-config
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@ -0,0 +1,137 @@
{{- if .Values.dbInit.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "hades.fullname" . }}-dbinit
labels:
{{- include "hades.labels" . | nindent 4 }}
app.kubernetes.io/component: dbinit
annotations:
# ArgoCD sync wave - same wave as MySQL (0), wait-for-db handles timing
argocd.argoproj.io/sync-wave: "0"
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
# Helm hooks (for non-ArgoCD deployments)
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": before-hook-creation
spec:
backoffLimit: 5
ttlSecondsAfterFinished: 300
template:
metadata:
labels:
app.kubernetes.io/component: dbinit
{{- include "hades.selectorLabels" . | nindent 8 }}
spec:
restartPolicy: OnFailure
initContainers:
# Wait for MySQL to be ready
- name: wait-for-db
image: busybox:1.36
command:
- sh
- -c
- |
echo "Waiting for database to be ready..."
until nc -z {{ include "hades.databaseHost" . }} {{ include "hades.databasePort" . }}; do
echo "Database is unavailable - sleeping"
sleep 2
done
echo "Database is up!"
sleep 10
containers:
- name: dbinit
image: mysql:8.0
env:
- name: MYSQL_HOST
value: {{ include "hades.databaseHost" . | quote }}
- name: MYSQL_PORT
value: {{ include "hades.databasePort" . | quote }}
- name: MYSQL_DATABASE
value: {{ include "hades.databaseName" . | quote }}
- name: MYSQL_USER
value: "root"
- name: MYSQL_PWD
valueFrom:
secretKeyRef:
name: {{ include "hades.databaseSecretName" . }}
key: mysql-root-password
command:
- /bin/bash
- -c
- |
set -ex
echo "========================================="
echo "Hades Database Migration"
echo "========================================="
echo "Host: ${MYSQL_HOST}:${MYSQL_PORT}"
echo "Database: ${MYSQL_DATABASE}"
echo "User: ${MYSQL_USER}"
echo "========================================="
# Test connection
echo "Testing database connection..."
if ! mysql -h"${MYSQL_HOST}" -P"${MYSQL_PORT}" -u"root" -e "SELECT 1" "${MYSQL_DATABASE}" &> /dev/null; then
echo "ERROR: Cannot connect to database"
exit 1
fi
echo "✓ Database connection successful"
echo ""
# Apply migrations in order
TOTAL=0
SUCCESS=0
FAILED=0
for sql_file in /migrations/*.sql; do
if [ ! -f "$sql_file" ]; then
continue
fi
filename=$(basename "$sql_file")
TOTAL=$((TOTAL + 1))
echo -n "Applying $filename... "
if mysql -h"${MYSQL_HOST}" -P"${MYSQL_PORT}" -u"root" "${MYSQL_DATABASE}" < "$sql_file" 2>/tmp/migration_error.log; then
echo "✓ SUCCESS"
SUCCESS=$((SUCCESS + 1))
else
echo "✗ FAILED"
echo "Error details:"
cat /tmp/migration_error.log
FAILED=$((FAILED + 1))
# Stop on first error
echo ""
echo "========================================="
echo "Migration failed at: $filename"
echo "========================================="
exit 1
fi
done
echo ""
echo "========================================="
echo "Migration Summary:"
echo " Total: $TOTAL"
echo " Success: $SUCCESS"
echo " Failed: $FAILED"
echo "========================================="
if [ $FAILED -eq 0 ]; then
echo "✓ All migrations completed successfully!"
exit 0
else
echo "✗ Some migrations failed"
exit 1
fi
volumeMounts:
- name: sql-migrations
mountPath: /migrations
volumes:
- name: sql-migrations
configMap:
name: {{ include "hades.fullname" . }}-sql-migrations
{{- end }}

View File

@ -0,0 +1,16 @@
{{- if not .Values.mysql.enabled }}
{{- if .Values.database.password }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "hades.fullname" . }}-db
labels:
{{- include "hades.labels" . | nindent 4 }}
type: Opaque
data:
password: {{ .Values.database.password | b64enc | quote }}
{{- if .Values.database.username }}
username: {{ .Values.database.username | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "hades.fullname" . }}
labels:
{{- include "hades.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "hades.selectorLabels" . | nindent 4 }}

View File

@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "hades.serviceAccountName" . }}
labels:
{{- include "hades.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,90 @@
# Development/Testing values for Hades
# Override default values for ephemeral test environments
replicaCount: 1
image:
repository: localhost:5001/europe-west1-docker.pkg.dev/os-docker-images/onlinesales/prod/services/java/hadesv2
pullPolicy: IfNotPresent
tag: "1764243003606"
# Reduced resources for test environments
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 250m
memory: 256Mi
# Faster health checks for development
livenessProbe:
httpGet:
path: /schedulerService/jobTrigger?jsonQuery=%7B%22application%22%3A%22nagios%22%2C%22jobName%22%3A%22monitoring_scheduler_svc%22%7D
port: http
initialDelaySeconds: 30
periodSeconds: 20
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /schedulerService/jobTrigger?jsonQuery=%7B%22application%22%3A%22nagios%22%2C%22jobName%22%3A%22monitoring_scheduler_svc%22%7D
port: http
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
# Development environment variables
env:
- name: JAVA_OPTS
value: "-Djava.security.egd=file:/dev/./urandom -Xms256m -Xmx1024m -XX:+UseG1GC"
- name: CATALINA_OPTS
value: "-Dconfig.path=/app/config -Denv=development"
- name: TZ
value: "UTC"
- name: LOG_LEVEL
value: "DEBUG"
# No autoscaling in dev
autoscaling:
enabled: false
# Disable ingress in test environments
ingress:
enabled: false
# Simple service configuration
service:
type: ClusterIP
port: 8080
targetPort: 8080
# MySQL configuration for dev environments
mysql:
enabled: true
image:
registry: docker.io/bitnamilegacy
auth:
rootPassword: "dev-root-password"
database: "hadesdb"
username: "hades_user"
password: "dev-hades-password"
primary:
persistence:
enabled: false # Use emptyDir for faster cleanup in test environments
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 250m
memory: 256Mi
metrics:
enabled: false
# Database initialization - disabled by default in dev
# Enable to run SQL migrations from sql/ directory
dbInit:
enabled: false

View File

@ -0,0 +1,325 @@
# Local Kind cluster values for Hades
# Use: helm upgrade --install hades . -f values-local.yaml -n hades --create-namespace
# Allow non-Bitnami images in MySQL subchart
global:
security:
allowInsecureImages: true
replicaCount: 1
# Common labels for testing - enables Backstage Kubernetes plugin discovery
commonLabels:
backstage.io/kubernetes-id: "hades-service"
image:
repository: localhost:5001/prj-onlinesales-prod-01/os-docker-images/onlinesales/prod/services/java/hadesv2
pullPolicy: IfNotPresent
tag: "1765174028641"
# Minimal resources for local development
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 250m
memory: 256Mi
# Disable health probes for local development by setting them to null
# Enable them once you identify a working endpoint in your application
livenessProbe: null
readinessProbe: null
# Development environment variables
env:
#- name: JAVA_OPTS
# value: "-Djava.security.egd=file:/dev/./urandom -Xms256m -Xmx1024m"
- name: CATALINA_OPTS
value: "-Denv=test"
- name: APP_ENV
value: test
#- name: TZ
# value: "UTC"
#- name: LOG_LEVEL
# value: "DEBUG"
# Enable Tomcat HTTP request logging via system properties
#- name: TOMCAT_ACCESS_LOG_ENABLED
# value: "true"
# Log all Catalina, Host, and Context events
#- name: JAVA_TOOL_OPTIONS
# value: "-Dorg.apache.catalina.core.StandardEngine.level=ALL -Dorg.apache.catalina.core.StandardHost.level=ALL"
autoscaling:
enabled: false
ingress:
enabled: false
service:
type: ClusterIP
port: 8080
targetPort: 8080
# MySQL configuration for local development (WSO2 Helm Chart)
mysql:
enabled: true
image: "biarms/mysql"
imageTag: "5.7"
mysqlRootPassword: "local-root-pass"
mysqlDatabase: "hades_db"
mysqlUser: "hades_user"
mysqlPassword: "local-hades-pass"
fullnameOverride: "hades-mysql-db-service"
# Pod labels for MySQL pods - enables Backstage Kubernetes plugin discovery
podLabels:
backstage.io/kubernetes-id: "hades-service"
persistence:
enabled: false # Use emptyDir for local testing
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 256Mi
livenessProbe:
initialDelaySeconds: 120
readinessProbe:
initialDelaySeconds: 120
configurationFiles:
mysql.cnf: |-
[mysqld]
max_connections = 200
character-set-server=latin1
collation-server=latin1_swedish_ci
default_authentication_plugin=mysql_native_password
log-bin-trust-function-creators=1
# Enable database initialization to run SQL migrations
dbInit:
enabled: true
# Configuration files for local development
config:
enabled: true
files:
hades.cfg: |
{
test: {
logConfig: "/etc/onlinesales/config/hades/log.cfg",
hades_hibernate_config_read: "/etc/onlinesales/config/hades/hibernate.cfg.xml",
hades_hibernate_config_write: "/etc/onlinesales/config/hades/hibernate.cfg.xml",
rest_accessor_config_file: "/etc/onlinesales/config/hades/restAccessor.cfg",
forgot_password_email_config_file: "/etc/onlinesales/config/hades/forgotPasswordEmailSender.cfg",
activation_email_config_file: "/etc/onlinesales/config/hades/activationEmailConfigFile.cfg",
invitation_email_config_file: "/etc/onlinesales/config/hades/invitationEmailConfigFile.cfg",
grant_revoke_config_file: "/etc/onlinesales/config/hades/grantRevoke.cfg",
stats_logging_config: "/etc/onlinesales/config/hades/statsLogging.cfg",
sms_sender_lib_config: "/etc/onlinesales/config/hades/smsSenderLib.cfg",
context_key: "/etc/onlinesales/config/hades/contextKey.cfg",
is_app_ip_enabled: "true",
firebase_admin_sdk_config: "/etc/onlinesales/config/hades/firebaseAdminConfig.cfg",
firebase_data_url: "https://os-login-656b5.firebaseio.com",
failed_events_file: "/tmp/hades_failed_events.err",
user_signup_email_config_file: "/etc/onlinesales/config/hades/userSignupEmailConfigFile.cfg"
}
}
authConfig.cfg: |
{
prod: {
hades_auth_url : "http://localhost:8080/hadesV2/authorize",
auth_enable : true
},
test: {
hades_auth_url : "http://localhost:8080/hadesV2/authorize",
auth_enable : true
}
}
statsLogging.cfg: |
{
test: {
metric_name_prefix: "",
statsd_host: "localhost",
statsd_port: "8125",
logging_enabled: "true",
},
prod: {
metric_name_prefix: "",
statsd_host: "localhost",
statsd_port: "8125",
logging_enabled: "true",
}
}
smsSenderLib.cfg: |
{
prod: {
"username": "smsUser",
"password": "xxxxxx",
"sms_client_sender" : "SOKRAT",
"validity_minutes" : "15",
"sms_template" : "Your%20login%20OTP%20is%20__OTP__%20.%20Treat%20this%20as%20confidential.%20The%20OTP%20will%20be%20valid%20for%20next%20__VALIDITY__%20minutes."
},
test: {
"username": "smsUser",
"password": "xxxxxx",
"sms_client_sender" : "SOKRAT",
"validity_minutes" : "15",
"sms_template" : "Your%20login%20OTP%20is%20__OTP__%20.%20Treat%20this%20as%20confidential.%20The%20OTP%20will%20be%20valid%20for%20next%20__VALIDITY__%20minutes."
}
}
contextKey.cfg: |
{
prod: {
serviceAuthKey: "key"
},
test: {
serviceAuthKey: "key"
}
}
grantRevoke.cfg: |
{
prod:
{
"application": "TEST_APP",
"ipAddresses": "127.0.0.1"
},
test:
{
"application": "TEST_APP",
"ipAddresses": "127.0.0.1"
}
}
firebaseAdminConfig.cfg: |
{
"type": "service_account",
"private_key_id": "abc",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDY3E8o1NEFcjMM\nHW/5ZfFJw29/8NEqpViNjQIx95Xx5KDtJ+nWn9+OW0uqsSqKlKGhAdAo+Q6bjx2c\nuXVsXTu7XrZUY5Kltvj94DvUa1wjNXs606r/RxWTJ58bfdC+gLLxBfGnB6CwK0YQ\nxnfpjNbkUfVVzO0MQD7UP0Hl5ZcY0Puvxd/yHuONQn/rIAieTHH1pqgW+zrH/y3c\n59IGThC9PPtugI9ea8RSnVj3PWz1bX2UkCDpy9IRh9LzJLaYYX9RUd7++dULUlat\nAaXBh1U6emUDzhrIsgApjDVtimOPbmQWmX1S60mqQikRpVYZ8u+NDD+LNw+/Eovn\nxCj2Y3z1AgMBAAECggEAWDBzoqO1IvVXjBA2lqId10T6hXmN3j1ifyH+aAqK+FVl\nGjyWjDj0xWQcJ9ync7bQ6fSeTeNGzP0M6kzDU1+w6FgyZqwdmXWI2VmEizRjwk+/\n/uLQUcL7I55Dxn7KUoZs/rZPmQDxmGLoue60Gg6z3yLzVcKiDc7cnhzhdBgDc8vd\nQorNAlqGPRnm3EqKQ6VQp6fyQmCAxrr45kspRXNLddat3AMsuqImDkqGKBmF3Q1y\nxWGe81LphUiRqvqbyUlh6cdSZ8pLBpc9m0c3qWPKs9paqBIvgUPlvOZMqec6x4S6\nChbdkkTRLnbsRr0Yg/nDeEPlkhRBhasXpxpMUBgPywKBgQDs2axNkFjbU94uXvd5\nznUhDVxPFBuxyUHtsJNqW4p/ujLNimGet5E/YthCnQeC2P3Ym7c3fiz68amM6hiA\nOnW7HYPZ+jKFnefpAtjyOOs46AkftEg07T9XjwWNPt8+8l0DYawPoJgbM5iE0L2O\nx8TU1Vs4mXc+ql9F90GzI0x3VwKBgQDqZOOqWw3hTnNT07Ixqnmd3dugV9S7eW6o\nU9OoUgJB4rYTpG+yFqNqbRT8bkx37iKBMEReppqonOqGm4wtuRR6LSLlgcIU9Iwx\nyfH12UWqVmFSHsgZFqM/cK3wGev38h1WBIOx3/djKn7BdlKVh8kWyx6uC8bmV+E6\nOoK0vJD6kwKBgHAySOnROBZlqzkiKW8c+uU2VATtzJSydrWm0J4wUPJifNBa/hVW\ndcqmAzXC9xznt5AVa3wxHBOfyKaE+ig8CSsjNyNZ3vbmr0X04FoV1m91k2TeXNod\njMTobkPThaNm4eLJMN2SQJuaHGTGERWC0l3T18t+/zrDMDCPiSLX1NAvAoGBAN1T\nVLJYdjvIMxf1bm59VYcepbK7HLHFkRq6xMJMZbtG0ryraZjUzYvB4q4VjHk2UDiC\nlhx13tXWDZH7MJtABzjyg+AI7XWSEQs2cBXACos0M4Myc6lU+eL+iA+OuoUOhmrh\nqmT8YYGu76/IBWUSqWuvcpHPpwl7871i4Ga/I3qnAoGBANNkKAcMoeAbJQK7a/Rn\nwPEJB+dPgNDIaboAsh1nZhVhN5cvdvCWuEYgOGCPQLYQF0zmTLcM+sVxOYgfy8mV\nfbNgPgsP5xmu6dw2COBKdtozw0HrWSRjACd1N4yGu75+wPCcX/gQarcjRcXXZeEa\nNtBLSfcqPULqD+h7br9lEJio\n-----END PRIVATE KEY-----\n",
"client_email": "123-abc@developer.gserviceaccount.com",
"client_id": "123-abc.apps.googleusercontent.com",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "http://localhost:8080/token"
}
log.cfg: |
log4j.rootLogger=DEBUG, root
log4j.logger.org.hibernate=ERROR, root
log4j.logger.SOKRATI=DEBUG, root
log4j.appender.root=org.apache.log4j.ConsoleAppender
log4j.appender.root.layout=org.apache.log4j.PatternLayout
log4j.appender.root.layout.ConversionPattern=<%d> %5p [%t](%c) - %m%n
log4j.additivity.SOKRATI=false
log4j.logger.SOKRATI_METRICS=OFF, A3
log4j.appender.A3=org.apache.log4j.ConsoleAppender
log4j.appender.A3.layout=org.apache.log4j.PatternLayout
log4j.appender.A3.layout.ConversionPattern=<%d> %5p [%t](%c) - %m%n
log4j.additivity.SOKRATI_METRICS=false
restAccessor.cfg: |
{
"post_new_notifications": {
url: 'http://localhost/notificationsService/notifications',
type: post,
response: com.sokrati.notificationsSvcObjects.PostNotificationsResponse
},
"post_events": {
"url": "http://localhost/eventManagerServiceV2/events",
"type": "post",
"response": "com.sokrati.eventManagerSvcObjectsV2.PostEventsResponse"
}
}
forgotPasswordEmailSender.cfg: |
{
test: {
onlinesales:
{
subject : "Reset your password",
sender : "",
userId : 13690,
clientId : 547,
defaultDomain : "test.onlinesales.ai",
emailMessage : "Hi __USER_NAME__,<br /><br />Please set a new password <a href='__DOMAIN_NAME__?activation_code=__ACTIVATION_CODE__&email=__USER_EMAIL__'>here</a>.<br /><br />If the above link does not work, then copy paste the following link in your browser<br />__DOMAIN_NAME__?activation_code=__ACTIVATION_CODE__&email=__USER_EMAIL__<br /><br />Cheers<br />"
}
}
}
activationEmailConfigFile.cfg: |
{
test: {
browser:
{
subject : "Sokrati Email Verification",
sender : "shops@onlinesales.ai",
userId : 13690,
clientId : 547,
defaultDomain : "test.onlinesales.ai",
redirectUrl : "https://shops.onlinesales.ai",
emailMessage : "<table width=\"100%\" cellpadding=\"10\" align=\"center\"><tbody><tr align=\"center\"><td><img style=\"width: 135px;\" src=\"http:\/\/images.sokratistatic.com\/image\/upload\/v1444994594\/shops_emailer_images_2\/Sokrati-Logo.png\" alt=\"\" \/><\/td><\/tr><tr><td style=\"color: #3e3e3e; font-family: Helvetica, Arial, sans-serif; font-size: 16px;\">Hello,<\/td><\/tr><tr><td style=\"color: #3e3e3e; font-family: Helvetica, Arial, sans-serif; font-size: 16px;\">Congratulations! With Sokrati, you'll be able to reach new customers on online ads, social media, and email. Just verify your email address by clicking on the 'Verify Account' button below and get started!<\/td><\/tr><tr><td align=\"center\" width=\"100%\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td style=\"-webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; color: #ffffff; display: block; line-height: 40px;\" align=\"center\" bgcolor=\"#F14A4E\" width=\"200\" height=\"40\"><a style=\"font-size: 14px; font-weight: bold; font-family: Helvetica, Arial, sans-serif; text-decoration: none; width: 100%; display: inline-block;\" href=\"http:\/\/__DOMAIN_NAME__\/hadesV2\/emailVerification?activationCode=__ACTIVATION_CODE__&amp;email=__USER_EMAIL__&amp;redirectUrl=__REDIRECT_URL__&amp;userId=__USER_ID__\"><span style=\"color: #ffffff;\">VERIFY ACCOUNT<\/span> <\/a><\/td><\/tr><\/tbody><\/table><\/td><\/tr><tr><td style=\"color: #3e3e3e; font-family: Helvetica, Arial, sans-serif; font-size: 16px;\">Get in touch with us at <a href=\"mailto:shops@onlinesales.ai\">shops@onlinesales.ai<\/a> in case you have any questions.<\/td><\/tr><tr><td style=\"color: #3e3e3e; font-family: Helvetica, Arial, sans-serif; font-size: 16px;\">Happy Selling! <br \/>Sokrati Team<\/td><\/tr><\/tbody><\/table>"
}
}
}
invitationEmailConfigFile.cfg: |
{
test: {
"enabled": false,
"from": "noreply@local.dev",
"subject": "Invitation"
}
}
userSignupEmailConfigFile.cfg: |
{
test: {
"enabled": false,
"from": "noreply@local.dev",
"subject": "Welcome"
}
}
hibernate.cfg.xml: |
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://hades-mysql-db-service:3306/hades_db?useSSL=false&amp;serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&amp;characterEncoding=latin1</property>
<property name="connection.username">hades_user</property>
<property name="connection.password">local-hades-pass</property>
<!-- JDBC connection pool settings -->
<property name="connection.pool_size">10</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="current_session_context_class">thread</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="connection.isolation">2</property>
<property name="connection.autocommit">true</property>
<property name="use_keying_service">false</property>
<property name="c3p0.acquire_increment">10</property>
<property name="c3p0.idle_test_period">60</property> <!-- seconds -->
<property name="c3p0.max_size">50</property>
<property name="c3p0.max_statements">0</property>
<property name="c3p0.min_size">10</property>
<property name="c3p0.timeout">65</property> <!-- seconds -->
<property name="hibernate.c3p0.maxConnectionAge">3600</property>
<property name="hibernate.c3p0.preferredTestQuery">select 1;</property>
</session-factory>
</hibernate-configuration>

166
helm/hades/values.yaml Normal file
View File

@ -0,0 +1,166 @@
# Default values for hades
# Allow non-Bitnami images in MySQL subchart
global:
security:
allowInsecureImages: true
replicaCount: 1
# Common labels to add to all resources
# These labels will be applied to all hades resources and MySQL pods
commonLabels: {}
# Example usage:
# backstage.io/kubernetes-id: "hades-service"
image:
repository: localhost:5001/prj-onlinesales-prod-01/os-docker-images/onlinesales/prod/services/java/hadesv2
pullPolicy: IfNotPresent
tag: "1764590200722"
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
create: true
annotations: {}
name: ""
podAnnotations: {}
podSecurityContext:
fsGroup: 1000
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
runAsNonRoot: true
runAsUser: 1000
service:
type: ClusterIP
port: 8080
targetPort: 8080
annotations: {}
ingress:
enabled: false
className: ""
annotations: {}
hosts:
- host: hades.local
paths:
- path: /
pathType: Prefix
tls: []
resources:
limits:
cpu: 2000m
memory: 2Gi
requests:
cpu: 500m
memory: 512Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80
targetMemoryUtilizationPercentage: 80
livenessProbe:
httpGet:
path: /schedulerService/jobTrigger?jsonQuery=%7B%22application%22%3A%22nagios%22%2C%22jobName%22%3A%22monitoring_scheduler_svc%22%7D
port: http
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /schedulerService/jobTrigger?jsonQuery=%7B%22application%22%3A%22nagios%22%2C%22jobName%22%3A%22monitoring_scheduler_svc%22%7D
port: http
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
env:
- name: JAVA_OPTS
value: "-Djava.security.egd=file:/dev/./urandom -XX:+UnlockExperimentalVMOptions -Xms512m -Xmx2048m -XX:+UseG1GC"
- name: CATALINA_OPTS
value: "-Dconfig.path=/app/config"
- name: TZ
value: "UTC"
# Database configuration
database:
# Use internal MySQL (deployed as subchart) or external database
# If mysql.enabled=true, these values are auto-configured
host: "" # Will be set to mysql.fullname if mysql.enabled=true
port: "3306"
name: "hades_db"
username: "hades_user"
password: "" # Leave empty to auto-generate
# For external database, set mysql.enabled=false and configure above values
# MySQL subchart configuration (WSO2 Helm Chart)
mysql:
enabled: true
image: "mysql"
imageTag: "8.0"
mysqlRootPassword: "" # Auto-generated if empty
mysqlDatabase: "hades_db"
mysqlUser: "hades_user"
mysqlPassword: "" # Auto-generated if empty
fullnameOverride: "hades-mysql-db-service"
# Pod labels for MySQL pods (used to pass commonLabels to MySQL subchart)
podLabels: {}
persistence:
enabled: true
size: 8Gi
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 250m
memory: 512Mi
livenessProbe:
initialDelaySeconds: 120
readinessProbe:
initialDelaySeconds: 120
configurationFiles:
mysql.cnf: |-
[mysqld]
max_connections = 200
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
default_authentication_plugin=mysql_native_password
log-bin-trust-function-creators=1
# Database initialization
# Automatically runs all SQL migration files from sql/ directory in alphabetical order
dbInit:
enabled: true
# ConfigMap for application configuration files
config:
enabled: true
# Add your configuration files here
# files:
# hades.cfg: |
# # Hades configuration
# hibernate.cfg.xml: |
# <!-- Hibernate configuration -->
nodeSelector: {}
tolerations: []
affinity: {}