How to Kubernetes Angular.js service request backendapi service

1/25/2018

----------------------- Thats backandapi Service-----------------------

apiVersion: v1
kind: Service
metadata:
  name: backandapi-service
  namespace: crm
  labels:
    app: backandapi-service
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: backandapi

And, Angular.js request to this service but Service changing ip adress. How to access Services external endpoint from env or similar.

-- Onur Yartaşı
kubernetes

1 Answer

1/25/2018

Depending on what provides your loadbalancer you will see different ways of doing this. Said short kubectl describe <your_svc> would return something like LoadBalancer Ingress firld, that on aws will look similar to blablabla-123123.eu-west-1.elb.amazonaws.com which you can use to access regardless of underlying IP

-- Radek 'Goblin' Pieczonka
Source: StackOverflow