Skip to content

Commit e36214a

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

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

serverless-fleets/README.md

Lines changed: 9 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,14 @@ 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 you can use after startup hooks to deploy a HTTP proxy on each worker node that intercepts all
531+
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`.
532+
533+
525534
## HowTo
526535
527536
### How to use your own container and image
@@ -551,7 +560,6 @@ Once the push is complete, you can run the fleet by modifying `./run` and replac
551560
- the environment variables, e.g. `--env foo=bar`
552561
553562
554-
555563
### How to access logs
556564
557565
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", "%{http_code}", "--output", "/dev/null", "http://example.com"]}
2+
{ "command":"curl", "args": ["--silent", "--write-out", "%{http_code}", "--output", "/dev/null", "http://google.com"]}

0 commit comments

Comments
 (0)