How can i walk through my API-Gateway? (AKS)

6/10/2020

I have an Azure Kubernetes service with currently 3 microservices on it. 1 API gateway and 2 backend microservices. I can address my Api gateway and everything works there. But when I try to address my other microservices via my Api gateway, it still doesn't work.

This is my Yaml file

apiVersion: apps/v1
kind: Deployment
metadata:
  name: apigateway-front
spec:
  replicas: 1
  selector:
    matchLabels:
      app: apigateway-front
  template:
    metadata:
      labels:
        app: apigateway-front
    spec:
      nodeSelector:
        "beta.kubernetes.io/os": linux
      containers:
        - name: apigateway-front
          image: containerregistry.azurecr.io/apigateway:11
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 250m
              memory: 512Mi
          ports:
          - containerPort: 8800
            name: apigateway
            
---
apiVersion: v1
kind: Service
metadata:
  name: apigateway-front
spec:
  type: LoadBalancer
  ports:
  - port: 8800
  selector:
    app: apigateway-front
    
    
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: contacts-back
spec:
  replicas: 1
  selector:
    matchLabels:
      app: contacts-back
  template:
    metadata:
      labels:
        app: contacts-back
    spec:
      nodeSelector:
        "beta.kubernetes.io/os": linux
      containers:
      - name: contacts-back
        image: containerregistry.azurecr.io/contacts:12
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 250m
            memory: 512Mi
        ports:
        - containerPort: 8100
          name: contacts-back
          
---
apiVersion: v1
kind: Service
metadata:
  name: contacts-back
spec:
  ports:
  - port: 8100
  selector:
    app: contacts-back
---


apiVersion: apps/v1
kind: Deployment
metadata:
  name: templates-back
spec:
  replicas: 1
  selector:
    matchLabels:
      app: templates-back
  template:
    metadata:
      labels:
        app: templates-back
    spec:
      nodeSelector:
        "beta.kubernetes.io/os": linux
      containers:
      - name: templates-back
        image: containerregistry.azurecr.io/templates:13
        resources:
         requests:
            cpu: 100m
            memory: 128Mi
         limits:
            cpu: 250m
            memory: 512Mi
        ports:
         - containerPort: 8200
           name: templates-back
---
apiVersion: v1
kind: Service
metadata:
  name: templates-back
spec:
  ports:
  - port: 8200
  selector:
    app: templates-back

Do I need an additional Naming Service (Eureka) to access my backend microservices? Or can I do it without.

-- Doncarlito87
azure
kubernetes
microservices

0 Answers