Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulait committed Jan 6, 2025
1 parent d54bcee commit e8be2af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,14 @@ sessionAffinityConfig:
## Additional environment variables
To tweak CCM based on needs, one can overwrite the default values set for caches and requests by setting appropriate environment variables when applying the manifest or helm chart.

| Environment Variable | Default | Description |
|-----------------------------------|---------|-------------------------------------------------------------|
| `LINODE_INSTANCE_CACHE_TTL` | `15` | Default timeout of instance cache in seconds |
| `LINODE_ROUTES_CACHE_TTL_SECONDS` | `60` | Default timeout of route cache in seconds |
| `LINODE_REQUEST_TIMEOUT_SECONDS` | `120` | Default timeout in seconds for http requests to linode API |
| `LINODE_EXTERNAL_SUBNET` | | Mark private network as external. Example - `172.24.0.0/16` |
| Environment Variable | Default | Description |
|-----------------------------------|-------------|-------------------------------------------------------------|
| `LINODE_INSTANCE_CACHE_TTL` | `15` | Default timeout of instance cache in seconds |
| `LINODE_ROUTES_CACHE_TTL_SECONDS` | `60` | Default timeout of route cache in seconds |
| `LINODE_REQUEST_TIMEOUT_SECONDS` | `120` | Default timeout in seconds for http requests to linode API |
| `LINODE_EXTERNAL_SUBNET` | | Mark private network as external. Example - `172.24.0.0/16` |
| `BGP_CUSTOM_ID_MAP` | | Use your own map instead of default region map for BGP |
| `BGP_PEER_PREFIX` | `2600:3c0f` | Use your own BGP peer prefix instead of default one |

## Generating a Manifest for Deployment
Use the script located at `./deploy/generate-manifest.sh` to generate a self-contained deployment manifest for the Linode CCM. Two arguments are required.
Expand Down
8 changes: 4 additions & 4 deletions cloud/linode/cilium_loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,8 @@ func (l *loadbalancers) getCiliumLBIPPool(ctx context.Context, service *v1.Servi

// NOTE: Cilium CRDs must be installed for this to work
func (l *loadbalancers) ensureCiliumBGPPeeringPolicy(ctx context.Context) error {
if raw, ok := os.LookupEnv("BGPCustomIDMap"); ok {
klog.Info("BGPCustomIDMap env variable specified, using it instead of the default region map")
if raw, ok := os.LookupEnv("BGP_CUSTOM_ID_MAP"); ok {
klog.Info("BGP_CUSTOM_ID_MAP env variable specified, using it instead of the default region map")
if err := json.Unmarshal([]byte(raw), &regionIDMap); err != nil {
return err
}

Check warning on line 489 in cloud/linode/cilium_loadbalancers.go

View check run for this annotation

Codecov / codecov/patch

cloud/linode/cilium_loadbalancers.go#L486-L489

Added lines #L486 - L489 were not covered by tests
Expand Down Expand Up @@ -551,8 +551,8 @@ func (l *loadbalancers) ensureCiliumBGPPeeringPolicy(ctx context.Context) error
},
}
bgpPeerPrefix := defaultBGPPeerPrefix
if raw, ok := os.LookupEnv("BGPPeerPrefix"); ok {
klog.Info("BGPPeerPrefix env variable specified, using it instead of the default bgpPeer prefix")
if raw, ok := os.LookupEnv("BGP_PEER_PREFIX"); ok {
klog.Info("BGP_PEER_PREFIX env variable specified, using it instead of the default bgpPeer prefix")
bgpPeerPrefix = raw
}

Check warning on line 557 in cloud/linode/cilium_loadbalancers.go

View check run for this annotation

Codecov / codecov/patch

cloud/linode/cilium_loadbalancers.go#L555-L557

Added lines #L555 - L557 were not covered by tests
// As in https://github.com/linode/lelastic, there are 4 peers per DC
Expand Down

0 comments on commit e8be2af

Please sign in to comment.