You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gitpod-network-check/README.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,17 +55,17 @@ A CLI to check if your network setup is suitable for the installation of Gitpod.
55
55
56
56
2. Run the network diagnosis
57
57
58
-
The tool supports different modes for running the checks, specified by the `--mode` flag (`ec2`, `lambda`, `local`).
58
+
The tool supports different runners for executing the checks, specified by the `--runner` flag (`ec2`, `lambda`, `local`).
59
59
60
-
**Using EC2 Mode (Default):**
60
+
**Using EC2 Runner (Default):**
61
61
62
62
This mode launches temporary EC2 instances in your specified subnets to perform the network checks. This most closely simulates the environment where Gitpod components will run.
63
63
64
-
To start the diagnosis using EC2 mode: `./gitpod-network-check diagnose --mode ec2` (or simply `./gitpod-network-check diagnose` as EC2 is the default).
64
+
To start the diagnosis using the EC2 runner: `./gitpod-network-check diagnose --runner ec2` (or simply `./gitpod-network-check diagnose` as EC2 is the default).
65
65
66
66
```console
67
-
# Example output for EC2 mode
68
-
./gitpod-network-check diagnose --mode ec2
67
+
# Example output for EC2 runner
68
+
./gitpod-network-check diagnose --runner ec2
69
69
INFO[0000] ℹ️ Running with region `eu-central-1`, main subnet `[subnet-0ed211f14362b224f subnet-041703e62a05d2024]`, pod subnet `[subnet-075c44edead3b062f subnet-06eb311c6b92e0f29]`, hosts `[accounts.google.com https://github.com]`, ami ``, and API endpoint ``
70
70
INFO[0000] ✅ Main Subnets are valid
71
71
INFO[0000] ✅ Pod Subnets are valid
@@ -127,47 +127,47 @@ A CLI to check if your network setup is suitable for the installation of Gitpod.
127
127
INFO[0306] ✅ Security group 'sg-00d4a66a7840ebd67' deleted
128
128
```
129
129
130
-
**Using Lambda Mode:**
130
+
**Using Lambda Runner:**
131
131
132
132
This mode uses AWS Lambda functions deployed into your specified subnets to perform the network checks. It avoids the need to launch full EC2 instances but has its own prerequisites.
133
133
134
134
***Prerequisites for Lambda Mode:**
135
135
***IAM Permissions:** The AWS credentials used to run `gitpod-network-check` need permissions to manage Lambda functions, IAM roles, security groups, and CloudWatch Logs. Specifically, it needs to perform actions like: `lambda:CreateFunction`, `lambda:GetFunction`, `lambda:DeleteFunction`, `lambda:InvokeFunction`, `iam:CreateRole`, `iam:GetRole`, `iam:DeleteRole`, `iam:AttachRolePolicy`, `iam:DetachRolePolicy`, `ec2:CreateSecurityGroup`, `ec2:DescribeSecurityGroups`, `ec2:DeleteSecurityGroup`, `ec2:AuthorizeSecurityGroupEgress`, `ec2:DescribeSubnets`, `logs:DeleteLogGroup`.
136
136
***Network Connectivity:** Lambda functions running within a VPC need a route to the internet or required AWS service endpoints. This typically requires a **NAT Gateway** in your VPC or **VPC Endpoints** for all necessary services (e.g., STS, CloudWatch Logs, ECR, S3, DynamoDB, and any target HTTPS hosts). Without proper outbound connectivity, the Lambda checks will fail.
137
137
138
-
***Running Lambda Mode:**
139
-
To start the diagnosis using Lambda mode:
138
+
***Running Lambda Runner:**
139
+
To start the diagnosis using the Lambda runner:
140
140
```bash
141
-
./gitpod-network-check diagnose --mode lambda
141
+
./gitpod-network-check diagnose --runner lambda
142
142
```
143
143
144
-
***Using Existing Resources (Lambda Mode):**
144
+
***Using Existing Resources (Lambda Runner):**
145
145
If you have pre-existing IAM roles or Security Groups you want the Lambda functions to use, you can specify them using flags. This will prevent the tool from creating or deleting these specific resources.
The output will be similar to EC2 mode but will show Lambda functioncreation/invocation instead of EC2 instance management.
152
+
***Example Output (Lambda Runner):**
153
+
The output will be similar to EC2 runner but will show Lambda functioncreation/invocation instead of EC2 instance management.
154
154
155
-
**Using Local Mode:**
155
+
**Using Local Runner:**
156
156
157
157
This mode runs the checks directly from the machine where you execute the CLI. It's useful for basic outbound connectivity tests but **does not** accurately reflect the network environment within your AWS subnets.
158
158
159
-
To start the diagnosis using local mode: `./gitpod-network-check diagnose --mode local`
159
+
To start the diagnosis using the local runner: `./gitpod-network-check diagnose --runner local`
160
160
161
161
3. Clean up after network diagnosis
162
162
163
-
The `diagnose` command is designed to clean up the AWS resources it creates (EC2 instances, Lambda functions, IAM roles, Security Groups, CloudWatch Log groups) before it finishes. However, if the process terminates unexpectedly, you can manually trigger cleanup using the `clean` command. This command respects the `--mode` flag to clean up resources specific to that mode.
163
+
The `diagnose` command is designed to clean up the AWS resources it creates (EC2 instances, Lambda functions, IAM roles, Security Groups, CloudWatch Log groups) before it finishes. However, if the process terminates unexpectedly, you can manually trigger cleanup using the `clean` command. This command respects the `--runner` flag to clean up resources specific to that runner.
164
164
165
165
```bash
166
-
# Clean up resources potentially left by EC2 mode
167
-
./gitpod-network-check clean --mode ec2
166
+
# Clean up resources potentially left by the EC2 runner
167
+
./gitpod-network-check clean --runner ec2
168
168
169
-
# Clean up resources potentially left by Lambda mode
170
-
./gitpod-network-check clean --mode lambda
169
+
# Clean up resources potentially left by the Lambda runner
170
+
./gitpod-network-check clean --runner lambda
171
171
```
172
172
173
173
**Note:** The `clean` command will *not* delete IAM roles or Security Groups if they were provided using the `--lambda-role-arn` or `--lambda-sg-id` flags during the `diagnose` run.
log.Infof("ℹ️ Running with region `%s`, main subnet `%v`, pod subnet `%v`, hosts `%v`, ami `%v`, and API endpoint `%v`", NetworkConfig.AwsRegion, NetworkConfig.MainSubnets, NetworkConfig.PodSubnets, NetworkConfig.HttpsHosts, NetworkConfig.InstanceAMI, NetworkConfig.ApiEndpoint)
NetworkCheckCmd.PersistentFlags().StringVar(&NetworkConfig.InstanceAMI, "instance-ami", "", "Custom ec2 instance AMI id, if not set will use latest ubuntu")
133
133
NetworkCheckCmd.PersistentFlags().StringVar(&NetworkConfig.ApiEndpoint, "api-endpoint", "", "The Gitpod Enterprise control plane's regional API endpoint subdomain")
134
134
NetworkCheckCmd.PersistentFlags().StringSliceVar(&Flags.SelectedTestsets, "testsets", []string{"aws-services-pod-subnet", "aws-services-main-subnet", "https-hosts-main-subnet"}, "List of testsets to run (options: aws-services-pod-subnet, aws-services-main-subnet, https-hosts-main-subnet)")
135
-
NetworkCheckCmd.PersistentFlags().StringVar(&Flags.ModeVar, "mode", string(runner.ModeEC2), fmt.Sprintf("How to run the tests (default: %s, options: %s, %s, %s)", runner.ModeEC2, runner.ModeEC2, runner.ModeLambda, runner.ModeLocal))
135
+
// Rename flag, variable, and update help text
136
+
NetworkCheckCmd.PersistentFlags().StringVar(&Flags.RunnerTypeStr, "runner", string(runner.RunnerTypeEC2), fmt.Sprintf("Specify the runner for executing tests (default: %s, options: %s, %s, %s)", runner.RunnerTypeEC2, runner.RunnerTypeEC2, runner.RunnerTypeLambda, runner.RunnerTypeLocal))
136
137
// Lambda-specific flags
137
138
NetworkCheckCmd.PersistentFlags().StringVar(&NetworkConfig.LambdaRoleArn, "lambda-role-arn", "", "ARN of an existing IAM role to use for Lambda execution (overrides automatic creation/deletion)")
138
139
NetworkCheckCmd.PersistentFlags().StringVar(&NetworkConfig.LambdaSecurityGroupID, "lambda-sg-id", "", "ID of an existing Security Group to use for Lambda execution (overrides automatic creation/deletion)")
0 commit comments