Kubernetes Bridge VSCODE not connecting to dependencies with in AWS EKS

10/13/2021

I am trying to connect to my service and use all the AWS dependencies available within the EKS cluster. I am able to connect, however, I seem to be having issues connecting to the Redis cache instance. This is from my application in my local dev environment.

{"child":"Redis Card Client","message":"Redis connection to dev-ivr-redis.xxxxx.0001.xxxx.cache.amazonaws.com:6379 failed - connect ETIMEDOUT 192.168.146.62:6379","level":"error","timestamp":"10/13/2021, 5:41:43 PM"}

this is my launch config

{
            "type": "node",
            "request": "launch",
            "restart": true,
            "runtimeExecutable": "nodemon",
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen",
            "name": "Card Writer with Kubernetes",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "preLaunchTask": "bridge-to-kubernetes.compound",
            "program": "${workspaceFolder}/ivr-card-data-writer-svc/src/app.ts",
            "outFiles": [
                "${workspaceFolder}/dist/**/*.js"
            ],
            "envFile": "${workspaceFolder}/ivr-card-data-writer-svc/src/.env",
            
        },

and this is my task config

{
			"label": "bridge-to-kubernetes.resource",
			"type": "bridge-to-kubernetes.resource",
			"resource": "card-data-write-service",
			"resourceType": "service",
			"ports": [
				3004
			],
			"targetCluster": "arn:aws:eks:us-region-#:xxxxxx:cluster/dev-eks",
			"targetNamespace": "default",
			"useKubernetesServiceEnvironmentVariables": false,
			"isolateAs": "mylaptop-59af"
		},
		{
			"label": "bridge-to-kubernetes.compound",
			"dependsOn": [
				"bridge-to-kubernetes.resource",
				"npm: build - ivr-card-data-writer-svc"
			],
			"dependsOrder": "sequence"
		}

Am I using the bridge wrong? I have been googling for an hour or so and it seems that I am the only one having this issue.

This is the output from the connection

Redirecting Kubernetes service card-data-write-service to your machine...
Target cluster: arn:aws:eks:us-region-1:xxxxxx:cluster/dev-eks
Current cluster: arn:aws:eks:us-region-1:xxxxxx:cluster/dev-eks
Target namespace: default
Current namespace: default
Target service name: card-data-write-service
Target service ports: 3004
Isolating service with routing header: mylaptop-59af
Using kubernetes service environment variables: false

Retrieving the current context and credentials...
Validating the credentials to access the cluster...
Validating the requirements to replicate resources locally...
Redirecting traffic from the cluster to your machine...
Waiting for EndpointManager to come up ...
EndpointManager came up successfully.
Routing successfully enabled for service through pod 'mylaptop-card-data-write-deployment-5f9896fc5c-ddzm9' in namespace 'default'.
Waiting for 'mylaptop-card-data-write-deployment-5f9896fc5c-ddzm9' in namespace 'default' to reach running state...
Pod 'mylaptop-card-data-write-deployment-5f9896fc5c-ddzm9' created in namespace 'default'.
Remote agent deployed in container 'card-data-write' in pod 'mylaptop-card-data-write-deployment-5f9896fc5c-ddzm9'.
Preparing to run Bridge To Kubernetes configured as pod default/mylaptop-card-data-write-deployment-5f9896fc5c-ddzm9 ...
Connection established.
Hosts file updated.
Service 'welcome-service' is available on 127.1.1.1:80.
Service 'kubernetes' is available on 127.1.1.2:443.
Service 'ivr-nlb' is available on 127.1.1.3:8443.
Service 'card-data-read-service' is available on 127.1.1.4:80.
Service 'card-data-write-service' is available on 127.1.1.5:80.
Service 'wagering-service' is available on 127.1.1.6:80.
Service 'admin-api-service' is available on 127.1.1.7:80.
Service 'wager-build-service' is available on 127.1.1.8:80.
Container port 3000 is available at localhost:3004.
##################### Environment started. #############################################################
Run C:\Users\mylaptop\AppData\Local\Temp\tmp-84166n5qVk4vsd3b.env.cmd in your existing console to also get connected.

Terminal will be reused by tasks, press any key to close it.

> Executing task in folder thetask: npm run build <


> ivr-card-data-writer-svc@1.0.0 build C:\Users\mylaptop\Documents\Sportech\Repositories\app\ivr-card-data-writer-svc
> tsc -b .


> ivr-card-data-writer-svc@1.0.0 postbuild C:\Users\mylaptop\Documents\Sportech\Repositories\app\ivr-card-data-writer-svc
> cp -R node_modules ../dist/node_modules


Terminal will be reused by tasks, press any key to close it.
-- Apextek
amazon-web-services
kubernetes
redis
visual-studio-code

0 Answers