Skip to content

Instantly share code, notes, and snippets.

@wesleywillians
Created August 20, 2019 21:17
Show Gist options
  • Save wesleywillians/d5adc3c954f62aa0a61daeaf5fddced8 to your computer and use it in GitHub Desktop.
Save wesleywillians/d5adc3c954f62aa0a61daeaf5fddced8 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
server {
listen 80;
index index.php index.html;
root /usr/share/nginx/html;
rewrite ^/google$ http://google.com permanent;
}
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: hello-nginx
spec:
replicas: 1
template:
metadata:
labels:
app: hello-nginx
spec:
containers:
- name: nginx
image: nginx:1.17-alpine
ports:
- containerPort: 80
resources:
requests:
memory: "100Mi"
cpu: "200m"
limits:
cpu: "250m"
memory: "200Mi"
volumeMounts:
- mountPath: /etc/nginx/conf.d
name: nginx-conf
readOnly: true
volumes:
- name: nginx-conf
configMap:
name: nginx-conf
items:
- key: nginx.conf
path: nginx.conf
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
type: LoadBalancer
ports:
- port: 80
selector:
app: hello-nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment