blueperf / acmeair-mainservice-java

This service contains the front end of AcmeAir Microservices.
Apache License 2.0
26 stars 88 forks source link

Fails to "Configure the Acme Air environment" #22

Closed spitfire88 closed 4 years ago

spitfire88 commented 5 years ago

I get pop up errors for each of these endpoints.

Error: Unable to load http://EXTERNAL-IP:9080/flight/config/countFlights status:404 Error: Unable to load http://EXTERNAL-IP:9080/booking/config/runtime status:404 Error: Unable to load http://EXTERNAL-IP:9080/booking/config/activeDataService status:404 Error: Unable to load http://EXTERNAL-IP:9080/customer/config/runtime status:404 Error: Unable to load http://EXTERNAL-IP:9080/customer/config/activeDataService status:404 Error: Unable to load http://EXTERNAL-IP:9080/flight/config/runtime status:404 Error: Unable to load http://EXTERNAL-IP:9080/flight/config/activeDataService status:404 Error: Unable to load http://EXTERNAL-IP:9080/flight/config/countFlights status:404 Error: Unable to load http://EXTERNAL-IP:9080/flight/config/countFlightSegments status:404 Error: Unable to load http://EXTERNAL-IP:9080/booking/config/countBookings status:404 Error: Unable to load http://EXTERNAL-IP:9080/flight/config/countAirports status:404 Error: Unable to load http://EXTERNAL-IP:9080/auth/config/runtime status:404

Every service has its own endpoint that is different from the EXTERNAL-IP and reachable from within the cluster. How do I make sure the requests are routed to the corresponding service endpoint?

kubectl get po --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE default acmeair-authservice-6c96b57b74-5qc6t 1/1 Running 0 3d21h default acmeair-booking-db-77df5b846-bnqjh 1/1 Running 0 3d21h default acmeair-bookingservice-6c9676dc94-4kg6r 1/1 Running 0 3d21h default acmeair-customer-db-796c59c898-z5llj 1/1 Running 0 3d21h default acmeair-customerservice-865d888db9-x6sfg 1/1 Running 0 3d21h default acmeair-flight-db-c9f89c6fd-pws6s 1/1 Running 0 3d20h default acmeair-flightservice-57c49fd54-589jb 1/1 Running 0 3d20h default acmeair-mainservice-56dff844b6-8dxxf 1/1 Running 0 3d21h kube-system heapster-v1.6.1-6558f8f94f-xspnw 3/3 Running 0 4d23h kube-system kube-dns-564d97dc9c-nbbxc 4/4 Running 0 4d23h kube-system kube-dns-564d97dc9c-vnkdh 4/4 Running 0 4d23h kube-system kube-dns-autoscaler-76fcd5f658-pql86 1/1 Running 0 4d23h kube-system kube-proxy-gke-standard-cluster-san-default-pool-09dcb82d-b5mf 1/1 Running 0 4d23h kube-system kube-proxy-gke-standard-cluster-san-default-pool-09dcb82d-fnqt 1/1 Running 0 4d23h kube-system kube-proxy-gke-standard-cluster-san-default-pool-09dcb82d-nqw9 1/1 Running 0 4d23h kube-system l7-default-backend-6f8697844f-2lljq 1/1 Running 0 4d23h kube-system metrics-server-v0.3.1-5b4d6d8d98-79jrs 2/2 Running 0 4d23h

kubectl get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE acmeair-auth-service ClusterIP 10.0.31.44 9080/TCP 3d21h acmeair-booking-db ClusterIP 10.0.17.66 27017/TCP 3d21h acmeair-booking-service ClusterIP 10.0.24.40 9080/TCP 3d21h acmeair-customer-db ClusterIP 10.0.24.95 27017/TCP 3d21h acmeair-customer-service ClusterIP 10.0.18.169 9080/TCP 3d21h acmeair-external LoadBalancer 10.0.21.51 EXTERNAL-IP 9080:30345/TCP,9443:31852/TCP 23h acmeair-flight-db ClusterIP 10.0.29.129 27017/TCP 3d20h acmeair-flight-service ClusterIP 10.0.23.118 9080/TCP 3d20h acmeair-main-service ClusterIP 10.0.30.89 9080/TCP 3d21h kubernetes ClusterIP 10.0.16.1 443/TCP 4d23h

kubectl get ep NAME ENDPOINTS AGE acmeair-auth-service 10.60.0.11:9080 3d21h acmeair-booking-service 10.60.0.12:9080 3d21h acmeair-customer-service 10.60.1.8:9080 3d21h acmeair-flight-service 10.60.1.9:9080 3d20h acmeair-main-service 10.60.0.10:9080 3d21h

jnativio commented 5 years ago

You have to use an ingress (https://kubernetes.io/docs/concepts/services-networking/ingress/)

spitfire88 commented 5 years ago

I tried the following for each of the services: kubectl apply acmeair-mainservice/manifests-no-mc/deploy-acmeair-mainservice-java.yaml kubectl apply acmeair-mainservice/manifests-no-mc/acmeair-mainservice-ingress.yaml

kubectl get ingress will not give me an external IP. I see this error when I describe the ingress.

error while evaluating the ingress spec: service "default/acmeair-main-service" is type "ClusterIP", expected "NodePort" or "LoadBalancer"

I am running these intructions in GCP. I will change it to NodePort and try again.

jdmcclur commented 5 years ago

I don't have experience with GCP, but for this app you do want a proxy out in front (nginx, haproxy, istio,etc). Did you ever get it working? I don't think you want to use nodeport. For istio, haproxy, you may need to change the context-root (see the istio Dockerfile).