首页 > 解决方案 > Kubernetes Bridge VSCODE 未连接到 AWS EKS 中的依赖项

问题描述

我正在尝试连接到我的服务并使用 EKS 集群中可用的所有 AWS 依赖项。我可以连接,但是,我似乎在连接到 Redis 缓存实例时遇到了问题。这是来自我在本地开发环境中的应用程序。

{"child":"Redis Card Client","message":"Redis 连接到 dev-ivr-redis.xxxxx.0001.xxxx.cache.amazonaws.com:6379 失败 - 连接 ETIMEDOUT 192.168.146.62:6379","级别”:“错误”,“时间戳”:“2021 年 10 月 13 日,下午 5:41:43”}

这是我的启动配置

{
            "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",
            
        },

这是我的任务配置

{
            "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"
        }

我是不是用错了网桥?我已经在谷歌上搜索了一个小时左右,似乎我是唯一一个遇到这个问题的人。

这是连接的输出

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.

标签: amazon-web-serviceskubernetesvisual-studio-coderedis

解决方案


推荐阅读