Skip to content

Instantly share code, notes, and snippets.

@alkar
Created March 29, 2019 13:43
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 alkar/5052b1ca10dd851d90124dc76b274aa0 to your computer and use it in GitHub Desktop.
Save alkar/5052b1ca10dd851d90124dc76b274aa0 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
namespace: default
data:
default.conf: |
server {
listen 8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: default
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:alpine
securityContext:
runAsUser: 100
runAsGroup: 101
volumeMounts:
- mountPath: /etc/nginx/conf.d
readOnly: true
name: nginx-config
- mountPath: /var/run
name: varrun
ports:
- containerPort: 2048
volumes:
- name: nginx-config
configMap:
name: nginx-config
- name: varrun
emptyDir:
medium: Memory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment