Skip to content

Commit

Permalink
Learning Kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinamXx committed Jan 21, 2023
1 parent 7cae0bb commit 183b7cb
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 0 deletions.
15 changes: 15 additions & 0 deletions MLOps Zoomcamp/07. Kubernetes/ping/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.8.12-slim

RUN pip install pipenv

WORKDIR /app

COPY [ "Pipfile", "Pipfile.lock", "./"]

RUN pipenv install --system --deploy

COPY "ping.py" .

EXPOSE 9696

ENTRYPOINT ["gunicorn", "--bind=0.0.0.0:9696", "ping:app"]
13 changes: 13 additions & 0 deletions MLOps Zoomcamp/07. Kubernetes/ping/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
flask = "*"
gunicorn = "*"

[dev-packages]

[requires]
python_version = "3.10"
133 changes: 133 additions & 0 deletions MLOps Zoomcamp/07. Kubernetes/ping/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions MLOps Zoomcamp/07. Kubernetes/ping/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ping-deployment
spec:
replicas: 1
selector:
matchLabels:
app: ping
template:
metadata:
labels:
app: ping
spec:
containers:
- name: ping-pod
image: ping:v001
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 9696
12 changes: 12 additions & 0 deletions MLOps Zoomcamp/07. Kubernetes/ping/ping.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# INITIALIZING LIBRARIES:
from flask import Flask

app = Flask('ping')

@app.route('/ping', methods=['GET'])
def ping():
return "PONG"


if __name__ == '__main__':
app.run(debug=True, host="0.0.0.0", port=9696)
Empty file.

0 comments on commit 183b7cb

Please sign in to comment.