Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backup connection in backend #1478

Open
plachkov opened this issue Jan 14, 2020 · 0 comments
Open

backup connection in backend #1478

plachkov opened this issue Jan 14, 2020 · 0 comments

Comments

@plachkov
Copy link

 kind: "Service"
 apiVersion: "v1"
 metadata:
   name: "external-mysql-service"
   annotations:
     ingress.appscode.com/check: "true"
 spec:
   ports:
     -  name: "mysql"
       protocol: "TCP"
       port: 3306
       targetPort: 3306
       nodePort: 0
---
 kind: "Endpoints"
 apiVersion: "v1"
 metadata:
   name: "external-mysql-service"
 subsets:
   - addresses:
       - ip: "10.0.0.1"         
     ports:
       - port: 11336        
         name: "mysql1"
   - addresses:
       - ip: "10.100.12.7"
     ports:
       - port: 3306
         name: "mysql2"
Ingress:
apiVersion: voyager.appscode.com/v1beta1
kind: Ingress
metadata:
  name: mysql-ingress
  annotations:
    ingress.appscode.com/type: Internal
spec:
  frontendRules:
  - port: 3306
  rules:
  - host: tcp.bar.com
    tcp:
      port: '3306'
      backend:
        serviceName: external-mysql-service
        servicePort: '3306'

How do I add let's say 10.100.12.7 as a backup server.
https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#5.2-backup

This is a common use case, as the two sql servers are in different DCs. I would like to use the closest one and just in case of failure to failover to the second one(backup) connection. In the meanwhile I don't want to send any traffic to the backup connection as it will slow down my app. This is quite common scenario in kubernetes as normally connection to DBs are "external" in sense of kubernetes ecosystems and we need a way to failover.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant