Configure GCP firewall for Jenkins

To allow inbound TCP traffic on port 8080, create a firewall rule in the Google Cloud Console.

Note

For more information about GCP setup, see Getting started with Google Cloud Platform .

Create a firewall rule in GCP

To expose the TCP port 8080, create a firewall rule.

Navigate to the Google Cloud Console , go to VPC Network > Firewall, and select Create firewall rule.

Image Alt Text:Google Cloud Console VPC Network Firewall page showing existing firewall rules and Create Firewall Rule button alt-txtCreate a firewall rule

Next, create the firewall rule that exposes the TCP port 8080. Set the Name of the new rule to “allow-tcp-8080”. Select your network that you intend to bind to your VM (default is “autoscaling-net”, but your organization might have others).

Set Direction of traffic to “Ingress”. Set Allow on match to “Allow” and Targets to “Specified target tags”.

Image Alt Text:Google Cloud Console firewall rule creation form showing name field, network selection, direction set to Ingress, and targets set to Specified target tags alt-txtCreating the TCP/8080 firewall rule

Next, enter “allow-tcp-8080” in the Target tags text field. Set Source IPv4 ranges to “0.0.0.0/0”.

Image Alt Text:Google Cloud Console firewall rule form showing target tags field with allow-tcp-8080 entered and source IPv4 ranges set to 0.0.0.0/0 alt-txtCreating the TCP/8080 firewall rule

Finally, select Specified protocols and ports under the Protocols and ports section. Select the TCP checkbox, enter “8080” in the **Ports" text field, and select Create.

Image Alt Text:Google Cloud Console firewall rule form showing protocols and ports section with TCP selected and port 8080 specified alt-txtSpecifying the TCP port to expose

The network firewall rule is now created, and you can continue with the VM creation.

Back
Next