helm mongo db deployment

This commit is contained in:
Maidul Islam
2022-12-04 22:37:51 -05:00
parent 3b002abcb6
commit 5e87a317fa
4 changed files with 105 additions and 20 deletions

View File

@@ -23,6 +23,9 @@ spec:
- containerPort: 4000
env:
{{- range $key, $value := .Values.secrets }}
{{- if eq $value "MUST_REPLACE" }}
{{ fail "Environment variables are not set. Please set all environment variables to continue." }}
{{ end }}
- name: {{ $key }}
value: {{ $value }}
{{- end }}

View File

@@ -1,3 +1,4 @@
{{ if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
@@ -22,17 +23,18 @@ spec:
- host: {{ .Values.ingress.hostName}}
http:
paths:
- path: /
pathType: Prefix
- path: {{ .Values.ingress.frontend.path }}
pathType: {{ .Values.ingress.frontend.pathType }}
backend:
service:
name: infisical-frontend-service
port:
number: 3000
- path: /api
pathType: Prefix
- path: {{ .Values.ingress.backend.path }}
pathType: {{ .Values.ingress.backend.pathType }}
backend:
service:
name: infisical-backend-service
port:
number: 4000
number: 4000
{{ end }}

View File

@@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongodb-deployment
namespace: {{ .Values.namespace }}
labels:
app: mongodb
spec:
replicas: 1 # Cannot be scaled. To scale, you must set up Stateful Set
selector:
matchLabels:
app: mongodb
template:
metadata:
labels:
app: mongodb
spec:
containers:
- name: mongodb
image: mongo
ports:
- containerPort: 27017
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: root
- name: MONGO_INITDB_ROOT_PASSWORD
value: root
---
apiVersion: v1
kind: Service
metadata:
name: mongodb-service
namespace: {{ .Values.namespace }}
spec:
selector:
app: mongodb
ports:
- protocol: TCP
port: 27017
targetPort: 27017 # container port

View File

@@ -1,3 +1,8 @@
#####
# INFISICAL K8 DEFAULT VALUES FIL
# PLEASE REPLACE VALUES/EDIT AS REQUIRED
#####
namespace: infisical
frontend:
@@ -15,22 +20,57 @@ backend:
tag: "latest"
ingress:
enabled: false
annotations: []
enabled: true
annotations: {}
hostName: example.com
tls: {}
frontend:
path: /
pathType: Prefix
backend:
path: /api
pathType: Prefix
tls: []
## Complete Ingress example
# ingress:
# enabled: true
# annotations:
# kubernetes.io/ingress.class: "nginx"
# cert-manager.io/issuer: letsencrypt-nginx
# hostName: example.com
# frontend:
# path: /
# pathType: Prefix
# backend:
# path: /api
# pathType: Prefix
# tls:
# hosts:
# - k8.infisical.com
# secretName: letsencrypt-nginx
###
### YOU MUST FILL IN ALL SECRETS BELOW
###
secrets:
PRIVATE_KEY: REQUIRED
PUBLIC_KEY: REQUIRED
ENCRYPTION_KEY: REQUIRED
JWT_SIGNUP_SECRET: REQUIRED
JWT_REFRESH_SECRET: REQUIRED
JWT_AUTH_SECRET: REQUIRED
NODE_ENV: development
SMTP_HOST: REQUIRED
SMTP_NAME: REQUIRED
SMTP_USERNAME: REQUIRED
SMTP_PASSWORD: REQUIRED
MONGO_URL: REQUIRED
# Required keys for platform encryption/decryption ops. Replace with nacl sk keys
PRIVATE_KEY: MUST_REPLACE
PUBLIC_KEY: MUST_REPLACE
ENCRYPTION_KEY: MUST_REPLACE
# JWT
# Required secrets to sign JWT tokens
JWT_SIGNUP_SECRET: MUST_REPLACE
JWT_REFRESH_SECRET: MUST_REPLACE
JWT_AUTH_SECRET: MUST_REPLACE
# Mail/SMTP
# Required to send emails
SMTP_HOST: MUST_REPLACE
SMTP_NAME: MUST_REPLACE
SMTP_USERNAME: MUST_REPLACE
SMTP_PASSWORD: MUST_REPLACE
# You may replace with Mongo Cloud URI
MONGO_URL: mongodb://root:root@mongodb-service:27017/