I'm using the example shown in the official Google Cloud Routes Documentation page (See this page under "Priority"), as it closely relates to what I'm trying to achieve.
Lets say I have two routes defined as shown below:
NAME NETWORK DEST_RANGE NEXT_HOP PRIORITY vpnroute default 192.168.0.0/16 [ZONE]/instances/vpninstance 1000 vpnroute-backup default 192.168.0.0/16 [ZONE]/instances/vpninstance-backup 2000
In the official docs it states:
Under this configuration, VPN traffic would normally be handled by vpninstance, but would fall back to vpninstance-backup if vpnroute is deleted.
I would like this failover to be automatic. How do I achieve that?
Or in other words : I would like to have Highly Available instances that I'd can use as a nextHop in a routing rule and I'm fine with an Active/Passive model. Whats the easiest way I can achieve this? I like the above solution but it turns out I'd have to manually delete a route when I detect that my primary route's NEXT_HOP is down
My assumption was I could have two routes with differing priorities and the routes would be attempted in the order of priorities if a higher priority route did not work, but I think I might be wrong about that.