add db host and port to connect to external database

This commit is contained in:
Abhishek Kondur
2023-08-08 13:51:51 +05:30
parent 800ae55692
commit 32102dc714
4 changed files with 17 additions and 13 deletions

View File

@@ -1,3 +1,7 @@
{{- $dbHost := .Values.db.host -}}
{{- if eq $dbHost "" -}}
{{- $dbHost = printf "%s-postgresql-ha-pgpool.%s.svc.cluster.local" .Release.Name .Release.Namespace -}}
{{- end -}}
apiVersion: v1
kind: ConfigMap
metadata:
@@ -23,8 +27,8 @@ data:
MQ_USERNAME: "{{ .Values.mq.username }}"
LICENSE_KEY: "{{ .Values.server.ee.licensekey }}" # needed if EE
NETMAKER_TENANT_ID: "{{ .Values.server.ee.tenantId }}" # needed if EE
SQL_HOST: "{{ .Release.Name }}-postgresql-ha-pgpool.{{ .Release.Namespace }}.svc.cluster.local"
SQL_PORT: "5432"
SQL_HOST: "{{ $dbHost }}"
SQL_PORT: "{{ .Values.db.port }}"
SQL_DB: {{ .Values.db.database }}
SQL_USER: {{ .Values.db.username }}
SQL_PASS: {{ .Values.db.password }}

View File

@@ -78,7 +78,7 @@ metadata:
spec:
storageClassName: {{ .Values.dns.RWX.storageClassName }}
accessModes:
- ReadWriteOnce
- ReadWriteMany
resources:
requests:
storage: {{ .Values.dns.storageSize }}

View File

@@ -5,7 +5,7 @@ metadata:
app: {{ include "netmaker.fullname" . }}
name: {{ include "netmaker.fullname" . }}
spec:
replicas: 3
replicas: {{ .Values.server.replicas }}
selector:
matchLabels:
app: {{ include "netmaker.fullname" . }}

View File

@@ -2,8 +2,7 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
# -- number of netmaker server replicas to create
replicas: 3
baseDomain: "146.190.9.68.nip.io"
image:
# -- The image repo to pull Netmaker image from
@@ -11,7 +10,7 @@ image:
# -- Pull Policy for images
pullPolicy: Always
# -- Override the image tag to pull
tag: "v0.20.5"
tag: "latest"
# -- override the name for netmaker objects
nameOverride: ""
@@ -41,12 +40,11 @@ ui:
mq:
# -- how many MQTT replicas to create
replicas: 2
singlenode: false
existingClaim: false
existingClaimName: ""
username: netmaker
password: 3yyerWGdds43yegGR
server:
# -- number of netmaker server replicas to create
replicas: 2
RWX:
storageClassName: ""
storageSize: 128Mi
@@ -95,9 +93,11 @@ ingress:
rest: "api"
db:
type: "postgres"
host: ""
port: 5432
username: postgres
# -- postgres pass to generate
password: postgres
password: password123 # set your own secure password
# -- postgress db to generate
database: netmaker
@@ -107,13 +107,13 @@ postgresql-ha:
# -- postgres user to generate
username: postgres
# -- postgres pass to generate
password: postgres
password: password123 # set your own secure password
# -- postgress db to generate
database: netmaker
# -- postgress number of replicas to deploy
replicaCount: 2
repmgrUsername: postgres
repmgrPassword: postgres
repmgrPassword: password123 # set your own secure password
repmgrDatabase: repmgr
persistence:
# -- size of postgres DB