Skip to content

Commit b65282b

Browse files
committed
Restrict IPs for full ingress content
1 parent 2af0a49 commit b65282b

3 files changed

Lines changed: 27 additions & 2 deletions

File tree

docs/authoring_content.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,31 @@ Depending on your Docker/Finch version, you might need to add a flag to enable [
157157
158158
If your AWS credentials expire you can `exit` and restart the shell, which will not affect your cluster.
159159
160+
### Restricting inbound traffic
161+
162+
Several workshop labs create internet-facing load balancers (NLB or ALB). By default these are open to all traffic (`0.0.0.0/0`), but you can restrict them to your IP address using the `SOURCE_IP_ADDRESS` environment variable.
163+
164+
The behavior is:
165+
166+
- **Not set or `auto`**: Automatically resolves your public IP via `https://checkip.amazonaws.com` and restricts inbound traffic to that address
167+
- **Set to a specific IP**: Uses the provided value verbatim
168+
169+
For example:
170+
171+
```bash
172+
# Auto-detect your IP
173+
SOURCE_IP_ADDRESS=auto make shell
174+
175+
# Use a specific IP
176+
SOURCE_IP_ADDRESS=203.0.113.10 make shell
177+
```
178+
179+
This works with `make shell`, `make ide`, `make deploy-ide`, and the automated test suite. The resolved IP is appended with `/32` and exported as `INBOUND_CIDRS`, which is used by:
180+
181+
- Kubernetes Service annotations (`service.beta.kubernetes.io/load-balancer-source-ranges`) for NLBs
182+
- Ingress annotations (`alb.ingress.kubernetes.io/inbound-cidrs`) for ALBs
183+
- Terraform variable `var.inbound_cidrs` passed to lab modules
184+
160185
## Planning your content
161186
162187
An EKS Workshop lab generally consists of several components:

website/docs/fundamentals/exposing/ingress/external-dns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ You can also verify the new DNS record in the AWS Route 53 console by clicking t
7676
Route 53 private hosted zones are only accessible from associated VPCs, in this case the EKS cluster VPC. To test the DNS entry we'll use `curl` from inside a pod:
7777

7878
```bash hook=dns-curl
79-
$ kubectl -n ui exec -it \
79+
$ kubectl -n ui exec \
8080
deployment/ui -- bash -c "curl -i http://ui.retailstore.com/actuator/health/liveness; echo"
8181

8282
HTTP/1.1 200 OK

website/docs/fundamentals/exposing/loadbalancer/ip-mode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Service/ui-nlb
4343
Apply the manifest with kustomize:
4444

4545
```bash
46-
$ kubectl apply -k ~/environment/eks-workshop/modules/exposing/load-balancer/ip-mode
46+
$ kubectl kustomize ~/environment/eks-workshop/modules/exposing/load-balancer/ip-mode | envsubst | kubectl apply -f -
4747
```
4848

4949
It will take a few minutes for the configuration of the load balancer to be updated. Run the following command to ensure the annotation is updated:

0 commit comments

Comments
 (0)