Created
June 26, 2020 11:26
-
-
Save toonsevrin/2d6e99966ed745b2b9372f11d6f13414 to your computer and use it in GitHub Desktop.
This file contains hidden or 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-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