【问题标题】:Cloud Code for VisualStudio Code Errors on Cloud Code: DeployCloud Codedeploy 上 Visual Studio 代码错误的 Cloud Code
【发布时间】:2020-02-11 13:18:51
【问题描述】:

我一直在尝试使用 VSCode 设置 Cloud Code,但在使用 Cloud Code: Deploy 启动部署过程时遇到了问题。

我尝试将示例 python-hello-world-1 和 go-hello-world-1 部署到 GKE 上的 kubernetes 集群,但在部署过程开始下载包时总是会出错:

输出

Running: skaffold run --enable-rpc -v info --rpc-http-port 49869 --filename skaffold.yaml --default-repo gcr.io/abx-lernende
starting gRPC server on port 50051
starting gRPC HTTP server on port 49869
Using kubectl context: gke_abx-lernende_europe-west4-a_joshu-test-cluster
Generating tags...
 - go-hello-world -> gcr.io/abx-lernende/go-hello-world:latest
Checking cache...
 - go-hello-world: Not found. Building
Building [go-hello-world]...
Sending build context to Docker daemon  57.86kB
Step 1/8 : FROM golang:1.13
 ---> 6586e3d10e96
Step 2/8 : RUN go get -u -v github.com/go-delve/delve/cmd/dlv
 ---> Running in b75ce8e5dae9
[91mgithub.com/go-delve/delve (download)
[0m[91m# cd .; git clone -- https://github.com/go-delve/delve /go/src/github.com/go-delve/delve
Cloning into '/go/src/github.com/go-delve/delve'...
fatal: unable to access 'https://github.com/go-delve/delve/': Failed to connect to github.com port 443: Connection refused
package github.com/go-delve/delve/cmd/dlv: exit status 128
[0mfailed to build: build failed: building [go-hello-world]: build artifact: unable to stream build output: The command '/bin/sh -c go get -u -v github.com/go-delve/delve/cmd/dlv' returned a non-zero code: 1
Exited with code 1.

Python 输出

Running: skaffold run --enable-rpc -v info --rpc-http-port 50185 --filename 
skaffold.yaml --default-repo gcr.io/abx-lernende
starting gRPC server on port 50051
starting gRPC HTTP server on port 50185
Skaffold &{Version:v1.3.1 ConfigVersion:skaffold/v2alpha3 GitVersion: GitCommit:6ba887a42438d1da578a005cf550e618fee6dfb8 GitTreeState:clean BuildDate:2020-01-31T19:55:18Z GoVersion:go1.13.4 Compiler:gc Platform:windows/amd64}
Using kubectl context: gke_abx-lernende_europe-west4-a_joshu-test-cluster
Generating tags...
 - python-hello-world -> Tags generated in 0s
gcr.io/abx-lernende/python-hello-world:latest
Checking cache...
 - python-hello-world: Cache check complete in 6.0001ms
Not found. Building
Building [python-hello-world]...
Sending build context to Docker daemon  4.608kB
Step 1/7 : FROM python:3.8
 ---> efdecc2e377a
Step 2/7 : WORKDIR /app
 ---> Using cache
 ---> a131b81cad66
Step 3/7 : COPY requirements.txt .
 ---> Using cache
 ---> 4625ef1862bd
Step 4/7 : RUN pip install --trusted-host pypi.python.org -r requirements.txt
 ---> Running in 4da23a158ae3
[91mWARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f17ba9c9d60>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/flask/

我假设这是因为我使用了公司代理。作为对策,我已明确配置 VSCode、Git、pip、go 和 google cloud sdk 都使用上述代理。最重要的是,我为代理设置了 Windows ENV 变量。可惜没有成功。

谢谢!

【问题讨论】:

  • 如果您将错误发布为文本而不是包含屏幕截图会很有帮助。

标签: kubernetes visual-studio-code proxy google-cloud-code


【解决方案1】:

您可以通过在您的~/.docker/config.json 中添加类似以下内容,将代理信息传递到容器中,方法是通过configure docker:

{
  "proxies": {
    "default": {
      "httpProxy": "http://192.168.1.12:3128",
      "httpsProxy": "http://192.168.1.12:3128"
    }
  }
}

Docker 将在容器内设置HTTP_PROXY/HTTPS_PROXY 环境变量,许多工具都可以使用它。

【讨论】:

    猜你喜欢
    • 2020-09-01
    • 1970-01-01
    • 2021-12-06
    • 1970-01-01
    • 2016-05-13
    • 2017-09-06
    • 1970-01-01
    • 2016-01-10
    • 2021-10-19
    相关资源
    最近更新 更多