tactlabs / error-archive

All issues related to tact and tact labs work
0 stars 0 forks source link

port failed: Connection refused #297

Open Ananthu2oo3 opened 2 years ago

Ananthu2oo3 commented 2 years ago

❯ docker build -t db-postgres database Sending build context to Docker daemon 2.048kB Step 1/3 : FROM postgres ---> b37c2a6c1506 Step 2/3 : ENV POSTGRES_PASSWORD=root ---> Using cache ---> 4abd940f2364 Step 3/3 : EXPOSE 5432 ---> Using cache ---> 6245ac43b5ef Successfully built 6245ac43b5ef Successfully tagged db-postgres:latest ❯ kubectl apply -f post-configmap.yaml kubectl apply -f post-secret.yaml configmap/database2 configured secret/database created ❯ kubectl apply -f k8s/post-deployment.yaml kubectl apply -f k8s/post-service.yaml kubectl apply -f k8s/api-deployment.yaml kc apply -f k8s/api-service.yaml deployment.apps/post-deployment created service/post-service created deployment.apps/api-deployment created zsh: command not found: kc ❯ kubectl apply -f k8s/api-service.yaml service/api-service created ❯ kc logs podname zsh: command not found: kc ❯ kubectl logs podname Error from server (NotFound): pods "podname" not found ❯ kubectl get all NAME READY STATUS RESTARTS AGE pod/api-deployment-78b6bcf855-x422d 1/1 Running 0 49s pod/post-deployment-5c8b5668bb-65f4q 1/1 Running 0 52s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/api-service LoadBalancer 10.103.225.48 5000:31313/TCP 27s service/kubernetes ClusterIP 10.96.0.1 443/TCP 18h service/post-service LoadBalancer 10.99.42.120 5432:30783/TCP 51s

NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/api-deployment 1/1 1 1 49s deployment.apps/post-deployment 1/1 1 1 52s

NAME DESIRED CURRENT READY AGE replicaset.apps/api-deployment-78b6bcf855 1 1 1 49s replicaset.apps/post-deployment-5c8b5668bb 1 1 1 52s ❯ kubectl logs api-deployment-78b6bcf855-x422d environ({'PATH': '/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOSTNAME': 'api-deployment-78b6bcf855-x422d', 'DATABASE': 'postgres', 'PASSWORD': '��-', 'USERNAME': 'postgres', 'POST_SERVICE_PORT_5432_TCP': 'tcp://10.99.42.120:5432', 'POST_SERVICE_PORT_5432_TCP_ADDR': '10.99.42.120', 'KUBERNETES_SERVICE_PORT': '443', 'POST_SERVICE_SERVICE_PORT': '5432', 'KUBERNETES_SERVICE_HOST': '10.96.0.1', 'POST_SERVICE_PORT': 'tcp://10.99.42.120:5432', 'POST_SERVICE_PORT_5432_TCP_PORT': '5432', 'KUBERNETES_PORT': 'tcp://10.96.0.1:443', 'KUBERNETES_PORT_443_TCP_ADDR': '10.96.0.1', 'POST_SERVICE_SERVICE_HOST': '10.99.42.120', 'POST_SERVICE_PORT_5432_TCP_PROTO': 'tcp', 'KUBERNETES_SERVICE_PORT_HTTPS': '443', 'KUBERNETES_PORT_443_TCP': 'tcp://10.96.0.1:443', 'KUBERNETES_PORT_443_TCP_PROTO': 'tcp', 'KUBERNETES_PORT_443_TCP_PORT': '443', 'LANG': 'C.UTF-8', 'GPG_KEY': 'E3FF2839C048B25C084DEBE9B26995E310250568', 'PYTHON_VERSION': '3.8.14', 'PYTHON_PIP_VERSION': '22.0.4', 'PYTHON_SETUPTOOLS_VERSION': '57.5.0', 'PYTHON_GET_PIP_URL': 'https://github.com/pypa/get-pip/raw/5eaac1050023df1f5c98b173b248c260023f2278/public/get-pip.py', 'PYTHON_GET_PIP_SHA256': '5aefe6ade911d997af080b315ebcb7f882212d070465df544e1175ac2be519b4', 'HOME': '/root'}) Exception occurred while getting DB connection : connection to server at "post-service" (10.99.42.120), port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections?