first commit

This commit is contained in:
Noor E Ilahi
2026-01-09 12:54:53 +05:30
commit 7ccf44f7da
1070 changed files with 113036 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
data:
LOG_CHANNEL: "stderr"
LOG_LEVEL: "debug"
{{- range $key, $val := .Values.app.env }}
"{{ $key }}": "{{ $val }}"
{{- end }}

View File

@@ -0,0 +1,99 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-web
spec:
replicas: {{ .Values.app.replicas | default 2 }}
revisionHistoryLimit: {{ .Values.app.revisionHistoryLimit | default 2 }}
selector:
matchLabels:
app.kubernetes.io/name: {{ .Release.Name }}-web
template:
metadata:
labels:
app.kubernetes.io/name: {{ .Release.Name }}-web
spec:
containers:
- name: app
imagePullPolicy: {{.Values.app.image.pullPolicy}}
image: {{- printf " %s/%s:%s" .Values.app.image.registry .Values.app.image.repository .Values.app.image.tag }}
ports:
- containerPort: 80
name: http-web-svc
protocol: TCP
env:
- name: APP_ENV
value: {{ .Values.app.environment | default "dev" | quote }}
- name: S6_CMD_WAIT_FOR_SERVICES_MAXTIME
value: "180000"
volumeMounts:
- mountPath: /app/storage/app/screenshots
name: app-screenshots
- mountPath: /app/storage/app/attachments
name: app-attachments
- mountPath: /app/bootstrap/cache
name: bootstrap-cache
- mountPath: /tmp
name: app-tmp
- mountPath: /run
name: app-run
- mountPath: /var/lib/nginx/tmp
name: nginx-tmp
envFrom:
- configMapRef:
name: {{ .Release.Name }}-configmap
- secretRef:
name: {{ .Release.Name }}-secret
startupProbe:
exec:
command: ["php82", "artisan", "octane:status"]
failureThreshold: 60
periodSeconds: 5
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http-web-svc
failureThreshold: 3
periodSeconds: 5
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http-web-svc
failureThreshold: 3
successThreshold: 1
periodSeconds: 15
volumes:
- name: bootstrap-cache
emptyDir: {}
- name: app-tmp
emptyDir: {}
- name: storage-framework
emptyDir: {}
- name: app-run
emptyDir: {}
- name: nginx-tmp
emptyDir: {}
- name: nginx-run
emptyDir: {}
- name: app-screenshots
{{- if eq .Values.app.persistence.screenshots.enabled "true" }}
persistentVolumeClaim:
{{- if not (empty .Values.app.persistence.screenshots.existingClaim) }}
claimName: {{ .Values.app.persistence.screenshots.existingClaim }}
{{- else }}
claimName: {{ .Release.Name }}-pvc-screenshots
{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
- name: app-attachments
{{- if eq .Values.app.persistence.attachments.enabled "true" }}
persistentVolumeClaim:
{{- if not (empty .Values.app.persistence.attachments.existingClaim) }}
claimName: {{ .Values.app.persistence.attachments.existingClaim }}
{{- else }}
claimName: {{ .Release.Name }}-pvc-attachments
{{- end }}
{{- else }}
emptyDir: {}
{{- end }}

View File

@@ -0,0 +1,20 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-ingress
spec:
ingressClassName: {{.Values.ingress.class}}
rules:
- host:
- {{ .Values.ingress.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}
port:
number: {{ .Values.app.service.port }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- if empty .Values.app.persistence.attachments.existingClaim }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app: cattr-app
name: {{ .Release.Name }}-pvc-attachments
spec:
storageClassName: {{ .Values.app.persistence.attachments.storageClass }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.app.persistence.attachments.size }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- if empty .Values.app.persistence.screenshots.existingClaim }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app: cattr-app
name: {{ .Release.Name }}-pvc-screenshots
spec:
storageClassName: {{ .Values.app.persistence.screenshots.storageClass }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.app.persistence.screenshots.size }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- $secret := (lookup "v1" "Secret" .Release.Namespace (printf "%s-secret" .Release.Name)) }}
{{- $appKeyValue := (printf "%s%s" "base64:" (encryptAES (randAlpha 32) "plaintext")) }}
{{- if $secret }}
{{- $appKeyValue = index $secret.data "APP_KEY" }}
{{- end -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-secret
type: Opaque
stringData:
DB_USERNAME: {{ .Values.mysql.auth.username | quote }}
DB_PASSWORD: {{ .Values.mysql.auth.password | quote }}
APP_KEY: {{ .Values.app.key | default $appKeyValue | quote }}

24
.helm/templates/svc.yaml Normal file
View File

@@ -0,0 +1,24 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
labels:
app.kubernetes.io/component: {{ .Release.Name }}-web
spec:
type: {{ .Values.app.service.type }}
{{- if and .Values.app.service.clusterIP (eq .Values.app.service.type "ClusterIP") }}
clusterIP: {{ .Values.app.service.clusterIP }}
{{- end }}
{{- if and (eq .Values.app.service.type "LoadBalancer") (not (empty .Values.app.service.loadBalancerIP)) }}
loadBalancerIP: {{ .Values.app.service.loadBalancerIP }}
{{- end }}
ports:
- name: http-web-svc
port: {{ .Values.app.service.port }}
protocol: TCP
targetPort: http-web-svc
{{- if (and (or (eq .Values.app.service.type "NodePort") (eq .Values.app.service.type "LoadBalancer")) .Values.app.service.nodePort) }}
nodePort: {{ .Values.app.service.nodePort }}
{{- end }}
selector:
app.kubernetes.io/name: {{ .Release.Name }}-web