Skip to content

Instantly share code, notes, and snippets.

@negz
Created January 31, 2018 01:46
Show Gist options
  • Save negz/87df3c2916b1af346ff7305bbd3adbda to your computer and use it in GitHub Desktop.
Save negz/87df3c2916b1af346ff7305bbd3adbda to your computer and use it in GitHub Desktop.
linkerd init container for transparent HTTP proxy
initContainers:
- name: linkerd-transparent-proxy
env:
- name: L5D_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: L5D_PORT
value: "4140"
image: googlecontainer/debian-iptables-amd64:v9
securityContext:
privileged: true
command: ['sh', '-c', 'iptables -t nat -A OUTPUT -p tcp -j DNAT -m multiport --dports 80 --to ${L5D_HOST}:${L5D_PORT} -m comment --comment "send all HTTP traffic via linkerd"']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment