Expose it as a service.
This commit is contained in:
parent
35f3265659
commit
9222476444
@ -4,7 +4,6 @@ metadata:
|
|||||||
name: autoscale-test
|
name: autoscale-test
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
replicas: 3
|
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: autoscale-test
|
app: autoscale-test
|
||||||
@ -33,3 +32,16 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
cpu: "250m"
|
cpu: "250m"
|
||||||
memory: "256Mi"
|
memory: "256Mi"
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: autoscale-test
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: autoscale-test
|
||||||
|
type: LoadBalancer
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
targetPort: "http"
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import multiprocessing
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
env_port = int(os.environ.get("PORT", 8080))
|
env_port = int(os.environ.get("PORT", 8080))
|
||||||
|
|
||||||
bind = f"0.0.0.0:{env_port}"
|
bind = f"0.0.0.0:{env_port}"
|
||||||
workers = max(2, multiprocessing.cpu_count() * 2 + 1)
|
workers = int(os.environ.get("WORKERS", 8))
|
||||||
preload_app = True
|
preload_app = True
|
||||||
max_requests = 100
|
max_requests = 100
|
||||||
max_requests_jitter = 50
|
max_requests_jitter = 50
|
||||||
|
Loading…
x
Reference in New Issue
Block a user