登录
首页 >  Golang >  Go问答

如何在kubernetes中执行master go script

来源:stackoverflow

时间:2024-04-29 11:42:37 411浏览 收藏

怎么入门Golang编程?需要学习哪些知识点?这是新手们刚接触编程时常见的问题;下面golang学习网就来给大家整理分享一些知识点,希望能够给初学者一些帮助。本篇文章就来介绍《如何在kubernetes中执行master go script》,涉及到,有需要的可以收藏一下

问题内容

我们在以下 url 中找到了测试列表。谁能告诉我执行端到端 kubernetes 测试的测试列表的主要 go 脚本。 https://github.com/kubernetes/kubernetes/tree/master/test/e2e

我们已经在 ubuntu 中安装了 kubernetes,并尝试获取执行所有 e2e 测试的主脚本。

我在安装 kubetest 时遇到问题。请帮我解决这个问题。完整信息如下。

chan@coe-optiplex-3060:~$ sudo go get -v -u k8s.io/test-infra/kubetest
fetching https://k8s.io/test-infra/kubetest?go-get=1
parsing meta tags from https://k8s.io/test-infra/kubetest?go-get=1 (status code 200)
get "k8s.io/test-infra/kubetest": found meta tag get.metaimport{prefix:"k8s.io/test-infra", vcs:"git", reporoot:"https://github.com/kubernetes/test-infra"} at https://k8s.io/test-infra/kubetest?go-get=1
get "k8s.io/test-infra/kubetest": verifying non-authoritative meta tag
fetching https://k8s.io/test-infra?go-get=1
parsing meta tags from https://k8s.io/test-infra?go-get=1 (status code 200)
k8s.io/test-infra (download)
github.com/azure/azure-sdk-for-go (download)
github.com/azure/go-autorest (download)
github.com/dgrijalva/jwt-go (download)
github.com/azure/azure-storage-blob-go (download)
github.com/azure/azure-pipeline-go (download)
github.com/mattn/go-ieproxy (download)
github.com/aws/aws-k8s-tester (download)
package github.com/aws/aws-k8s-tester/ekstester: cannot find package "github.com/aws/aws-k8s-tester/ekstester" in any of:
    /usr/lib/go-1.10/src/github.com/aws/aws-k8s-tester/ekstester (from $goroot)
    /home/coe/go/src/github.com/aws/aws-k8s-tester/ekstester (from $gopath)
