Skip to content

Instantly share code, notes, and snippets.

@ironhouzi
Created December 8, 2016 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ironhouzi/ee80dd6d77a9fe3d03f7b9781503a47c to your computer and use it in GitHub Desktop.
Save ironhouzi/ee80dd6d77a9fe3d03f7b9781503a47c to your computer and use it in GitHub Desktop.
kind: ConfigMap
apiVersion: v1
metadata:
name: nginxconfigmap
data:
nginxconfig: |-
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
server {
listen 80;
location / {
include /etc/nginx/uwsgi_params;
uwsgi_pass wpsapp:8001;
uwsgi_read_timeout 300;
keepalive_timeout 0;
}
}
}
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: wps
labels:
name: wps
spec:
replicas: 1
template:
metadata:
labels:
app: wps
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
volumeMounts:
- mountPath: /etc/nginx
name: config
volumes:
- name: config
configMap:
name: nginxconfigmap
items:
- key: nginxconfig
path: nginx.conf
---
kind: Service
apiVersion: v1
metadata:
name: wps
labels:
name: wps
spec:
ports:
- port: 80
name: http
targetPort: 80
selector:
app: wps
type: LoadBalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment