Created
March 29, 2019 13:43
-
-
Save alkar/5052b1ca10dd851d90124dc76b274aa0 to your computer and use it in GitHub Desktop.
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
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