15 changed files with 456 additions and 244 deletions
-
2charts/textbee/Chart.yaml
-
30charts/textbee/example/values.yaml
-
98charts/textbee/templates/NOTES.txt
-
1charts/textbee/templates/_helpers.tpl
-
79charts/textbee/templates/api-deployment.yaml
-
32charts/textbee/templates/api-hpa.yaml
-
43charts/textbee/templates/api-ingress.yaml
-
21charts/textbee/templates/api-service.yaml
-
4charts/textbee/templates/hpa.yaml
-
88charts/textbee/templates/ingress.yaml
-
41charts/textbee/templates/service.yaml
-
74charts/textbee/templates/web-deployment.yaml
-
43charts/textbee/templates/web-ingress.yaml
-
21charts/textbee/templates/web-service.yaml
-
123charts/textbee/values.yaml
@ -0,0 +1,30 @@ |
|||||
|
web: |
||||
|
enabled: true |
||||
|
service: |
||||
|
enabled: true |
||||
|
type: LoadBalancer |
||||
|
annotations: |
||||
|
tailscale.com/expose: "true" |
||||
|
tailscale.com/hostname: "textbee-web" |
||||
|
api: |
||||
|
autoscaling: |
||||
|
enabled: true |
||||
|
minReplicas: 1 |
||||
|
maxReplicas: 3 |
||||
|
targetCPUUtilizationPercentage: 80 |
||||
|
service: |
||||
|
enabled: true |
||||
|
ingress: |
||||
|
enabled: true |
||||
|
hosts: |
||||
|
- host: textbee-api.demo.com |
||||
|
paths: |
||||
|
- path: / |
||||
|
pathType: Prefix |
||||
|
className: nginx |
||||
|
annotations: |
||||
|
cert-manager.io/cluster-issuer: "letsencrypt-prod" |
||||
|
tls: |
||||
|
- secretName: textbee-api-tls |
||||
|
hosts: |
||||
|
- textbee-api.demo.com |
||||
@ -1,44 +1,84 @@ |
|||||
Text Bee is ready ! |
|
||||
|
|
||||
Don't forget to create a secret |
|
||||
|
######################## |
||||
|
# IMPORTANT # |
||||
|
######################## |
||||
|
|
||||
|
TextBee is almost ready ! |
||||
|
|
||||
|
Create those secrets below: |
||||
|
--- |
||||
apiVersion: v1 |
apiVersion: v1 |
||||
kind: Secret |
kind: Secret |
||||
metadata: |
metadata: |
||||
name: textbee-api-secrets |
|
||||
|
name: {{ include "textbee.fullname" . }}-secrets |
||||
|
namespace: {{ .Release.Namespace }} |
||||
type: Opaque |
type: Opaque |
||||
stringData: |
stringData: |
||||
MONGO_URI: mongodb://adminUser:adminPassword@textbee-db:27017/textbee?authSource=admin |
|
||||
JWT_SECRET: supersecret |
|
||||
|
JWT_SECRET: "" # https://generate-secret.vercel.app/32 |
||||
JWT_EXPIRATION: 60d |
JWT_EXPIRATION: 60d |
||||
FIREBASE_PROJECT_ID: |
|
||||
FIREBASE_PRIVATE_KEY_ID: |
|
||||
FIREBASE_PRIVATE_KEY: |
|
||||
FIREBASE_CLIENT_EMAIL: |
|
||||
FIREBASE_CLIENT_ID: |
|
||||
FIREBASE_CLIENT_C509_CERT_URL: |
|
||||
MAIL_HOST: |
|
||||
MAIL_PORT: |
|
||||
MAIL_USER: |
|
||||
MAIL_PASS: |
|
||||
MAIL_FROM: |
|
||||
MAIL_REPLY_TO: |
|
||||
|
# Go to Firebase Console -> Press on cog (Project Settings) -> Service Accounts -> Generate new private key |
||||
|
FIREBASE_PROJECT_ID: "" |
||||
|
FIREBASE_PRIVATE_KEY_ID: "" |
||||
|
FIREBASE_PRIVATE_KEY: "" |
||||
|
FIREBASE_CLIENT_EMAIL: "" |
||||
|
FIREBASE_CLIENT_ID: "" |
||||
|
FIREBASE_CLIENT_C509_CERT_URL: "" |
||||
|
MAIL_HOST: "" |
||||
|
MAIL_PORT: "" |
||||
|
MAIL_USER: "" |
||||
|
MAIL_PASS: "" |
||||
|
MAIL_FROM: "" |
||||
|
MAIL_REPLY_TO: "" |
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 |
||||
|
kind: Secret |
||||
|
metadata: |
||||
|
name: {{ include "textbee.fullname" . }}-web-secrets |
||||
|
namespace: {{ .Release.Namespace }} |
||||
|
type: Opaque |
||||
|
stringData: |
||||
|
NEXT_PUBLIC_GOOGLE_CLIENT_ID: "" |
||||
|
NEXT_PUBLIC_TAWKTO_EMBED_URL: "" |
||||
|
MAIL_HOST: "" |
||||
|
MAIL_PORT: "" |
||||
|
MAIL_USER: "" |
||||
|
MAIL_PASS: "" |
||||
|
MAIL_FROM: "" |
||||
|
ADMIN_EMAIL: "" |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
apiVersion: v1 |
||||
|
kind: Secret |
||||
|
metadata: |
||||
|
name: {{ include "textbee.fullname" . }}-web-secrets |
||||
|
namespace: {{ .Release.Namespace }} |
||||
|
type: Opaque |
||||
|
stringData: |
||||
|
NEXT_PUBLIC_GOOGLE_CLIENT_ID: "" |
||||
|
NEXT_PUBLIC_TAWKTO_EMBED_URL: "" |
||||
|
MAIL_HOST: "" |
||||
|
MAIL_PORT: "" |
||||
|
MAIL_USER: "" |
||||
|
MAIL_PASS: "" |
||||
|
MAIL_FROM: "" |
||||
|
ADMIN_EMAIL: "" |
||||
|
|
||||
|
--- |
||||
apiVersion: v1 |
apiVersion: v1 |
||||
kind: Secret |
kind: Secret |
||||
metadata: |
metadata: |
||||
name: textbee-web-secrets |
|
||||
|
name: {{ .Values.globals.mongo_uri.secretName }} |
||||
|
namespace: {{ .Release.Namespace }} |
||||
type: Opaque |
type: Opaque |
||||
stringData: |
stringData: |
||||
AUTH_SECRET= # https://generate-secret.vercel.app/32 |
|
||||
NEXT_PUBLIC_SITE_URL: http://localhost:80 |
|
||||
NEXT_PUBLIC_GOOGLE_CLIENT_ID: |
|
||||
NEXT_PUBLIC_TAWKTO_EMBED_URL: |
|
||||
DATABASE_URL: mongodb://adminUser:adminPassword@textbee-db:27017/textbee?authSource=admin |
|
||||
MAIL_HOST: |
|
||||
MAIL_PORT: |
|
||||
MAIL_USER: |
|
||||
MAIL_PASS: |
|
||||
MAIL_FROM: |
|
||||
ADMIN_EMAIL: |
|
||||
|
uri: "" # mongodb://user:password@host:port/database |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
######################## |
||||
|
# IMPORTANT # |
||||
|
######################## |
||||
|
|
||||
|
Create those secrets above! |
||||
@ -0,0 +1,32 @@ |
|||||
|
{{- if .Values.api.autoscaling.enabled }} |
||||
|
apiVersion: autoscaling/v2 |
||||
|
kind: HorizontalPodAutoscaler |
||||
|
metadata: |
||||
|
name: {{ include "textbee.fullname" . }}-api-hpa |
||||
|
labels: |
||||
|
{{- include "textbee.labels" . | nindent 4 }} |
||||
|
spec: |
||||
|
scaleTargetRef: |
||||
|
apiVersion: apps/v1 |
||||
|
kind: Deployment |
||||
|
name: {{ include "textbee.fullname" . }}-api |
||||
|
minReplicas: {{ .Values.api.autoscaling.minReplicas }} |
||||
|
maxReplicas: {{ .Values.api.autoscaling.maxReplicas }} |
||||
|
metrics: |
||||
|
{{- if .Values.api.autoscaling.targetCPUUtilizationPercentage }} |
||||
|
- type: Resource |
||||
|
resource: |
||||
|
name: cpu |
||||
|
target: |
||||
|
type: Utilization |
||||
|
averageUtilization: {{ .Values.api.autoscaling.targetCPUUtilizationPercentage }} |
||||
|
{{- end }} |
||||
|
{{- if .Values.api.autoscaling.targetMemoryUtilizationPercentage }} |
||||
|
- type: Resource |
||||
|
resource: |
||||
|
name: memory |
||||
|
target: |
||||
|
type: Utilization |
||||
|
averageUtilization: {{ .Values.api.autoscaling.targetMemoryUtilizationPercentage }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
@ -0,0 +1,43 @@ |
|||||
|
{{- if .Values.api.ingress.enabled -}} |
||||
|
apiVersion: networking.k8s.io/v1 |
||||
|
kind: Ingress |
||||
|
metadata: |
||||
|
name: ingress-{{ include "textbee.fullname" . }}-api |
||||
|
labels: |
||||
|
{{- include "textbee.labels" . | nindent 4 }} |
||||
|
{{- with .Values.api.ingress.annotations }} |
||||
|
annotations: |
||||
|
{{- toYaml . | nindent 4 }} |
||||
|
{{- end }} |
||||
|
spec: |
||||
|
{{- with .Values.api.ingress.className }} |
||||
|
ingressClassName: {{ . }} |
||||
|
{{- end }} |
||||
|
{{- if .Values.api.ingress.tls }} |
||||
|
tls: |
||||
|
{{- range .Values.api.ingress.tls }} |
||||
|
- hosts: |
||||
|
{{- range .hosts }} |
||||
|
- {{ . | quote }} |
||||
|
{{- end }} |
||||
|
secretName: {{ .secretName }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
|
rules: |
||||
|
{{- range .Values.api.ingress.hosts }} |
||||
|
- host: {{ .host | quote }} |
||||
|
http: |
||||
|
paths: |
||||
|
{{- range .paths }} |
||||
|
- path: {{ .path }} |
||||
|
{{- with .pathType }} |
||||
|
pathType: {{ . }} |
||||
|
{{- end }} |
||||
|
backend: |
||||
|
service: |
||||
|
name: svc-{{ include "textbee.fullname" $ }}-api |
||||
|
port: |
||||
|
number: {{ $.Values.api.service.port }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
@ -0,0 +1,21 @@ |
|||||
|
apiVersion: v1 |
||||
|
kind: Service |
||||
|
metadata: |
||||
|
name: svc-{{ include "textbee.fullname" .}}-api |
||||
|
labels: |
||||
|
app: textbee-api |
||||
|
{{- include "textbee.labels" . | nindent 4 }} |
||||
|
{{- if .Values.api.service.labels }} |
||||
|
{{- toYaml .Values.api.service.labels | nindent 4 }} |
||||
|
{{- end }} |
||||
|
{{- if .Values.api.service.annotations }} |
||||
|
annotations: |
||||
|
{{- toYaml .Values.api.service.annotations | nindent 4 }} |
||||
|
{{- end }} |
||||
|
spec: |
||||
|
selector: |
||||
|
app: {{ include "textbee.fullname" .}}-api |
||||
|
ports: |
||||
|
- port: {{ .Values.api.service.port }} |
||||
|
targetPort: {{ .Values.api.service.port }} |
||||
|
type: {{ .Values.api.service.type }} |
||||
@ -1,88 +0,0 @@ |
|||||
{{- if .Values.api.ingress.enabled -}} |
|
||||
apiVersion: networking.k8s.io/v1 |
|
||||
kind: Ingress |
|
||||
metadata: |
|
||||
name: {{ include "textbee.fullname" . }} |
|
||||
labels: |
|
||||
{{- include "textbee.labels" . | nindent 4 }} |
|
||||
{{- with .Values.api.ingress.annotations }} |
|
||||
annotations: |
|
||||
{{- toYaml . | nindent 4 }} |
|
||||
{{- end }} |
|
||||
spec: |
|
||||
{{- with .Values.api.ingress.className }} |
|
||||
ingressClassName: {{ . }} |
|
||||
{{- end }} |
|
||||
{{- if .Values.api.ingress.tls }} |
|
||||
tls: |
|
||||
{{- range .Values.api.ingress.tls }} |
|
||||
- hosts: |
|
||||
{{- range .hosts }} |
|
||||
- {{ . | quote }} |
|
||||
{{- end }} |
|
||||
secretName: {{ .secretName }} |
|
||||
{{- end }} |
|
||||
{{- end }} |
|
||||
rules: |
|
||||
{{- range .Values.api.ingress.hosts }} |
|
||||
- host: {{ .host | quote }} |
|
||||
http: |
|
||||
paths: |
|
||||
{{- range .paths }} |
|
||||
- path: {{ .path }} |
|
||||
{{- with .pathType }} |
|
||||
pathType: {{ . }} |
|
||||
{{- end }} |
|
||||
backend: |
|
||||
service: |
|
||||
name: {{ include "textbee.fullname" $ }} |
|
||||
port: |
|
||||
number: {{ $.Values.api.service.port }} |
|
||||
{{- end }} |
|
||||
{{- end }} |
|
||||
{{- end }} |
|
||||
--- |
|
||||
|
|
||||
{{- if .Values.web.ingress.enabled -}} |
|
||||
apiVersion: networking.k8s.io/v1 |
|
||||
kind: Ingress |
|
||||
metadata: |
|
||||
name: {{ include "textbee.fullname" . }} |
|
||||
labels: |
|
||||
{{- include "textbee.labels" . | nindent 4 }} |
|
||||
{{- with .Values.web.ingress.annotations }} |
|
||||
annotations: |
|
||||
{{- toYaml . | nindent 4 }} |
|
||||
{{- end }} |
|
||||
spec: |
|
||||
{{- with .Values.api.ingress.className }} |
|
||||
ingressClassName: {{ . }} |
|
||||
{{- end }} |
|
||||
{{- if .Values.web.ingress.tls }} |
|
||||
tls: |
|
||||
{{- range .Values.web.ingress.tls }} |
|
||||
- hosts: |
|
||||
{{- range .hosts }} |
|
||||
- {{ . | quote }} |
|
||||
{{- end }} |
|
||||
secretName: {{ .secretName }} |
|
||||
{{- end }} |
|
||||
{{- end }} |
|
||||
rules: |
|
||||
{{- range .Values.web.ingress.hosts }} |
|
||||
- host: {{ .host | quote }} |
|
||||
http: |
|
||||
paths: |
|
||||
{{- range .paths }} |
|
||||
- path: {{ .path }} |
|
||||
{{- with .pathType }} |
|
||||
pathType: {{ . }} |
|
||||
{{- end }} |
|
||||
backend: |
|
||||
service: |
|
||||
name: {{ include "textbee.fullname" $ }} |
|
||||
port: |
|
||||
number: {{ $.Values.web.service.port }} |
|
||||
{{- end }} |
|
||||
{{- end }} |
|
||||
{{- end }} |
|
||||
@ -1,41 +0,0 @@ |
|||||
--- |
|
||||
{{- if .Values.web.service.enabled -}} |
|
||||
apiVersion: v1 |
|
||||
kind: Service |
|
||||
metadata: |
|
||||
name: {{ include "textbee.fullname" . }}-web |
|
||||
labels: |
|
||||
{{- include "textbee.labels" . | nindent 4 }} |
|
||||
spec: |
|
||||
selector: |
|
||||
app: {{ include "textbee.fullname" . }}-web |
|
||||
{{- if .Values.web.service.annotations }} |
|
||||
annotations: |
|
||||
{{- toYaml .Values.web.service.annotations | nindent 4 }} |
|
||||
{{- end }} |
|
||||
ports: |
|
||||
- port: {{ .Values.web.service.port | default 80 }} |
|
||||
targetPort: {{ .Values.web.service.targetPort | default 80 }} |
|
||||
type: {{ .Values.web.service.type | default "ClusterIP" }} |
|
||||
|
|
||||
{{- end }} |
|
||||
--- |
|
||||
{{- if .Values.api.service.enabled -}} |
|
||||
apiVersion: v1 |
|
||||
kind: Service |
|
||||
metadata: |
|
||||
name: {{ include "textbee.fullname" . }}-api |
|
||||
labels: |
|
||||
{{- include "textbee.labels" . | nindent 4 }} |
|
||||
spec: |
|
||||
selector: |
|
||||
app: {{ include "textbee.fullname" . }}-web |
|
||||
{{- if .Values.api.service.annotations }} |
|
||||
annotations: |
|
||||
{{- toYaml .Values.api.service.annotations | nindent 4 }} |
|
||||
{{- end }} |
|
||||
ports: |
|
||||
- port: {{ .Values.api.service.port | default 80 }} |
|
||||
targetPort: {{ .Values.api.service.targetPort | default 80 }} |
|
||||
type: {{ .Values.api.service.type | default "ClusterIP" }} |
|
||||
{{- end }} |
|
||||
@ -0,0 +1,74 @@ |
|||||
|
apiVersion: apps/v1 |
||||
|
kind: Deployment |
||||
|
metadata: |
||||
|
name: {{ include "textbee.fullname" .}}-web |
||||
|
labels: |
||||
|
app: {{ include "textbee.fullname" .}}-web |
||||
|
{{- include "textbee.labels" . | nindent 4 }} |
||||
|
spec: |
||||
|
replicas: 1 |
||||
|
selector: |
||||
|
matchLabels: |
||||
|
app: {{ include "textbee.fullname" .}}-web |
||||
|
template: |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: {{ include "textbee.fullname" .}}-web |
||||
|
spec: |
||||
|
containers: |
||||
|
- name: {{ include "textbee.fullname" .}}-web |
||||
|
image: "{{ .Values.web.image.repository }}:{{ .Values.web.image.tag | default .Chart.AppVersion }}" |
||||
|
ports: |
||||
|
- name: http |
||||
|
containerPort: {{ .Values.web.service.port }} |
||||
|
env: |
||||
|
- name: HOSTNAME |
||||
|
value: 0.0.0.0 |
||||
|
{{- if .Values.web.ingress.enabled }} |
||||
|
- name: NEXT_PUBLIC_SITE_URL |
||||
|
value: "https://{{ .Values.web.ingress.url }}" |
||||
|
{{- end }} |
||||
|
- name: PORT |
||||
|
value: "{{ .Values.web.service.port }}" |
||||
|
- name: NEXT_PUBLIC_API_BASE_URL |
||||
|
value: "http://{{ include "textbee.fullname" .}}-api:{{ .Values.web.service.port }}/api/v1" |
||||
|
- name: DATABASE_URL |
||||
|
valueFrom: |
||||
|
secretKeyRef: |
||||
|
name: {{ .Values.globals.mongo_uri.secretName | default (include "textbee.fullname" .) }}-mongo-uri |
||||
|
key: {{ .Values.globals.mongo_uri.secretKey }} |
||||
|
envFrom: |
||||
|
- secretRef: |
||||
|
name: {{ .Values.web.envSecretName | default (include "textbee.fullname" .) }}-web-secrets |
||||
|
{{- with .Values.web.livenessProbe }} |
||||
|
livenessProbe: |
||||
|
{{- toYaml . | nindent 12 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.web.readinessProbe }} |
||||
|
readinessProbe: |
||||
|
{{- toYaml . | nindent 12 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.web.resources }} |
||||
|
resources: |
||||
|
{{- toYaml . | nindent 12 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.web.volumeMounts }} |
||||
|
volumeMounts: |
||||
|
{{- toYaml . | nindent 12 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.web.volumes }} |
||||
|
volumes: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.web.nodeSelector }} |
||||
|
nodeSelector: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.web.affinity }} |
||||
|
affinity: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.web.tolerations }} |
||||
|
tolerations: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
@ -0,0 +1,43 @@ |
|||||
|
{{- if .Values.web.ingress.enabled -}} |
||||
|
apiVersion: networking.k8s.io/v1 |
||||
|
kind: Ingress |
||||
|
metadata: |
||||
|
name: ingress-{{ include "textbee.fullname" . }}-web |
||||
|
labels: |
||||
|
{{- include "textbee.labels" . | nindent 4 }} |
||||
|
{{- with .Values.web.ingress.annotations }} |
||||
|
annotations: |
||||
|
{{- toYaml . | nindent 4 }} |
||||
|
{{- end }} |
||||
|
spec: |
||||
|
{{- with .Values.web.ingress.className }} |
||||
|
ingressClassName: {{ . }} |
||||
|
{{- end }} |
||||
|
{{- if .Values.web.ingress.tls }} |
||||
|
tls: |
||||
|
{{- range .Values.web.ingress.tls }} |
||||
|
- hosts: |
||||
|
{{- range .hosts }} |
||||
|
- {{ . | quote }} |
||||
|
{{- end }} |
||||
|
secretName: {{ .secretName }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
|
rules: |
||||
|
{{- range .Values.web.ingress.hosts }} |
||||
|
- host: {{ .host | quote }} |
||||
|
http: |
||||
|
paths: |
||||
|
{{- range .paths }} |
||||
|
- path: {{ .path }} |
||||
|
{{- with .pathType }} |
||||
|
pathType: {{ . }} |
||||
|
{{- end }} |
||||
|
backend: |
||||
|
service: |
||||
|
name: svc-{{ include "textbee.fullname" $ }}-web |
||||
|
port: |
||||
|
number: {{ $.Values.web.service.port }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
@ -0,0 +1,21 @@ |
|||||
|
apiVersion: v1 |
||||
|
kind: Service |
||||
|
metadata: |
||||
|
name: svc-{{ include "textbee.fullname" .}}-web |
||||
|
labels: |
||||
|
app: {{ include "textbee.fullname" .}}-web |
||||
|
{{- include "textbee.labels" . | nindent 4 }} |
||||
|
{{- if .Values.web.service.labels }} |
||||
|
{{- toYaml .Values.web.service.labels | nindent 4 }} |
||||
|
{{- end }} |
||||
|
{{- if .Values.web.service.annotations }} |
||||
|
annotations: |
||||
|
{{- toYaml .Values.web.service.annotations | nindent 4 }} |
||||
|
{{- end }} |
||||
|
spec: |
||||
|
selector: |
||||
|
app: {{ include "textbee.fullname" .}}-web |
||||
|
ports: |
||||
|
- port: {{ .Values.web.service.port }} |
||||
|
targetPort: {{ .Values.web.service.port }} |
||||
|
type: {{ .Values.web.service.type }} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue