The two instances will have a unique server ID and should not point to the same database. Please do not attempt this even by making them share the same identity since they will be writing to the database.
For higher availability, you'll need to think more about the agents connecting to the server on the second K8s cluster. Agents can continue with their job when a server is unavailable and can reconnect to the server once it is back online.
You can leverage this behaviour to achieve some form of HA by:
- keeping postgres external to the cluster
- stopping the GoCD server on the first cluster
- starting the GoCD server with the same configuration on the second cluster
- either setting up an LB in front of the first with a fail over to the second K8s cluster
OR setting up DNS round robin to refer to the second K8s
OR setting a really low TTL for the DNS name and making it point to the second cluster for a switch over.