-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathapi.yaml
45 lines (44 loc) · 967 Bytes
/
api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# kubernetes-fastapi LoadBalancer Service
# Enables the pods in a deployment to be accessible from outside the cluster
apiVersion: v1
kind: Service
metadata:
name: kf-api-svc
spec:
selector:
app: kf-api
ports:
- protocol: "TCP"
port: 8080
targetPort: 8080
type: LoadBalancer
---
# kf-api Deployment
# Defines the deployment of the app running in a pod on any worker node
apiVersion: apps/v1
kind: Deployment
metadata:
name: kf-api
labels:
app: kf-api
spec:
replicas: 1
selector:
matchLabels:
app: kf-api
template:
metadata:
labels:
app: kf-api
spec:
containers:
- name: kf-api
image: 4oh4/kubernetes-fastapi:1.0.0
ports:
- containerPort: 8080
imagePullPolicy: Always
resources:
# You must specify requests for CPU to autoscale
# based on CPU utilization
requests:
cpu: "250m"