For this method, first, we have to create an Instance Group because the load-balancer cannot directly map to VM instance, but can take to VM Instance Groups.
For Creating VM Instance Group : go to Compute Engine –> Instance Groups
- Create an instance Group
- Select an Instance type option from the left side. In normal case we select, Unmanaged Instance Group.
- Give a name for instance group
- Add description (optional)
- Select Location region. (Selected the region which is already chosen for VM instance)
- Add VM instances (Choose from dropdown)
- Create (Done)
For SSL Setup through Load-Balancing : go to Network Services –> Load Balancing
- Create Load Balancer.
- Select Load balancer for Configuration.
- Normally we choose HTTP(s) Load Balancing –> Start Configuration
- Internet facing or internal only
- From Internet to my VMs –> Continue
- Add Name for new load balancer
- Backend Configuration:
- Create a Backend Service
- Add a name for Backend Service
- Description (Optional)
- Backend Type : Instance Group
- Protocol : HTTP
- Named Port : http
- New Backend :
- Select Instance Group
- Add Port Number (3000)
- Balancing Mode : Utilization
- Done
- Cloud CDN
- Allow Cloud CDN
- Cache static Content
- Health Check :
- Add name for Health Check
- Add Description Optional
- Protocol : HTTP
- Port : 80
- Proxy Protocol : None (Normally)
- Health Criteria :
- Check Interval : 30 sec
- Save
- Create
- Choose created Backend Service –> OK
- Host and Path Rules:
- Mode : Simple host and path rule
- Hosts : Default
- Paths : Default
- Backend : (Created in Backend Service)
- Frontend Configuration:
- Add Frontend IP and Port name
- Protocol : HTTPS
- Network Service Tier : Premium
- IP version : IPV4
- IP Address : Create IP Address –> Add IP Address name –> Reserve (for static IP)
- Certificate : Select a Certificate –> Create a Certificate
- Add new certificate name
- Create mode
- Upload my certificate (Manually uploading our own purcashed certificate)
- Create google managed certificate (SSL from Google)
- If option 1, Add corresponding certificate. If its option 2, Add Domain Name –> Create
- Done
- Go to Cloud DNS –> Modify IP address which is created in Load Balancer (without Port number).
Ensure your Website works properly.