Last active
September 13, 2018 14:32
-
-
Save AAber/7704c7bcad014616caedeb54907dc29c to your computer and use it in GitHub Desktop.
Expose a node application running in a Kubernetes DaemonSet by running a socat DaemonSet
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: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
name: gateway-daemon-set | |
namespace: default | |
spec: | |
template: | |
metadata: | |
labels: | |
app: gateway-app | |
name: gateway | |
spec: | |
containers: | |
- image: gateway:0.0.1 | |
ports: | |
- containerPort: 3000 | |
hostPort: 3000 | |
name: gateway-app | |
env: | |
- name: NODE_ENV | |
value: staging | |
hostNetwork: true | |
hostPID: true |
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: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
name: socat-ds | |
namespace: default | |
spec: | |
template: | |
metadata: | |
labels: | |
app: socat-app | |
name: socat | |
spec: | |
containers: | |
- image: socat:0.0.1 | |
ports: | |
- containerPort: 80 | |
hostPort: 80 | |
name: socat | |
hostNetwork: true | |
hostPID: true |
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
FROM alpine | |
RUN apk update && apk add curl net-tools socat | |
CMD ["socat","TCP4-LISTEN:80,fork","TCP4:localhost:3000"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment