Kubernetes pod unreachable

10/3/2018

I've got this bizarre issue where a pod in one of my environments isn't allowing requests through on the port specified

From another pod:

/app # wget 10.12.2.22:6000
Connecting to 10.12.2.22:6000 (10.12.2.22:6000)
wget: error getting response`

From the service:

/app # wget services:6000
Connecting to services:6000 (10.15.249.82:6000)
wget: error getting response: Resource temporarily unavailable

From inside itself:

/app # wget localhost:6000
converted 'http://localhost:6000' (ANSI_X3.4-1968) -> 'http://localhost:6000' (UTF-8)
--2018-10-03 01:26:39--  http://localhost:6000/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:6000... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-10-03 01:26:39 ERROR 404: Not Found.

Here's my YAML:

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: services
  namespace: production
  labels:
    name: services
spec:
  replicas: 1
  selector:
    matchLabels:
      app: services
      version: production
  template:
    metadata:
      name: services
      labels:
        app: services
        version: production
    spec:
      containers:
      - name: services
        image: gcr.io/myproject/services:v1.6.0
        imagePullPolicy: Always
        volumeMounts:
        - name: "gc-serviceaccount"
          readOnly: true
          mountPath: "/app/secrets"
        securityContext:
          privileged: true
        ports:
        - name: http
          containerPort: 3000
          protocol: TCP
        - name: sockets
          containerPort: 6000
          protocol: TCP
        env:
        - name: NODE_ENV
          value: "local"
        - name: PORTAL_HOST
          value: "portal.myproject.com"
        - name: PORTAL_HOSTNAME
          value: "http://portal"
        - name: DESIGNER_HOSTNAME
          value: "http://designer"
        - name: FILE_HOST
          value: "https://files.myproject.com"
        - name: STORAGE_BUCKET
          value: "production"
        - name: DATA_PATH
          value: ""
        - name: MONGO_DB_NAME
          value: "MyProject"
        - name: MONGO_REPLICA_SET
          value: "myproject"
        - name: PORT
          value: "3000"
        - name: REDIS_HOSTNAME
          value: "redis"
        - name: REDIS_PORT
          value: "6379"
        - name: SOCKETCLUSTER_WS_ENGINE
          value: "ws"
        - name: SOCKETCLUSTER_PORT
          value: "6000"
        - name: CLIENT_HOST
          value: "myproject.com"
        readinessProbe:
          httpGet:
            path: /healthz
            port: 3000
          periodSeconds: 1
          timeoutSeconds: 1
          successThreshold: 1
          failureThreshold: 10

      volumes:
      - name: "gc-serviceaccount"
        secret:
          secretName: "gc-serviceaccount"
---
apiVersion: v1
kind: Service
metadata:
  name: services
  namespace: production
spec:
  type: NodePort
  ports:
  - name: http
    port: 80
    targetPort: http
  - name: sockets
    port: 6000
    targetPort: sockets
  selector:
    app: services

It's worth noting that I have no issues when trying to connect to the pod from another pod on port 3000.

So far I created a new environment and deployed to that but I'm receiving the same error.

Strangely enough, my other, older environments work fine, so I'm wondering if it's a Kubernetes issue?

-- Ant
kubernetes

0 Answers