add local cluster config

This commit is contained in:
2026-05-13 12:53:55 -03:00
parent 957e45b8ad
commit 55aa31eff5
18 changed files with 313 additions and 5 deletions

View File

@@ -0,0 +1,14 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: eth-config
namespace: eth
data:
BUCKET_NAME: "my-company-reports-bucket"
PREFIX: "2026/04/"
URL_EXPIRY_SECONDS: "900"
S3_ENDPOINT_URL: "http://minio:9000"
AWS_ACCESS_KEY_ID: "minioadmin"
AWS_SECRET_ACCESS_KEY: "minioadmin"
AWS_REGION: "us-east-1"
AWS_DEFAULT_REGION: "us-east-1"

44
ctrl/k8s/base/docs.yaml Normal file
View File

@@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: docs
namespace: eth
spec:
replicas: 1
selector:
matchLabels:
app: docs
template:
metadata:
labels:
app: docs
spec:
containers:
- name: docs
image: eth-docs
ports:
- containerPort: 80
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 2
periodSeconds: 10
resources:
requests:
memory: 32Mi
cpu: 50m
limits:
memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
name: docs
namespace: eth
spec:
selector:
app: docs
ports:
- port: 80
targetPort: 80

View File

@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: eth
resources:
- namespace.yaml
- configmap.yaml
- minio.yaml
- lambda.yaml
- docs.yaml

29
ctrl/k8s/base/lambda.yaml Normal file
View File

@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: lambda
namespace: eth
spec:
replicas: 1
selector:
matchLabels:
app: lambda
template:
metadata:
labels:
app: lambda
spec:
containers:
- name: lambda
image: eth-lambda
command: ["sleep", "infinity"]
workingDir: /app
envFrom:
- configMapRef:
name: eth-config
resources:
requests:
memory: 128Mi
cpu: 100m
limits:
memory: 512Mi

63
ctrl/k8s/base/minio.yaml Normal file
View File

@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: minio
namespace: eth
spec:
replicas: 1
selector:
matchLabels:
app: minio
template:
metadata:
labels:
app: minio
spec:
containers:
- name: minio
image: minio/minio:latest
args: ["server", "/data", "--console-address", ":9001"]
env:
- name: MINIO_ROOT_USER
value: minioadmin
- name: MINIO_ROOT_PASSWORD
value: minioadmin
ports:
- containerPort: 9000
name: api
- containerPort: 9001
name: console
readinessProbe:
httpGet:
path: /minio/health/live
port: 9000
initialDelaySeconds: 5
periodSeconds: 10
volumeMounts:
- name: data
mountPath: /data
resources:
requests:
memory: 128Mi
cpu: 100m
limits:
memory: 512Mi
volumes:
- name: data
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: minio
namespace: eth
spec:
selector:
app: minio
ports:
- name: api
port: 9000
targetPort: 9000
- name: console
port: 9001
targetPort: 9001

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: eth

10
ctrl/k8s/kind-config.yaml Normal file
View File

@@ -0,0 +1,10 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: eth
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30050
hostPort: 8050
listenAddress: "0.0.0.0"
protocol: TCP

View File

@@ -0,0 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
patches:
- target:
kind: Service
name: docs
patch: |
- op: replace
path: /spec/type
value: NodePort
- op: add
path: /spec/ports/0/nodePort
value: 30050