feat: Add AWS CDK project and Helm charts for Beckn-Onix deployment on AWS cloud
This commit is contained in:
11
aws-cdk/helm/registry/templates/NOTES.txt
Normal file
11
aws-cdk/helm/registry/templates/NOTES.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ "\n" }}
|
||||
Get the Beckn-ONIX Registry URL by running these commands:
|
||||
{{ "\n" }}
|
||||
{{- if .Values.ingress.enabled }}
|
||||
export INGRESS_HOST=$(kubectl get ingress {{ include "common.name" . }}-ingress -n {{ .Values.namespace }} -o jsonpath="{.status.loadBalancer.ingress[0].hostname}")
|
||||
{{- if .Values.ingress.tls.enabled }}
|
||||
echo "https://$INGRESS_HOST"
|
||||
{{- else }}
|
||||
echo "http://$INGRESS_HOST"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
75
aws-cdk/helm/registry/templates/_helpers.tpl
Normal file
75
aws-cdk/helm/registry/templates/_helpers.tpl
Normal file
@@ -0,0 +1,75 @@
|
||||
{{/*
|
||||
Expand the name of the chart or use a provided override.
|
||||
*/}}
|
||||
{{- define "common.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name, with truncation to 63 characters.
|
||||
*/}}
|
||||
{{- define "common.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 }}
|
||||
|
||||
{{/*
|
||||
Generate a chart name and version label.
|
||||
*/}}
|
||||
{{- define "common.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels to be used in all charts.
|
||||
*/}}
|
||||
{{- define "common.labels" -}}
|
||||
helm.sh/chart: {{ include "common.chart" . }}
|
||||
{{ include "common.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/release: {{ .Release.Revision | quote }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common selector labels.
|
||||
*/}}
|
||||
{{- define "common.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "common.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Helper for creating service account names.
|
||||
*/}}
|
||||
{{- define "common.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "common.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Helper for image names and tags.
|
||||
*/}}
|
||||
{{- define "common.image" -}}
|
||||
{{ printf "%s:%s" .Values.image.repository .Values.image.tag }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Helper for constructing resource names with prefixes or suffixes.
|
||||
*/}}
|
||||
{{- define "common.resourceName" -}}
|
||||
{{- printf "%s-%s" (include "common.fullname" .) .Values.suffix | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,27 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "common.name" . }}-config
|
||||
namespace: {{ .Values.namespace }}
|
||||
data:
|
||||
swf.properties: |
|
||||
swf.load.complete.config.tables.if.count.less.than=500
|
||||
swf.user.password.encrypted=false
|
||||
swf.plugins.background.core.workers.numThreads=3
|
||||
swf.application.authentication.required=false
|
||||
swf.application.requires.registration=true
|
||||
swf.host={{ .Values.externalDomain }}
|
||||
swf.external.port=443
|
||||
swf.external.scheme=https
|
||||
swf.jdbc.dbschema=public
|
||||
swf.jdbc.dbschema.setonconnection=true
|
||||
swf.jdbc.set.dbschema.command=set search_path to 'public'
|
||||
swf.jdbc.url=jdbc:postgresql://{{ .Values.database.host }}/{{ .Values.database.dbname }}
|
||||
swf.jdbc.driver=org.postgresql.Driver
|
||||
swf.jdbc.userid={{ .Values.database.username }}
|
||||
swf.jdbc.password={{ .Values.database.password }}
|
||||
swf.jdbc.readOnly=false
|
||||
swf.api.keys.case=SNAKE
|
||||
swf.api.root.required=false
|
||||
swf.encryption.support=false
|
||||
swf.ftl.dir=src/main/resources/templates
|
||||
63
aws-cdk/helm/registry/templates/deployment.yaml
Normal file
63
aws-cdk/helm/registry/templates/deployment.yaml
Normal file
@@ -0,0 +1,63 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "common.name" . }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if not .Values.autoscaling.enabled }}
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "common.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
{{- with .Values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 8 }}
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "common.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: {{ .Values.image.repository }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: registry-port
|
||||
containerPort: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
- name: sec-reg-port
|
||||
containerPort: {{ .Values.service.secondaryPort }}
|
||||
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 }}
|
||||
volumeMounts:
|
||||
- name: registry-config
|
||||
mountPath: "/registry/overrideProperties/config/swf.properties"
|
||||
subPath: swf.properties
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: registry-config
|
||||
configMap:
|
||||
name: {{ include "common.name" . }}-config
|
||||
32
aws-cdk/helm/registry/templates/ingress.yaml
Normal file
32
aws-cdk/helm/registry/templates/ingress.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
{{- if .Values.ingress.enabled }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "common.name" . }}-ingress
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
alb.ingress.kubernetes.io/scheme: internet-facing
|
||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
|
||||
alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS-1-1-2017-01
|
||||
alb.ingress.kubernetes.io/certificate-arn: {{ .Values.ingress.tls.certificateArn | quote }}
|
||||
alb.ingress.kubernetes.io/ssl-redirect: '443'
|
||||
alb.ingress.kubernetes.io/group.name: beckn-onix-registry
|
||||
alb.ingress.kubernetes.io/load-balancer-name: beckn-onix-registry
|
||||
alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=300
|
||||
alb.ingress.kubernetes.io/target-type: ip
|
||||
alb.ingress.kubernetes.io/success-codes: 200,302
|
||||
spec:
|
||||
ingressClassName: alb
|
||||
rules:
|
||||
- http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ include "common.name" . }}-svc
|
||||
port:
|
||||
number: {{ .Values.service.port }}
|
||||
{{- end }}
|
||||
6
aws-cdk/helm/registry/templates/namespace.yaml
Normal file
6
aws-cdk/helm/registry/templates/namespace.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ .Values.namespace }}
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 4 }}
|
||||
16
aws-cdk/helm/registry/templates/service.yaml
Normal file
16
aws-cdk/helm/registry/templates/service.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "common.name" . }}-svc
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: registry-port
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "common.selectorLabels" . | nindent 4 }}
|
||||
14
aws-cdk/helm/registry/templates/serviceaccount.yaml
Normal file
14
aws-cdk/helm/registry/templates/serviceaccount.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "common.serviceAccountName" . }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user