Skip to content

Commit a07e673

Browse files
committed
Add squid-proxy to readme
1 parent 039c00d commit a07e673

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

serverless-fleets/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Using both the intuitive graphical user interface and the command line, you will
1919
- [Tutorial: Docling](./tutorials/docling/README.md)
2020
- [Tutorial: Batch Inferencing](./tutorials/inferencing/README.md)
2121
- [Tutorial: Monte Carlo Simulation](./tutorials/simulation/README.md)
22+
- [Example: HTTP egress control](#http-egress-control)
2223
- [HowTo](#howto)
2324
- [Troubleshooting](#troubleshooting)
2425

@@ -522,6 +523,13 @@ Download the results from the output COS bucket to `./data/output`
522523
- [Tutorial: Simulation](./tutorials/simulation/README.md)
523524
524525
526+
## Examples
527+
528+
### HTTP egress control
529+
530+
In order to control/monitor/capture HTTP egress traffic on your tasks for which security group based network controls are not sufficient i.e. hostname based controls: you can use after startup hooks to deploy a HTTP proxy on each worker node that intercepts all HTTP traffic of the tasks running on that worker node. An example using squid proxy to allowlist only traffic to a single domain can be found in `run_hook_squid_http_proxy`.
531+
532+
525533
## HowTo
526534
527535
### How to use your own container and image
@@ -551,7 +559,6 @@ Once the push is complete, you can run the fleet by modifying `./run` and replac
551559
- the environment variables, e.g. `--env foo=bar`
552560
553561
554-
555562
### How to access logs
556563
557564
An IBM Cloud Logs instance is being setup and enabled by default during the automated One Time Setup. Each fleet worker will ingest logs to the IBM Cloud Logs instance by default. [Navigating to the UI](https://cloud.ibm.com/docs/cloud-logs?topic=cloud-logs-instance-launch) and use [Using Livetail](https://cloud.ibm.com/docs/cloud-logs?topic=cloud-logs-livetail) or [Filtering log data](https://cloud.ibm.com/docs/cloud-logs?topic=cloud-logs-query-data-filter) to view the logs.

serverless-fleets/run_hook_squid_http_proxy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,11 @@ OUTER
9898

9999
ibmcloud ce fleet create --name "fleet-${uuid}" \
100100
--tasks-state-store fleet-task-store \
101-
--tasks 1 \
102101
--image registry.access.redhat.com/ubi10/ubi-minimal \
103102
--cpu "2" \
104103
--memory "4G" \
105-
--command curl --argument "--silent" --argument "--write-out" --argument "%{http_code}" --argument "--output" --argument "/dev/null" --argument "http://example.com" \
106-
--max-scale 1 \
104+
--tasks-from-local-file run_hook_squid_http_proxy_commands.jsonl \
105+
--max-scale 2 \
107106
--retrylimit 0 \
108107
--subnetpool-name fleet-subnetpool \
109108
--env __CE_INTERNAL_HOOK_AFTER_STARTUP="${PREHOOK}"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{ "command":"curl", "args": ["--silent", "--write-out", "%{url} %{http_code}", "--output", "/dev/null", "http://example.com"]}
2+
{ "command":"curl", "args": ["--silent", "--write-out", "%{url} %{http_code}", "--output", "/dev/null", "http://google.com"]}

0 commit comments

Comments
 (0)