Try to search your question here, if you can't find : Ask Any Question Now ?

Find why i am getting 502 Bad gateway error on kubernetes

HomeCategory: stackoverflowFind why i am getting 502 Bad gateway error on kubernetes
Avatarcraig asked 4 months ago

I am using kubernetes. I have Ingress service which talks my container service. We have exposed a webapi which works all fine. But we keep getting 502 bad gateway error. I am new to kubernetes and i have no clue how to go about debugging this issue. Server is a nodejs server connected to database. Is there anything wrong with configuration?

My Deployment file–


apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: my-pod
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: my-pod
    spec:
      containers:
      - name: my-pod
        image: my-image
        ports:
        - name: "http"
          containerPort: 8086
        resources:
          limits:
            memory: 2048Mi
            cpu: 1020m
---
apiVersion: v1
kind: Service
metadata:
  name: my-pod-serv
spec:
  ports:
    - port: 80
      targetPort: "http"
  selector:
     app: my-pod

My Ingress Service:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: gateway
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: abc.test.com
    http:
      paths:
      - path: /abc
        backend:
          serviceName: my-pod-serv
          servicePort: 80
1 Answers
Best Answer
AvatarMatthias answered 4 months ago
Your Answer

12 + 6 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com