Skip to content

Instantly share code, notes, and snippets.

@prabhakar97
Last active April 12, 2019 01:41
Show Gist options
  • Save prabhakar97/739dfe55fa710d8c1cffd5bc63bb99c5 to your computer and use it in GitHub Desktop.
Save prabhakar97/739dfe55fa710d8c1cffd5bc63bb99c5 to your computer and use it in GitHub Desktop.
Nginx deployment file with config maps
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx-dep
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:mainline-alpine
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 80
volumeMounts:
- name: nginx-config
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
- name: railsportal-nginx-config
mountPath: /etc/nginx/sites-enabled/railsportal.nginx.conf
subPath: railsportal.nginx.conf
volumes:
- name: nginx-config
configMap:
name: nginxconfig
- name: railsportal-nginx-config
configMap:
name: railsportalnginxconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment