dial tcp IP:80: connect: operation timed out

4/27/2021

I've been using Google Cloud Platform to deploy my Magento application with Google Kubernetes Engine. It used to work but now I got that error. Here's the architecture:

enter image description here

and this are the services:

enter image description here

dial tcp IP:80: connect: operation timed out

I'm trying to expose my nginx pod using load balancer.

My nginx pod configuration file:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
    tier: backend

spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
      tier: backend

  template:
    metadata:
      labels:
        app: nginx
        tier: backend

    spec:
      volumes:
      - name: dir
        persistentVolumeClaim:
          claimName: dir
      - name: config
        configMap:
          name: nginx-config
          items:
          - key: config
            path: site.conf
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
        volumeMounts:
        - name: dir
          mountPath: /var/www/
        - name: config
          mountPath: /etc/nginx/conf.d

and to expose it I run this command :

kubectl expose deployment nginx --port=80 --type=LoadBalancer

Is there anyone familiar with this error ?

-- nessHaf
google-cloud-platform
google-kubernetes-engine
kubernetes
load-balancing

0 Answers