github.com/aws/aws-sdk-go (download)
github.com/docker/docker (download)
github.com/pelletier/go-toml (download)
github.com/satori/go.uuid (download)
github.com/spf13/pflag (download)
fetching https://golang.org/x/crypto/ssh?go-get=1
parsing meta tags from https://golang.org/x/crypto/ssh?go-get=1 (status code 200)
get "golang.org/x/crypto/ssh": found meta tag get.metaimport{prefix:"golang.org/x/crypto", vcs:"git", reporoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ssh?go-get=1
get "golang.org/x/crypto/ssh": verifying non-authoritative meta tag
fetching https://golang.org/x/crypto?go-get=1
parsing meta tags from https://golang.org/x/crypto?go-get=1 (status code 200)
golang.org/x/crypto (download)
fetching https://golang.org/x/crypto/chacha20?go-get=1
parsing meta tags from https://golang.org/x/crypto/chacha20?go-get=1 (status code 200)
get "golang.org/x/crypto/chacha20": found meta tag get.metaimport{prefix:"golang.org/x/crypto", vcs:"git", reporoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/chacha20?go-get=1
get "golang.org/x/crypto/chacha20": verifying non-authoritative meta tag
fetching https://golang.org/x/crypto/internal/subtle?go-get=1
parsing meta tags from https://golang.org/x/crypto/internal/subtle?go-get=1 (status code 200)
get "golang.org/x/crypto/internal/subtle": found meta tag get.metaimport{prefix:"golang.org/x/crypto", vcs:"git", reporoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/internal/subtle?go-get=1
get "golang.org/x/crypto/internal/subtle": verifying non-authoritative meta tag
fetching https://golang.org/x/crypto/curve25519?go-get=1
parsing meta tags from https://golang.org/x/crypto/curve25519?go-get=1 (status code 200)
get "golang.org/x/crypto/curve25519": found meta tag get.metaimport{prefix:"golang.org/x/crypto", vcs:"git", reporoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/curve25519?go-get=1
get "golang.org/x/crypto/curve25519": verifying non-authoritative meta tag
fetching https://golang.org/x/crypto/ed25519?go-get=1
parsing meta tags from https://golang.org/x/crypto/ed25519?go-get=1 (status code 200)
get "golang.org/x/crypto/ed25519": found meta tag get.metaimport{prefix:"golang.org/x/crypto", vcs:"git", reporoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ed25519?go-get=1
get "golang.org/x/crypto/ed25519": verifying non-authoritative meta tag
fetching https://golang.org/x/crypto/ed25519/internal/edwards25519?go-get=1
parsing meta tags from https://golang.org/x/crypto/ed25519/internal/edwards25519?go-get=1 (status code 200)
get "golang.org/x/crypto/ed25519/internal/edwards25519": found meta tag get.metaimport{prefix:"golang.org/x/crypto", vcs:"git", reporoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ed25519/internal/edwards25519?go-get=1
get "golang.org/x/crypto/ed25519/internal/edwards25519": verifying non-authoritative meta tag
fetching https://golang.org/x/crypto/poly1305?go-get=1
parsing meta tags from https://golang.org/x/crypto/poly1305?go-get=1 (status code 200)
get "golang.org/x/crypto/poly1305": found meta tag get.metaimport{prefix:"golang.org/x/crypto", vcs:"git", reporoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/poly1305?go-get=1
get "golang.org/x/crypto/poly1305": verifying non-authoritative meta tag
fetching https://k8s.io/client-go/kubernetes?go-get=1
parsing meta tags from https://k8s.io/client-go/kubernetes?go-get=1 (status code 200)
get "k8s.io/client-go/kubernetes": found meta tag get.metaimport{prefix:"k8s.io/client-go", vcs:"git", reporoot:"https://github.com/kubernetes/client-go"} at https://k8s.io/client-go/kubernetes?go-get=1
get "k8s.io/client-go/kubernetes": verifying non-authoritative meta tag
fetching https://k8s.io/client-go?go-get=1
parsing meta tags from https://k8s.io/client-go?go-get=1 (status code 200)
k8s.io/client-go (download)
fetching https://k8s.io/client-go/discovery?go-get=1
parsing meta tags from https://k8s.io/client-go/discovery?go-get=1 (status code 200)
get "k8s.io/client-go/discovery": found meta tag get.metaimport{prefix:"k8s.io/client-go", vcs:"git", reporoot:"https://github.com/kubernetes/client-go"} at https://k8s.io/client-go/discovery?go-get=1
get "k8s.io/client-go/discovery": verifying non-authoritative meta tag
github.com/golang/protobuf (download)
github.com/googleapis/gnostic (download)
fetching https://gopkg.in/yaml.v2?go-get=1
parsing meta tags from https://gopkg.in/yaml.v2?go-get=1 (status code 200)
get "gopkg.in/yaml.v2": found meta tag get.metaimport{prefix:"gopkg.in/yaml.v2", vcs:"git", reporoot:"https://gopkg.in/yaml.v2"} at https://gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)
fetching https://k8s.io/apimachinery/pkg/api/errors?go-get=1
parsing meta tags from https://k8s.io/apimachinery/pkg/api/errors?go-get=1 (status code 200)
get "k8s.io/apimachinery/pkg/api/errors": found meta tag get.metaimport{prefix:"k8s.io/apimachinery", vcs:"git", reporoot:"https://github.com/kubernetes/apimachinery"} at https://k8s.io/apimachinery/pkg/api/errors?go-get=1
get "k8s.io/apimachinery/pkg/api/errors": verifying non-authoritative meta tag
fetching https://k8s.io/apimachinery?go-get=1
parsing meta tags from https://k8s.io/apimachinery?go-get=1 (status code 200)
k8s.io/apimachinery (download)
fetching https://k8s.io/apimachinery/pkg/apis/meta/v1?go-get=1
parsing meta tags from https://k8s.io/apimachinery/pkg/apis/meta/v1?go-get=1 (status code 200)
get "k8s.io/apimachinery/pkg/apis/meta/v1": found meta tag get.metaimport{prefix:"k8s.io/apimachinery", vcs:"git", reporoot:"https://github.com/kubernetes/apimachinery"} at https://k8s.io/apimachinery/pkg/apis/meta/v1?go-get=1

.. .. 解析来自 https://k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1?go-get=1 的元标记(状态代码 200) .. ..

Fetching https://k8s.io/test-infra/kubetest/process?go-get=1
Parsing meta tags from https://k8s.io/test-infra/kubetest/process?go-get=1 (status code 200)
get "k8s.io/test-infra/kubetest/process": found meta tag get.metaImport{Prefix:"k8s.io/test-infra", VCS:"git", RepoRoot:"https://github.com/kubernetes/test-infra"} at https://k8s.io/test-infra/kubetest/process?go-get=1
get "k8s.io/test-infra/kubetest/process": verifying non-authoritative meta tag
Fetching https://k8s.io/test-infra/kubetest/util?go-get=1
Parsing meta tags from https://k8s.io/test-infra/kubetest/util?go-get=1 (status code 200)
get "k8s.io/test-infra/kubetest/util": found meta tag get.metaImport{Prefix:"k8s.io/test-infra", VCS:"git", RepoRoot:"https://github.com/kubernetes/test-infra"} at https://k8s.io/test-infra/kubetest/util?go-get=1
get "k8s.io/test-infra/kubetest/util": verifying non-authoritative meta tag
Fetching https://k8s.io/test-infra/kubetest/kind?go-get=1
Parsing meta tags from https://k8s.io/test-infra/kubetest/kind?go-get=1 (status code 200)
get "k8s.io/test-infra/kubetest/kind": found meta tag get.metaImport{Prefix:"k8s.io/test-infra", VCS:"git", RepoRoot:"https://github.com/kubernetes/test-infra"} at https://k8s.io/test-infra/kubetest/kind?go-get=1
get "k8s.io/test-infra/kubetest/kind": verifying non-authoritative meta tag
Fetching https://k8s.io/test-infra/kubetest/kubeadmdind?go-get=1
Parsing meta tags from https://k8s.io/test-infra/kubetest/kubeadmdind?go-get=1 (status code 200)
get "k8s.io/test-infra/kubetest/kubeadmdind": found meta tag get.metaImport{Prefix:"k8s.io/test-infra", VCS:"git", RepoRoot:"https://github.com/kubernetes/test-infra"} at https://k8s.io/test-infra/kubetest/kubeadmdind?go-get=1
get "k8s.io/test-infra/kubetest/kubeadmdind": verifying non-authoritative meta tag

chan@coe-optiplex-3060:~$ kubetest --extract=v1.13.0 kubetest:找不到命令


解决方案


请按照以下步骤操作:

安装go

wget https://dl.google.com/go/go1.12.1.linux-amd64.tar.gz

sudo tar -c /usr/local -xzf go1.12.1.linux-amd64.tar.gz
export gopath="/home/vagrant/go"
export path=$path:/usr/local/go/bin:$gopath/bin

安装 kubetest

go get -v -u k8s.io/test-infra/kubetest

提取版本

kubetest --extract=v1.13.0

cd kubernetes

针对本地集群进行测试

export KUBECONFIG=/path/to/kubeconfig
export KUBE_MASTER_IP="http://127.0.0.1:<PORT>"
export KUBE_MASTER_IP="127.0.0.1:<PORT>"
export KUBE_MASTER=local



kubetest --test --provider=skeleton --test_args="--ginkgo.focus=\[Conformance\]" | tee test.out

好了,本文到此结束,带大家了解了《如何在kubernetes中执行master go script》,希望本文对你有所帮助!关注golang学习网公众号,给大家分享更多Golang知识!

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>