initial app
This commit is contained in:
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
FROM python:3-alpine
|
||||||
|
|
||||||
|
RUN pip install fastapi[standard]
|
||||||
|
|
||||||
|
COPY ./src /app
|
||||||
|
|
||||||
|
ENTRYPOINT fastapi run
|
||||||
32
k8s/app.yaml
Normal file
32
k8s/app.yaml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: fastapi-app-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: fastapi-app
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: fastapi-app
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: fastapi-app-container
|
||||||
|
image: igit.danilkolesnikov.ru/danil/playground_app
|
||||||
|
ports:
|
||||||
|
- containerPort: 8000
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: fastapi-app-service
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: fastapi-app
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 8000
|
||||||
|
targetPort: 8000
|
||||||
17
skaffold.yaml
Normal file
17
skaffold.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: skaffold/v4beta13
|
||||||
|
kind: Config
|
||||||
|
metadata:
|
||||||
|
name: playground
|
||||||
|
build:
|
||||||
|
artifacts:
|
||||||
|
- image: igit.danilkolesnikov.ru/danil/playground_app
|
||||||
|
docker:
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
manifests:
|
||||||
|
rawYaml:
|
||||||
|
- k8s/app.yaml
|
||||||
|
|
||||||
|
portForward:
|
||||||
|
- resourceType: Service
|
||||||
|
resourceName: fastapi-app-service
|
||||||
|
port: 8000
|
||||||
8
src/main.py
Normal file
8
src/main.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
from fastapi import FastAPI
|
||||||
|
|
||||||
|
app = FastAPI()
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/")
|
||||||
|
async def read_root():
|
||||||
|
return {"Hello": "World"}
|
||||||
Reference in New Issue
Block a user