-
Notifications
You must be signed in to change notification settings - Fork 14
Create IP detection utils and use in AWS security group creation #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5809316
Create IP detection utils and use in AWS security group creation
ArangoGutierrez fd8289b
[no-relnote] Update test data files
ArangoGutierrez b0713d2
[no-relnote] Update documentation for IP detection
ArangoGutierrez caa94f0
[no-relnote] Fix lints
ArangoGutierrez b63c2e2
[no-relnote] Remove check on aws_test for empty IP range
ArangoGutierrez 2f324b6
[no-relnote] Fix typo on instance.IngressIpRanges
ArangoGutierrez eb5da43
[no-relnote] Name user agent just Holodeck
ArangoGutierrez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| # IP Detection Guide | ||
|
|
||
| ## Overview | ||
|
|
||
| Holodeck automatically detects your public IP address when creating AWS | ||
| environments, eliminating the need to manually configure security group rules. | ||
|
|
||
| ## How It Works | ||
|
|
||
| ### Detection Process | ||
|
|
||
| 1. **Service Priority**: Tries multiple IP detection services in order | ||
| 1. **Fallback Strategy**: If one service fails, automatically tries the next | ||
| 1. **Validation**: Ensures detected IP is a valid public IPv4 address | ||
| 1. **CIDR Formatting**: Automatically adds `/32` suffix for AWS compatibility | ||
|
|
||
| ### Supported Services | ||
|
|
||
| - `https://api.ipify.org?format=text` (Primary) | ||
| - `https://ifconfig.me/ip` (Fallback 1) | ||
| - `https://icanhazip.com` (Fallback 2) | ||
| - `https://ident.me` (Fallback 3) | ||
|
|
||
| ### Timeout Configuration | ||
|
|
||
| - **Overall Timeout**: 15 seconds | ||
| - **Per-Service Timeout**: 5 seconds | ||
| - **Context Support**: Proper cancellation and timeout handling | ||
|
|
||
| ## Configuration Examples | ||
|
|
||
| ### Basic Usage (Recommended) | ||
|
|
||
| ```yaml | ||
| apiVersion: holodeck.nvidia.com/v1alpha1 | ||
| kind: Environment | ||
| metadata: | ||
| name: my-environment | ||
| spec: | ||
| provider: aws | ||
| instance: | ||
| type: g4dn.xlarge | ||
| region: us-west-2 | ||
| # No ingressIpRanges needed - IP detected automatically | ||
| ``` | ||
|
|
||
| ### With Additional IP Ranges | ||
|
|
||
| ```yaml | ||
| apiVersion: holodeck.nvidia.com/v1alpha1 | ||
| kind: Environment | ||
| metadata: | ||
| name: my-environment | ||
| spec: | ||
| provider: aws | ||
| instance: | ||
| type: g4dn.xlarge | ||
| region: us-west-2 | ||
| ingressIpRanges: | ||
| - "10.0.0.0/8" # Corporate network | ||
| - "172.16.0.0/12" # Additional network | ||
| # Your detected IP will be automatically added | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Common Issues | ||
|
|
||
| 1. **Network Connectivity**: Ensure outbound internet access to IP detection services | ||
| 1. **Firewall Rules**: Corporate firewalls may block IP detection services | ||
| 1. **Proxy Configuration**: Proxy settings may affect IP detection | ||
|
|
||
| ### Manual Override | ||
|
|
||
| If automatic detection fails, you can manually specify your IP: | ||
|
|
||
| ```yaml | ||
| spec: | ||
| provider: aws | ||
| instance: | ||
| type: g4dn.xlarge | ||
| region: us-west-2 | ||
| ingressIpRanges: | ||
| - "YOUR_PUBLIC_IP/32" # Replace with your actual public IP | ||
| ``` | ||
|
|
||
| ### Debugging | ||
|
|
||
| To debug IP detection issues: | ||
|
|
||
| ```bash | ||
| # Test IP detection manually | ||
| curl https://api.ipify.org?format=text | ||
| curl https://ifconfig.me/ip | ||
| curl https://icanhazip.com | ||
| curl https://ident.me | ||
| ``` | ||
|
|
||
| ## Security Considerations | ||
|
|
||
| ### IP Validation | ||
|
|
||
| The system validates that detected IPs are: | ||
|
|
||
| - Valid IPv4 addresses | ||
| - Public (not private, loopback, or link-local) | ||
| - Properly formatted for AWS security groups | ||
|
|
||
| ### Network Security | ||
|
|
||
| - Only your current public IP is granted access | ||
| - Additional IP ranges can be specified manually | ||
| - Security group rules are automatically configured | ||
|
|
||
| ## Best Practices | ||
|
|
||
| 1. **Use Automatic Detection**: Let Holodeck handle IP detection automatically | ||
| 1. **Specify Additional Ranges**: Use `ingressIpRanges` only for additional networks | ||
| 1. **Test Connectivity**: Verify access to IP detection services in your environment | ||
| 1. **Monitor Changes**: Be aware that your public IP may change (DHCP, mobile networks) | ||
|
|
||
| ## Related Documentation | ||
|
|
||
| - [Create Command](../commands/create.md#automated-ip-detection) | ||
| - [Prerequisites](../prerequisites.md#network-requirements) | ||
| - [Examples](../../examples/README.md#updated-aws-examples) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.