Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-files #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,15 @@ dmypy.json

# Pyre type checker
.pyre/

# OS generated files #
######################
.DS_Store
.DS_Store?
.history/*
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.13.0
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . /app/
EXPOSE 5000
CMD [ "gunicorn", "0.0.0.0:5000", "app:app" ]
48 changes: 48 additions & 0 deletions kubernetes/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: conversao-distancia
namespace: default
labels:
app: conversao-distancia
spec:
selector:
matchLabels:
app: conversao-distancia
replicas: 3
template:
metadata:
labels:
app: conversao-distancia
spec:
containers:
- name: conversao-distancia
image: fabricioveronez/conversao-distancia:latest
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 100m
memory: 100Mi
ports:
- containerPort: 5000
name: http
---
apiVersion: v1
kind: Service
metadata:
name: conversao-distancia
namespace: default
spec:
selector:
app: conversao-distancia
type: NodePort
ports:
- name: http
protocol: TCP
port: 80
targetPort: 5000
nodePort: 30000


18 changes: 18 additions & 0 deletions kubernetes/scaleobject.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: combined-scaledobject
spec:
scaleTargetRef:
name: conversao-distancia
minReplicaCount: 1
maxReplicaCount: 10
triggers:
- type: cpu
metadata:
type: Utilization
value: "50"
- type: memory
metadata:
type: Utilization
value: "20"