-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to get things working with kubernetes
This is mostly for the sake of learning: the fact that the sqlite database is in container means it's fairly useless: you can't scale horizontally. Future work will explore different ways of dealing what that. The Dockerfile is update to reflect the latest placement extraction changes and to put config in the container rather than using a shared volume. The placement-uwsgi.ini is update so it runs http directly. There's no need for an nginx or apache setup, a k8s LoadBalancer in deployment.yaml takes care of that. The uwsgi ini is based on info at: nginx/kubernetes-ingress#143 (comment) Using minikube the steps are: eval $(minikube docker-env) docker build -t placedock:1.0 . kubectl apply -f deployment.yaml kubectl expose deployment placement-deployment --type=LoadBalancer minikube service placement-deployment --url
- Loading branch information
Showing
3 changed files
with
71 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 | ||
kind: Deployment | ||
metadata: | ||
name: placement-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: placement | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: placement | ||
spec: | ||
containers: | ||
- name: placement | ||
image: placedock:1.0 | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
|
||
[uwsgi] | ||
chmod-socket = 666 | ||
socket = 172.*:80 | ||
lazy-apps = true | ||
add-header = Connection: close | ||
buffer-size = 65535 | ||
hook-master-start = unix_signal:15 gracefully_kill_them_all | ||
thunder-lock = true | ||
plugins = python3 | ||
enable-threads = true | ||
worker-reload-mercy = 90 | ||
exit-on-reload = false | ||
die-on-term = true | ||
master = true | ||
processes = 4 | ||
wsgi-file = /usr/bin/nova-placement-api | ||
env = OS_PLACEMENT_CONFIG_DIR=/shared/etc/nova | ||
|
||
processes = 2 | ||
threads = 10 | ||
|
||
http-socket = :80 | ||
http-enable-proxy-protocol = 1 | ||
http-auto-chunked = true | ||
http-keepalive = 75 | ||
http-timeout = 75 | ||
stats = :1717 | ||
stats-http = 1 | ||
offload-threads = 10 | ||
|
||
# Better startup/shutdown in docker: | ||
die-on-term = 1 | ||
lazy-apps = 0 | ||
|
||
vacuum = 1 | ||
master = 1 | ||
enable-threads = true | ||
thunder-lock = 1 | ||
buffer-size = 65535 | ||
|
||
# Logging | ||
log-x-forwarded-for = true | ||
|
||
# Avoid errors on aborted client connections | ||
ignore-sigpipe = true | ||
ignore-write-errors = true | ||
disable-write-exception = true | ||
|
||
no-defer-accept = 1 | ||
|
||
# Limits, Kill requests after 120 seconds | ||
harakiri = 120 | ||
harakiri-verbose = true | ||
post-buffering = 4096 | ||
|
||
# Custom headers | ||
add-header = Connection: Keep-Alive |