Init
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: wrapped
|
||||
description: Zero-knowledge one-time encrypted drop (Wrapped)
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "0.1.0"
|
||||
@@ -0,0 +1,18 @@
|
||||
{{- define "wrapped.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "wrapped.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name (include "wrapped.name" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "wrapped.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "wrapped.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "wrapped.fullname" . }}-config
|
||||
labels:
|
||||
{{- include "wrapped.labels" . | nindent 4 }}
|
||||
data:
|
||||
APP_NAME: "Wrapped"
|
||||
APP_ENV: {{ .Values.app.env | quote }}
|
||||
APP_BASE_URL: {{ .Values.app.baseUrl | quote }}
|
||||
LOG_LEVEL: {{ .Values.app.logLevel | quote }}
|
||||
DOCS_ENABLED: {{ .Values.app.docsEnabled | quote }}
|
||||
S3_ENDPOINT_URL: {{ .Values.external.s3.endpointUrl | quote }}
|
||||
S3_BUCKET: {{ .Values.external.s3.bucket | quote }}
|
||||
S3_REGION: {{ .Values.external.s3.region | quote }}
|
||||
S3_USE_SSL: {{ .Values.external.s3.useSsl | quote }}
|
||||
S3_CREATE_BUCKET: {{ .Values.external.s3.createBucket | quote }}
|
||||
# Trust ingress / mesh peers so audit stores the real client IP from X-Forwarded-For.
|
||||
TRUSTED_PROXIES: {{ .Values.app.trustedProxies | quote }}
|
||||
# Peers allowed to set X-Forwarded-For / X-Real-IP (audit shows real client IP).
|
||||
# "*" is correct when only Ingress / mesh reaches the pod.
|
||||
TRUSTED_PROXIES: {{ .Values.app.trustedProxies | default "*" | quote }}
|
||||
@@ -0,0 +1,71 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "wrapped.fullname" . }}
|
||||
labels:
|
||||
{{- include "wrapped.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ include "wrapped.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "wrapped.labels" . | nindent 8 }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
containers:
|
||||
- name: wrapped
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8000
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- >
|
||||
alembic upgrade head &&
|
||||
uvicorn app.main:app
|
||||
--host 0.0.0.0
|
||||
--port 8000
|
||||
--proxy-headers
|
||||
--forwarded-allow-ips={{ .Values.app.trustedProxies | default "*" | quote }}
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: {{ include "wrapped.fullname" . }}-secret
|
||||
- configMapRef:
|
||||
name: {{ include "wrapped.fullname" . }}-config
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 20
|
||||
{{- with .Values.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,35 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "wrapped.fullname" . }}
|
||||
labels:
|
||||
{{- include "wrapped.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.className }}
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- toYaml .Values.ingress.tls | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
pathType: {{ .pathType }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ include "wrapped.fullname" $ }}
|
||||
port:
|
||||
number: {{ $.Values.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "wrapped.fullname" . }}-secret
|
||||
labels:
|
||||
{{- include "wrapped.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
APP_SECRET_KEY: {{ .Values.app.secretKey | quote }}
|
||||
ADMIN_USERNAME: {{ .Values.app.adminUsername | quote }}
|
||||
ADMIN_PASSWORD: {{ .Values.app.adminPassword | quote }}
|
||||
DATABASE_URL: {{ .Values.external.databaseUrl | quote }}
|
||||
S3_ACCESS_KEY: {{ .Values.external.s3.accessKey | quote }}
|
||||
S3_SECRET_KEY: {{ .Values.external.s3.secretKey | quote }}
|
||||
TURNSTILE_SECRET_KEY: {{ .Values.app.turnstileSecretKey | quote }}
|
||||
HCAPTCHA_SECRET_KEY: {{ .Values.app.hcaptchaSecretKey | quote }}
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "wrapped.fullname" . }}
|
||||
labels:
|
||||
{{- include "wrapped.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app.kubernetes.io/name: {{ include "wrapped.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
@@ -0,0 +1,57 @@
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: inecs/wrapped
|
||||
tag: "0.1.0"
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 8000
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
annotations:
|
||||
# Pass real client IP to the app (nginx ingress).
|
||||
nginx.ingress.kubernetes.io/use-forwarded-headers: "true"
|
||||
nginx.ingress.kubernetes.io/compute-full-forwarded-for: "true"
|
||||
nginx.ingress.kubernetes.io/enable-real-ip: "true"
|
||||
hosts:
|
||||
- host: wrapped.local
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
tls: []
|
||||
|
||||
resources: {}
|
||||
|
||||
# Use existing Postgres / MinIO (recommended for production release)
|
||||
external:
|
||||
databaseUrl: "postgresql+asyncpg://wrapped:wrapped@postgres:5432/wrapped"
|
||||
s3:
|
||||
endpointUrl: "http://minio:9000"
|
||||
accessKey: "wrappedminio"
|
||||
secretKey: "wrappedminio123"
|
||||
bucket: "wrapped"
|
||||
region: "us-east-1"
|
||||
useSsl: false
|
||||
createBucket: false
|
||||
|
||||
app:
|
||||
env: production
|
||||
baseUrl: "https://wrapped.local"
|
||||
secretKey: "change-me-in-prod"
|
||||
adminUsername: admin
|
||||
adminPassword: "change-me"
|
||||
logLevel: INFO
|
||||
# Swagger / ReDoc / openapi.json — disabled for k8s by default
|
||||
docsEnabled: false
|
||||
# Trust Ingress / any peer for X-Forwarded-For (ClusterIP is not public).
|
||||
trustedProxies: "*"
|
||||
turnstileSecretKey: ""
|
||||
hcaptchaSecretKey: ""
|
||||
podAnnotations: {}
|
||||
nodeSelector: {}
|
||||
tolerations: []
|
||||
affinity: {}
|
||||
Reference in New Issue
Block a user