Merge pull request 'Adding omegabasms and breaking dvirlabs' (#1) from omega-basms into master
Reviewed-on: #1
This commit is contained in:
commit
0545e50e40
21
argocd-apps/omegabasms.yaml
Normal file
21
argocd-apps/omegabasms.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: omegabasms
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: my-apps
|
||||||
|
source:
|
||||||
|
repoURL: ssh://git@gitea-ssh.dev-tools.svc.cluster.local:2222/dvirlabs/my-apps.git
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: charts/omegabasms-chart
|
||||||
|
helm:
|
||||||
|
valueFiles:
|
||||||
|
- ../../manifests/omegabasms/values.yaml
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: my-apps
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
6
charts/omegabasms-chart/Chart.yaml
Normal file
6
charts/omegabasms-chart/Chart.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: omegabasms
|
||||||
|
description: A Helm chart for OmegaBaSMS - WhatsApp to SMS relay with dashboard
|
||||||
|
type: application
|
||||||
|
version: 1.0.0
|
||||||
|
appVersion: "1.0.0"
|
||||||
47
charts/omegabasms-chart/templates/_helpers.tpl
Normal file
47
charts/omegabasms-chart/templates/_helpers.tpl
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{{- define "omegabasms.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "omegabasms.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 }}
|
||||||
|
|
||||||
|
{{- define "omegabasms.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "omegabasms.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "omegabasms.chart" . }}
|
||||||
|
{{ include "omegabasms.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- with .Values.commonLabels }}
|
||||||
|
{{ toYaml . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "omegabasms.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "omegabasms.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "omegabasms.backend.labels" -}}
|
||||||
|
{{ include "omegabasms.labels" . }}
|
||||||
|
app.kubernetes.io/component: backend
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "omegabasms.backend.selectorLabels" -}}
|
||||||
|
{{ include "omegabasms.selectorLabels" . }}
|
||||||
|
app.kubernetes.io/component: backend
|
||||||
|
{{- end }}
|
||||||
90
charts/omegabasms-chart/templates/deployment.yaml
Normal file
90
charts/omegabasms-chart/templates/deployment.yaml
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ include "omegabasms.fullname" . }}-backend
|
||||||
|
labels:
|
||||||
|
{{- include "omegabasms.backend.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.commonAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.backend.replicas }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "omegabasms.backend.selectorLabels" . | nindent 6 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
{{- include "omegabasms.backend.selectorLabels" . | nindent 8 }}
|
||||||
|
{{- with .Values.commonAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- with .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: omegabasms
|
||||||
|
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: {{ .Values.backend.service.port }}
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: GROUP_NAMES
|
||||||
|
value: {{ .Values.backend.env.groupNames | quote }}
|
||||||
|
- name: TEXTBEE_DEVICE_ID
|
||||||
|
value: {{ .Values.backend.env.textbeeDeviceId | quote }}
|
||||||
|
- name: TEXTBEE_API_KEY
|
||||||
|
value: {{ .Values.backend.env.textbeeApiKey | quote }}
|
||||||
|
- name: SMS_RECIPIENT
|
||||||
|
value: {{ .Values.backend.env.smsRecipient | quote }}
|
||||||
|
- name: TELEGRAM_BOT_TOKEN
|
||||||
|
value: {{ .Values.backend.env.telegramBotToken | quote }}
|
||||||
|
- name: TELEGRAM_CHAT_ID
|
||||||
|
value: {{ .Values.backend.env.telegramChatId | quote }}
|
||||||
|
- name: BATCH_INTERVAL_MS
|
||||||
|
value: {{ .Values.backend.env.batchIntervalMs | quote }}
|
||||||
|
- name: BATCH_MAX_CHARS
|
||||||
|
value: {{ .Values.backend.env.batchMaxChars | quote }}
|
||||||
|
- name: INCLUDE_OWN_MESSAGES
|
||||||
|
value: {{ .Values.backend.env.includeOwnMessages | quote }}
|
||||||
|
- name: OWN_NAME
|
||||||
|
value: {{ .Values.backend.env.ownName | quote }}
|
||||||
|
- name: OWN_LAST_NAME
|
||||||
|
value: {{ .Values.backend.env.ownLastName | quote }}
|
||||||
|
- name: KEEP_ALIVE_URL
|
||||||
|
value: {{ .Values.backend.env.keepAliveUrl | quote }}
|
||||||
|
- name: KEEP_ALIVE_INTERVAL_MS
|
||||||
|
value: {{ .Values.backend.env.keepAliveIntervalMs | quote }}
|
||||||
|
- name: PORT
|
||||||
|
value: {{ .Values.backend.service.port | quote }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: wwebjs-auth
|
||||||
|
mountPath: /app/.wwebjs_auth
|
||||||
|
- name: wwebjs-cache
|
||||||
|
mountPath: /app/.wwebjs_cache
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /liveness
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 15
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /liveness
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 5
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.backend.resources | nindent 12 }}
|
||||||
|
volumes:
|
||||||
|
- name: wwebjs-auth
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ include "omegabasms.fullname" . }}-backend-auth
|
||||||
|
- name: wwebjs-cache
|
||||||
|
emptyDir: {}
|
||||||
45
charts/omegabasms-chart/templates/ingress.yaml
Normal file
45
charts/omegabasms-chart/templates/ingress.yaml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{{- if .Values.backend.ingress.enabled }}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ include "omegabasms.fullname" . }}-backend
|
||||||
|
labels:
|
||||||
|
{{- include "omegabasms.labels" . | nindent 4 }}
|
||||||
|
component: backend
|
||||||
|
{{- with .Values.backend.ingress.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.commonAnnotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.backend.ingress.className }}
|
||||||
|
ingressClassName: {{ .Values.backend.ingress.className }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
{{- range .Values.backend.ingress.hosts }}
|
||||||
|
- host: {{ .host | quote }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
{{- range .paths }}
|
||||||
|
- path: {{ .path }}
|
||||||
|
pathType: {{ .pathType }}
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: {{ include "omegabasms.fullname" $ }}-backend
|
||||||
|
port:
|
||||||
|
number: {{ $.Values.backend.service.port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backend.ingress.tls }}
|
||||||
|
tls:
|
||||||
|
{{- range .Values.backend.ingress.tls }}
|
||||||
|
- hosts:
|
||||||
|
{{- range .hosts }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
secretName: {{ .secretName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
23
charts/omegabasms-chart/templates/pvc.yaml
Normal file
23
charts/omegabasms-chart/templates/pvc.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{{- if .Values.backend.persistence.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: {{ include "omegabasms.fullname" . }}-backend-auth
|
||||||
|
labels:
|
||||||
|
{{- include "omegabasms.backend.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.commonAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.backend.persistence.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backend.persistence.storageClass }}
|
||||||
|
storageClassName: {{ .Values.backend.persistence.storageClass }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.backend.persistence.size }}
|
||||||
|
{{- end }}
|
||||||
19
charts/omegabasms-chart/templates/service.yaml
Normal file
19
charts/omegabasms-chart/templates/service.yaml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "omegabasms.fullname" . }}-backend
|
||||||
|
labels:
|
||||||
|
{{- include "omegabasms.backend.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.commonAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.backend.service.type }}
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.backend.service.port }}
|
||||||
|
targetPort: http
|
||||||
|
protocol: TCP
|
||||||
|
name: http
|
||||||
|
selector:
|
||||||
|
{{- include "omegabasms.backend.selectorLabels" . | nindent 4 }}
|
||||||
65
charts/omegabasms-chart/values.yaml
Normal file
65
charts/omegabasms-chart/values.yaml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
nameOverride: ""
|
||||||
|
fullnameOverride: ""
|
||||||
|
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
commonLabels: {}
|
||||||
|
commonAnnotations: {}
|
||||||
|
|
||||||
|
backend:
|
||||||
|
image:
|
||||||
|
repository: omegabasms
|
||||||
|
tag: latest
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
replicas: 1
|
||||||
|
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 1Gi
|
||||||
|
requests:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 512Mi
|
||||||
|
|
||||||
|
env:
|
||||||
|
groupNames: "Group1,Group2"
|
||||||
|
textbeeDeviceId: ""
|
||||||
|
textbeeApiKey: ""
|
||||||
|
smsRecipient: ""
|
||||||
|
telegramBotToken: ""
|
||||||
|
telegramChatId: ""
|
||||||
|
batchIntervalMs: "900000"
|
||||||
|
batchMaxChars: "700"
|
||||||
|
includeOwnMessages: "true"
|
||||||
|
ownName: ""
|
||||||
|
ownLastName: ""
|
||||||
|
keepAliveUrl: ""
|
||||||
|
keepAliveIntervalMs: "300000"
|
||||||
|
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClass: ""
|
||||||
|
size: 1Gi
|
||||||
|
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 3000
|
||||||
|
|
||||||
|
healthCheck:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 30
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
className: ""
|
||||||
|
annotations: {}
|
||||||
|
hosts:
|
||||||
|
- host: omegabasms.example.com
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
tls: []
|
||||||
2
manifests/omegabasms/cname.yaml
Normal file
2
manifests/omegabasms/cname.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
enabled: true
|
||||||
|
hostname: omegabasms.dvirlabs.com
|
||||||
72
manifests/omegabasms/values.yaml
Normal file
72
manifests/omegabasms/values.yaml
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
nameOverride: ""
|
||||||
|
fullnameOverride: ""
|
||||||
|
|
||||||
|
commonLabels: {}
|
||||||
|
commonAnnotations: {}
|
||||||
|
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-regcred
|
||||||
|
|
||||||
|
backend:
|
||||||
|
image:
|
||||||
|
repository: harbor.dvirlabs.com/my-apps/omegabasms
|
||||||
|
tag: latest
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
replicas: 1
|
||||||
|
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 1Gi
|
||||||
|
requests:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 512Mi
|
||||||
|
|
||||||
|
env:
|
||||||
|
groupNames: "בדיקה"
|
||||||
|
textbeeDeviceId: "6a159ba75ccc2dc46eac318a"
|
||||||
|
textbeeApiKey: "a0728b4d-858f-4bab-ab9c-ddb390fc0a69"
|
||||||
|
smsRecipient: "+972509915261"
|
||||||
|
telegramBotToken: "8143716130:AAFw5ZPLG9SHp45m8bfICcA9A00sa-n3utQ"
|
||||||
|
telegramChatId: "283184115"
|
||||||
|
batchIntervalMs: "70000"
|
||||||
|
batchMaxChars: "700"
|
||||||
|
includeOwnMessages: "true"
|
||||||
|
ownName: "אלישע"
|
||||||
|
ownLastName: "דוידי"
|
||||||
|
keepAliveUrl: ""
|
||||||
|
keepAliveIntervalMs: "300000"
|
||||||
|
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClass: "nfs-client"
|
||||||
|
size: 1Gi
|
||||||
|
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 3000
|
||||||
|
|
||||||
|
healthCheck:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 30
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
className: "traefik"
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||||
|
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||||
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
hosts:
|
||||||
|
- host: omegabasms.dvirlabs.com
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
tls:
|
||||||
|
- secretName: omegabasms-tls
|
||||||
|
hosts:
|
||||||
|
- omegabasms.dvirlabs.com
|
||||||
Loading…
x
Reference in New Issue
Block a user