Skip to content

Commit

Permalink
Merge pull request #26 from marcoshuck/feature/kubernetes
Browse files Browse the repository at this point in the history
Kubernetes
  • Loading branch information
marcoshuck committed Oct 20, 2023
2 parents 4f1fd84 + d7b4cdd commit 8026802
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
21 changes: 21 additions & 0 deletions deployments/kubernetes/config-map.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: config
labels:
app.kubernetes.io/name: todo
app.kubernetes.io/component: backend
app.kubernetes.io/version: v1
data:
# Application configuration
ENVIRONMENT: "production"
APPLICATION_NAME: "todo"
APPLICATION_PORT: "3030"

# Database configuration
DATABASE_ENGINE: "mysql"
DATABASE_HOST: "localhost"
DATABASE_USER: "user"
DATABASE_PASSWORD: "changeme"
DATABASE_PORT: "3306"
DATABASE_CHARSET: "utf8mb4"
56 changes: 56 additions & 0 deletions deployments/kubernetes/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: todo
labels:
app.kubernetes.io/name: todo
app.kubernetes.io/component : backend
app.kubernetes.io/version: v1
spec:
replicas: 1
selector:
matchLabels:
app: todo
template:
metadata:
labels:
app: todo
spec:
containers:
- name: app
image: ghcr.io/marcoshuck/todo/app:latest
ports:
- containerPort: 3030
envFrom:
- configMapRef:
name: config
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"

- name: gateway
image: ghcr.io/marcoshuck/todo/gateway:latest
ports:
- containerPort: 8080
env:
- name: HOST
value: "localhost"
- name: PORT
value: "3030"
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
4 changes: 4 additions & 0 deletions deployments/kubernetes/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: todo
16 changes: 16 additions & 0 deletions deployments/kubernetes/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: todo
labels:
app.kubernetes.io/name: todo
app.kubernetes.io/component: backend
app.kubernetes.io/version: v1
spec:
selector:
app.kubernetes.io/name: todo
app.kubernetes.io/version: v1
ports:
- protocol: TCP
port: 80
targetPort: 8080

0 comments on commit 8026802

Please sign in to comment.