Closed makaraju closed 3 years ago
@makaraju thanks for signaling g this issue. I think the issue is pretty clear and I know how to fix it. What I can't figure out is why not every installation is failing like that. So let me ask you a few questions:
a tentative fix is here: https://github.com/raffaelespazzoli/global-load-balancer-operator/tree/fix%2326 would you be able to confirm that it is working by building the operator from that branch? Please follow the local development instructions: https://github.com/redhat-cop/global-load-balancer-operator#running-the-operator-locally
@raffaelespazzoli thanks for the quick response. Let me deploy and test again.
Hi @raffaelespazzoli
It passed that error, but it's unable to create the traffic policy. Getting the below error.
2021-03-02T15:41:31.440-0600 ERROR controllers.GlobalDNSRecord unable to create {"network policy": "{\n Document: \"{\\\"AWSPolicyFormatVersion\\\":\\\"2015-10-01\\\",\\\"RecordType\\\":\\\"A\\\",\\\"StartRule\\\":\\\"main\\\",\\\"Rules\\\":{\\\"main\\\":{\\\"RuleType\\\":\\\"multivalue\\\"}}}\",\n Name: \"global-load-balancer-operator/route53-multivalue-global-record\"\n}", "error": "InvalidTrafficPolicyDocument: At least one endpoint must be declared.;main: Multivalue rules must specify at least two items.\n\tstatus code: 400, request id: 8896b985-bc02-4cb2-a16a-1da6fcfb8ffb"}
github.com/go-logr/zapr.(*zapLogger).Error
/Users/hmakara/go/pkg/mod/github.com/go-logr/zapr@v0.2.0/zapr.go:132
github.com/redhat-cop/global-load-balancer-operator/controllers/globaldnsrecord.(*GlobalDNSRecordReconciler).createAWSTrafficPolicy
I have few questions.
Just to answer your above questions.
v1.0.0
No
AWS Route53
apiVersion: redhatcop.redhat.io/v1alpha1
kind: GlobalDNSRecord
metadata:
name: route53-multivalue-global-record
spec:
name: multivalue.<route53 domain name>
endpoints:
- clusterName: cluster-1
clusterCredentialRef:
name: glb-local
namespace: global-load-balancer-operator
loadBalancerServiceRef:
name: argo-server
namespace: argo
- clusterName: cluster-2
clusterCredentialRef:
name: glb-remote
namespace: global-load-balancer-operator
loadBalancerServiceRef:
name: argo-server
namespace: argo
ttl: 60
loadBalancingPolicy: Multivalue
globalZoneRef:
name: route53-global-dns-zone
@makaraju can you share the
name: argo-server
namespace: argo
service?
Do we need to create traffic policy or operator will take care automatically?
it will be created automatically
If it will create automatically then why the policy doesn't have any endpoints?
the operator thinks you don't have any endpoints, that's why I want to see the service.
@raffaelespazzoli
argo-server
is service name. This service is pointed to the routes.
can I see the yaml? what does it mean that the service is pointed to the routes? Can I also see those routes' yaml?
Service yaml:
apiVersion: v1
kind: Service
metadata:
name: argo-server
namespace: argo
spec:
ports:
- name: web
port: 2746
targetPort: 2746
selector:
app: argo-server
routes yaml:
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: argo-wf-ui
namespace: argo
spec:
host: >-
argo-wf-ui-argo.<cluster-name>.<route53 domain>
to:
kind: Service
name: argo-server
weight: 100
port:
targetPort: web
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
wildcardPolicy: None
so this is the problem: you need to set the field loadBalancerServiceRef
service field to a load balancer service not an internal cluster service. The operator will use that information to discover the externally exposed endpoint. So in this case you need to set there the loadbalancer service supporting the routers.
Alternatively and perhaps more easily you could configure a global route autodiscovery and simply annotate that route to be global.
Also the route is wrong as it needs to point to the global domain you created and instead it is pointing to the cluster local domain.
thanks for the information. Just have one question.
no, it does not make sense, an external global load balancer has no visibility of services exposed in the SDN only.
may I close this?
Hi @raffaelespazzoli ,
We are trying to use the Global Load Balancer operator in our environment. When we tried to create the Global DNS Record, the pod is getting crashing. Please help us to figure out the issue. We have troubleshoot the code and we found that is is failing in
getIPs
. Please check the below log.Kindly let me know, if you need any information.
Regards, Hari