How to detect traffic change and trigger GitLab pipeline?

cn flag

We have two etcd clusters running in Kubernetes one act as primary(A) and the second one act as backup(B). We also have etcdctl make-mirror in place between these two clusters, now the problem is if we switch traffic from cluster A to B then cluster B becomes primary, and cluster A becomes the backup cluster. There is an F5 load balancer in front of these two clusters.

I'm looking for a mechanism/trigger that will detect this traffic change and trigger the pipeline which then spins up the replication pod on cluster B and take down the replication pod on the cluster A side.

I'm also open to suggestions about this workflow is there any better way we can achieve two-way replication for etcd? am I missing something?

br flag
Please specify the version of Kubernetes that you use, and if it is bare metal installation or on cloud provider. Additionally, could you please also provide details on how exactly you set up these clusters?
Wytrzymały Wiktor avatar
it flag
Hello @Sam. Any updates?
mx flag

Ultimately it will be dependent on your specific choice of CI/CD pipeline and what is responsible for initiating the traffic flip but I did find a demo of F5 using Github actions to trigger config changes when it saw alerting/threshold events from ELK/Splunk stacks.

In your case, if the traffic change was automated, your analytic stack could trigger the alert to a process that calls a Github Action via webook, thus initiating any number of methods, this includes updates to F5 BIG-IP ADC. OR you can have the k8 cluster changes go to BIG-IP via their kubernetes integration.

If you're initiating the traffic failovers from kubernetes or some manual method, then it's a bit easier and you can skip the analytic alerting trigger creation.

Here's the F5 ADC Telemetry-based autoscaling repo that as the setup to do all this.

You might not be autoscaling BIG-IP but the triggers and event driven changes are what you're looking for.


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.