Skip to content

Commit 308d6a2

Browse files
authored
Merge pull request #69 from Eeshu-Yadav/container-deploy-support-clean
Better support container deploy
2 parents 73fcb1b + 70355cf commit 308d6a2

File tree

9 files changed

+259
-15
lines changed

9 files changed

+259
-15
lines changed

Cargo.lock

Lines changed: 8 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fmt-check:
77
cargo fmt --all -- --check
88

99
lint:
10-
cargo clippy --all-targets --all-features -- -D warnings
10+
cargo clippy --all-targets --all-features
1111

1212
build:
1313
cargo build --workspace --release --locked
@@ -18,7 +18,7 @@ test:
1818
# Sequential CI (keep for local/dev reproducibility)
1919
ci: init
2020
cargo fmt --all -- --check
21-
cargo clippy --all-targets --all-features -- -D warnings
21+
cargo clippy --all-targets --all-features
2222
cargo build --workspace --release --locked
2323
cargo test --workspace --release --locked
2424

@@ -28,7 +28,7 @@ ci-parallel: init
2828
@bash -ec '\
2929
set -o pipefail; \
3030
cargo fmt --all -- --check & pid_fmt=$$!; \
31-
cargo clippy --all-targets --all-features -- -D warnings & pid_clippy=$$!; \
31+
cargo clippy --all-targets --all-features & pid_clippy=$$!; \
3232
cargo build --workspace --release --locked & pid_build=$$!; \
3333
wait $$pid_fmt; rc_fmt=$$?; \
3434
wait $$pid_clippy; rc_clippy=$$?; \

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,37 @@ Orion Proxy configuration is generated from Envoy's xDS protobuf definitions. Or
2828

2929
## Quick Start
3030

31+
**Note:** To control how many CPU cores/threads Orion uses (especially in containers), set the `ORION_CPU_LIMIT` environment variable. In Kubernetes, use the Downward API:
32+
33+
```yaml
34+
env:
35+
- name: ORION_CPU_LIMIT
36+
valueFrom:
37+
resourceFieldRef:
38+
resource: limits.cpu
39+
divisor: "1"
40+
```
41+
42+
## CPU/Thread Limit Configuration
43+
44+
Orion can be configured to use a specific number of CPU cores/threads by setting the `ORION_CPU_LIMIT` environment variable. This is especially useful in containerized environments where access to `/sys/fs` may be restricted.
45+
46+
### Kubernetes Example (Downward API)
47+
48+
Add the following to your container spec to set `ORION_CPU_LIMIT` to the container's CPU limit:
49+
50+
```yaml
51+
env:
52+
- name: ORION_CPU_LIMIT
53+
valueFrom:
54+
resourceFieldRef:
55+
resource: limits.cpu
56+
divisor: "1"
57+
```
58+
59+
Orion will automatically use this value to determine the number of threads/cores.
60+
61+
3162
### Building
3263
```console
3364
git clone https://github.com/kmesh-net/orion

docker/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ docker run -d \
7777
| ------------------ | ---------------------------------------- | ----------- |
7878
| `CONTROL_PLANE_IP` | IP address of the control plane | `127.0.0.1` |
7979
| `LOG_LEVEL` | Logging level (debug, info, warn, error) | `info` |
80+
| `ORION_CPU_LIMIT` | Number of CPU cores/threads to use. Set this to control Orion's concurrency, especially in containers. | (auto-detect) |
81+
### Example: Setting CPU Limit in Docker
82+
83+
To explicitly set the number of CPU cores/threads Orion should use:
84+
85+
```bash
86+
docker run -d \
87+
-e ORION_CPU_LIMIT=2 \
88+
--name orion-proxy \
89+
orion-proxy
90+
```
91+
92+
Or, in Kubernetes, use the Downward API as shown in the main README.
8093

8194
## Verification
8295

orion-configuration/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ url.workspace = true
4646

4747
[dev-dependencies]
4848
tracing-test.workspace = true
49+
tempfile = "3.8"
4950

5051
[features]
5152
default = ["envoy-conversions"]

orion-configuration/src/config/bootstrap.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ mod envoy_conversions {
157157
grpc_async_client_manager_config,
158158
stats_flush,
159159
memory_allocator_manager,
160+
..
160161
} = envoy;
161162
unsupported_field!(
162163
// node,

orion-configuration/src/config/metrics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ mod envoy_conversions {
6868
use_tag_extracted_name,
6969
prefix,
7070
protocol_specifier,
71+
..
7172
} = value;
7273
unsupported_field!(
7374
// prefix,

orion-configuration/src/config/network_filters/http_connection_manager.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ mod envoy_conversions {
985985
per_request_buffer_limit_bytes,
986986
request_mirror_policies,
987987
metadata,
988+
..
988989
} = envoy;
989990
unsupported_field!(
990991
// name,
@@ -1160,6 +1161,7 @@ mod envoy_conversions {
11601161
per_request_buffer_limit_bytes,
11611162
stat_prefix,
11621163
action,
1164+
..
11631165
} = envoy;
11641166
unsupported_field!(
11651167
//name,

0 commit comments

Comments
 (0)