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