Add tennotrade

This commit is contained in:
dvirlabs 2025-09-21 01:23:35 +03:00
parent 98537b6e18
commit aed5c5c11e
8 changed files with 214 additions and 0 deletions

View File

@ -0,0 +1,21 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: tennotrade
namespace: argocd
spec:
project: my-apps
source:
repoURL: https://git.dvirlabs.com/dvirlabs/my-apps.git
targetRevision: HEAD
path: charts/tennotrade-chart
helm:
valueFiles:
- ../../manifests/tennotrade/values.yaml
destination:
server: https://kubernetes.default.svc
namespace: my-apps
syncPolicy:
automated:
prune: true
selfHeal: true

View File

@ -0,0 +1,6 @@
apiVersion: v2
name: warframe-db
description: PostgreSQL (StatefulSet) for Warframe trade backend
type: application
version: 0.2.0
appVersion: "16"

View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "warframe-db.fullname" . }}-headless
labels:
app.kubernetes.io/name: {{ include "warframe-db.name" . }}
spec:
clusterIP: None
ports:
- name: postgres
port: {{ .Values.postgres.port }}
targetPort: {{ .Values.postgres.port }}
selector:
app.kubernetes.io/name: {{ include "warframe-db.name" . }}

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "warframe-db.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "warframe-db.name" . }}
type: Opaque
stringData:
POSTGRES_PASSWORD: {{ .Values.postgres.password | quote }}

View File

@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "warframe-db.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "warframe-db.name" . }}
{{- with .Values.service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- name: postgres
port: {{ .Values.service.port }}
targetPort: {{ .Values.postgres.port }}
selector:
app.kubernetes.io/name: {{ include "warframe-db.name" . }}

View File

@ -0,0 +1,78 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "warframe-db.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "warframe-db.name" . }}
spec:
serviceName: {{ include "warframe-db.fullname" . }}-headless
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: {{ include "warframe-db.name" . }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "warframe-db.name" . }}
spec:
securityContext:
fsGroup: 999 # postgres user in official image
containers:
- name: postgres
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: postgres
containerPort: {{ .Values.postgres.port }}
env:
- name: POSTGRES_USER
value: {{ .Values.postgres.user | quote }}
- name: POSTGRES_DB
value: {{ .Values.postgres.database | quote }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "warframe-db.fullname" . }}
key: POSTGRES_PASSWORD
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
{{- if .Values.probes.enabled }}
readinessProbe:
exec:
command: ["sh","-c","pg_isready -U $POSTGRES_USER -d $POSTGRES_DB -h 127.0.0.1 -p {{ .Values.postgres.port }}"]
initialDelaySeconds: {{ .Values.probes.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.periodSeconds }}
timeoutSeconds: {{ .Values.probes.timeoutSeconds }}
failureThreshold: {{ .Values.probes.failureThreshold }}
livenessProbe:
exec:
command: ["sh","-c","pg_isready -U $POSTGRES_USER -d $POSTGRES_DB -h 127.0.0.1 -p {{ .Values.postgres.port }}"]
initialDelaySeconds: {{ add .Values.probes.initialDelaySeconds 10 }}
periodSeconds: {{ .Values.probes.periodSeconds }}
timeoutSeconds: {{ .Values.probes.timeoutSeconds }}
failureThreshold: {{ .Values.probes.failureThreshold }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- if .Values.persistence.storageClassName }}
storageClassName: {{ .Values.persistence.storageClassName }}
{{- end }}

View File

@ -0,0 +1,34 @@
image:
repository: postgres
tag: "16"
pullPolicy: IfNotPresent
postgres:
user: wfuser
password: wfpass # will be stored in a Secret
database: wf
port: 5432
service:
type: ClusterIP
port: 5432
# Optional annotations:
annotations: {}
persistence:
enabled: true
size: 5Gi
storageClassName: "nfs-client" # e.g., nfs-client / longhorn / left empty = default
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
# Simple liveness/readiness probes (tuned for small clusters)
probes:
enabled: true
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 6

View File

@ -0,0 +1,34 @@
image:
repository: postgres
tag: "16"
pullPolicy: IfNotPresent
postgres:
user: wfuser
password: wfpass # will be stored in a Secret
database: wf
port: 5432
service:
type: ClusterIP
port: 5432
# Optional annotations:
annotations: {}
persistence:
enabled: true
size: 5Gi
storageClassName: "nfs-client" # e.g., nfs-client / longhorn / left empty = default
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
# Simple liveness/readiness probes (tuned for small clusters)
probes:
enabled: true
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 6