Move postgresql to separate deployment
Change-Id: Iab4b97c327be9aa93f9783b4ff1a27fd37103d26
This commit is contained in:
parent
ad8c621f5f
commit
7d64471e9b
@ -22,8 +22,3 @@ version: 0.1.0
|
|||||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
# It is recommended to use it with quotes.
|
# It is recommended to use it with quotes.
|
||||||
appVersion: "latest"
|
appVersion: "latest"
|
||||||
|
|
||||||
dependencies:
|
|
||||||
- name: postgresql
|
|
||||||
version: 14.3.3
|
|
||||||
repository: https://charts.bitnami.com/bitnami
|
|
||||||
|
@ -42,6 +42,15 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "nebulous-overlay-network-manager.postgresql.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "nebulous-overlay-network-manager.chart" . }}
|
||||||
|
{{ include "nebulous-overlay-network-manager.postgresql.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Selector labels
|
Selector labels
|
||||||
*/}}
|
*/}}
|
||||||
@ -50,6 +59,11 @@ app.kubernetes.io/name: {{ include "nebulous-overlay-network-manager.name" . }}
|
|||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "nebulous-overlay-network-manager.postgresql.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "nebulous-overlay-network-manager.name" . }}-postgresql
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create the name of the service account to use
|
Create the name of the service account to use
|
||||||
*/}}
|
*/}}
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
{{ if .Values.postgresql.enabled }}
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ include "nebulous-overlay-network-manager.fullname" . }}-postgresql
|
||||||
|
labels:
|
||||||
|
{{- include "nebulous-overlay-network-manager.postgresql.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "nebulous-overlay-network-manager.postgresql.selectorLabels" . | nindent 6 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
{{- include "nebulous-overlay-network-manager.postgresql.selectorLabels" . | nindent 8 }}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: postgresql
|
||||||
|
image: "{{ .Values.postgresql.image }}"
|
||||||
|
ports:
|
||||||
|
- name: postgresql
|
||||||
|
containerPort: {{ .Values.postgresql.port }}
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: POSTGRES_USER
|
||||||
|
value: "{{ .Values.postgresql.user }}"
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
value: "{{ .Values.postgresql.password }}"
|
||||||
|
- name: POSTGRES_DB
|
||||||
|
value: "{{ .Values.postgresql.dbName }}"
|
||||||
|
{{- with .Values.nodeSelector }}
|
||||||
|
nodeSelector:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "nebulous-overlay-network-manager.fullname" . }}-postgresql
|
||||||
|
labels:
|
||||||
|
{{- include "nebulous-overlay-network-manager.postgresql.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.postgresql.port }}
|
||||||
|
targetPort: postgresql
|
||||||
|
protocol: TCP
|
||||||
|
name: postgresql
|
||||||
|
- port: 5050
|
||||||
|
targetPort: pgadmin
|
||||||
|
protocol: TCP
|
||||||
|
name: pgadmin
|
||||||
|
selector:
|
||||||
|
{{- include "nebulous-overlay-network-manager.postgresql.selectorLabels" . | nindent 4 }}
|
||||||
|
{{ end }}
|
@ -27,10 +27,6 @@ spec:
|
|||||||
serviceAccountName: {{ include "nebulous-overlay-network-manager.serviceAccountName" . }}
|
serviceAccountName: {{ include "nebulous-overlay-network-manager.serviceAccountName" . }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||||
initContainers:
|
|
||||||
- name: wait-for-postgresql
|
|
||||||
image: docker.io/bitnami/postgresql:16.2.0-debian-12-r8
|
|
||||||
command: ['sh', '-c', 'until pg_isready -U postgresql -d dbname=postgres -h nebulous-overlay-network-manager-postgresql -p 5432; do echo waiting for database; sleep 2; done;']
|
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
securityContext:
|
securityContext:
|
||||||
@ -41,18 +37,15 @@ spec:
|
|||||||
- name: onm-api
|
- name: onm-api
|
||||||
containerPort: 8082
|
containerPort: 8082
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
- name: pgadmin
|
|
||||||
containerPort: 5050
|
|
||||||
protocol: TCP
|
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_USER
|
- name: POSTGRES_USER
|
||||||
value: {{ .Values.postgresql.global.postgresql.auth.username }}
|
value: {{ .Values.postgresql.user }}
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
value: {{ .Values.postgresql.global.postgresql.auth.password }}
|
value: {{ .Values.postgresql.password }}
|
||||||
- name: POSTGRES_DB
|
- name: POSTGRES_DB
|
||||||
value: {{ .Values.postgresql.global.postgresql.auth.database }}
|
value: {{ .Values.postgresql.database }}
|
||||||
- name: POSTGRES_IP_FQDN
|
- name: POSTGRES_IP_FQDN
|
||||||
value: "nebulous-overlay-network-manager-postgresql"
|
value: "nebulous-overlay-network-manager-postgresql"
|
||||||
- name: POSTGRES_CONNECTION_STRING
|
- name: POSTGRES_CONNECTION_STRING
|
||||||
|
@ -84,13 +84,12 @@ tolerations: []
|
|||||||
affinity: {}
|
affinity: {}
|
||||||
|
|
||||||
postgresql:
|
postgresql:
|
||||||
global:
|
enabled: true
|
||||||
postgresql:
|
image: "docker.io/postgres:16"
|
||||||
auth:
|
user: "postgresql"
|
||||||
postgresPassword: "nebulous"
|
password: "postgresql"
|
||||||
username: "postgresql"
|
dbName: "postgres"
|
||||||
password: "postgresql"
|
port: 5432
|
||||||
database: "postgres"
|
|
||||||
|
|
||||||
customEnv:
|
customEnv:
|
||||||
WIREGUARD_NETWORK_PORTION: "192.168.55."
|
WIREGUARD_NETWORK_PORTION: "192.168.55."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user