Skip to content

Instantly share code, notes, and snippets.

@toonsevrin
Created June 26, 2020 11:26
Show Gist options
  • Save toonsevrin/2d6e99966ed745b2b9372f11d6f13414 to your computer and use it in GitHub Desktop.
Save toonsevrin/2d6e99966ed745b2b9372f11d6f13414 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-forwarder-conf
data:
nginx.conf: |
events {
worker_connections 512;
}
stream {
server {
listen 80;
proxy_pass service_to_forward:80;
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-forwarder
spec:
replicas: 1
selector:
matchLabels:
app: nginx-forwarder
template:
metadata:
labels:
app: nginx-forwarder
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
volumeMounts:
- mountPath: /etc/nginx # mount nginx-conf volumn to /etc/nginx
readOnly: true
name: nginx-forwarder-conf
- name: tailscale
image: exorath/tailscale
securityContext:
capabilities:
add:
- NET_ADMIN
volumes:
- name: nginx-forwarder-conf
configMap:
name: nginx-forwarder-conf # place ConfigMap `nginx-conf` on /etc/nginx
items:
- key: nginx.conf
path: nginx.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment