local env done

This commit is contained in:
2026-05-13 15:21:37 -03:00
parent 55aa31eff5
commit 7c5aa14409
10 changed files with 97 additions and 3 deletions

View File

@@ -43,6 +43,7 @@ docker_build(
k8s_resource('minio')
k8s_resource('lambda', resource_deps=['minio'])
k8s_resource('docs')
k8s_resource('gateway', resource_deps=['docs', 'minio'])
k8s_resource(
objects=['eth:namespace', 'eth-config:configmap'],

12
ctrl/k8s/base/Caddyfile Normal file
View File

@@ -0,0 +1,12 @@
{
auto_https off
admin off
}
eth.local.ar:80 {
reverse_proxy docs:80
}
minio.eth.local.ar:80 {
reverse_proxy minio:9001
}

View File

@@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: gateway
namespace: eth
spec:
replicas: 1
selector:
matchLabels:
app: gateway
template:
metadata:
labels:
app: gateway
spec:
containers:
- name: caddy
image: caddy:2-alpine
ports:
- containerPort: 80
name: http
volumeMounts:
- name: config
mountPath: /etc/caddy
readOnly: true
readinessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 2
periodSeconds: 10
resources:
requests:
memory: 32Mi
cpu: 50m
limits:
memory: 128Mi
volumes:
- name: config
configMap:
name: gateway-config
---
apiVersion: v1
kind: Service
metadata:
name: gateway
namespace: eth
spec:
selector:
app: gateway
ports:
- name: http
port: 80
targetPort: 80

View File

@@ -9,3 +9,13 @@ resources:
- minio.yaml
- lambda.yaml
- docs.yaml
- gateway.yaml
# Generate the gateway Caddyfile ConfigMap from the standalone file.
# Hash suffix is on by default — when Caddyfile changes, the ConfigMap gets
# a new hashed name, kustomize rewrites the Deployment volume reference,
# and the gateway pod restarts automatically with the new config.
configMapGenerator:
- name: gateway-config
files:
- Caddyfile

View File

@@ -21,9 +21,18 @@ spec:
envFrom:
- configMapRef:
name: eth-config
volumeMounts:
- name: documents
mountPath: /mnt/documents
readOnly: true
resources:
requests:
memory: 128Mi
cpu: 100m
limits:
memory: 512Mi
volumes:
- name: documents
hostPath:
path: /mnt/documents
type: Directory

View File

@@ -8,3 +8,7 @@ nodes:
hostPort: 8050
listenAddress: "0.0.0.0"
protocol: TCP
extraMounts:
- hostPath: /home/mariano/Documents
containerPath: /mnt/documents
readOnly: true

View File

@@ -5,9 +5,11 @@ resources:
- ../../base
patches:
# In-cluster Caddy gateway owns the single NodePort. It routes by Host header
# to docs / minio / future services via service DNS inside the cluster.
- target:
kind: Service
name: docs
name: gateway
patch: |
- op: replace
path: /spec/type

3
ctrl/seed.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
kubectl --context kind-eth -n eth exec -i deploy/lambda -- python seed.py /mnt/documents