Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix egress gateway getting started guide #15984

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions Documentation/gettingstarted/egress-gateway.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Additionally enabling feature requires ``enable-bpf-masquerade=true`` and
.. parsed-literal::

helm install cilium |CHART_RELEASE| \\
--set enableEgressGateway=true \\
--namespace kube-system \\
--set egressGateway.enabled=true \\
--set bpf.masquerade=true \\
--set kubeProxyReplacement=strict

Expand Down Expand Up @@ -97,7 +98,7 @@ will contain something like the following:

$ tail /var/log/nginx/access.log
[...]
192.168.33.11 - - [04/Apr/2021:22:06:57 +0000] "GET / HTTP/1.1" 200 612 "-" "Wget/1.19.4 (linux-gnu)"
192.168.33.11 - - [04/Apr/2021:22:06:57 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.52.1"

In the previous example, the client pod is running on the node ``192.168.33.11``, so the result makes sense.
This is the default Kubernetes behavior without egress NAT.
Expand Down Expand Up @@ -140,5 +141,5 @@ following shows that the request is coming from ``192.168.33.100`` now, instead

$ tail /var/log/nginx/access.log
[...]
192.168.33.100 - - [04/Apr/2021:22:06:57 +0000] "GET / HTTP/1.1" 200 612 "-" "Wget/1.19.4 (linux-gnu)"
192.168.33.100 - - [04/Apr/2021:22:06:57 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.52.1"

16 changes: 16 additions & 0 deletions examples/kubernetes-egress-gateway/egress-ip-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ spec:
labels:
name: "egress-ip-assign"
spec:
affinity:
# the following pod affinity ensures that the "egress-ip-assign" pod
# runs on the same node as the mediabot pod
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: class
operator: In
values:
- mediabot
- key: org
operator: In
values:
- empire
topologyKey: "kubernetes.io/hostname"
hostNetwork: true
containers:
- name: egress-ip
Expand Down
4 changes: 2 additions & 2 deletions examples/kubernetes-egress-gateway/egress-nat-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ spec:
# namespaceSelector:
# matchLabels:
# ns: default
destinationCidrs:
destinationCIDRs:
- 192.168.33.13/32
egressSourceIp: "192.168.33.100"
egressSourceIP: "192.168.33.100"