如何在kubernetes中执行主go scritpt

如何在kubernetes中执行主go scritpt,go,kubernetes,Go,Kubernetes,我们在下面的URL中找到了测试列表。任何人都可以让我知道执行端到端kubernetes测试列表的主要go脚本。 我们已经在Ubuntu中安装了kubernetes,并试图获得执行所有e2e测试的主脚本 我在安装kubetest时遇到问题。请帮我解决这个问题。完整信息如下所示 chan@coe-OptiPlex-3060:~$ sudo go get -v -u k8s.io/test-infra/kubetest Fetching https://k8s.io/test-infra/kubet

我们在下面的URL中找到了测试列表。任何人都可以让我知道执行端到端kubernetes测试列表的主要go脚本。

我们已经在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
。。 .. 正在分析来自的元标记(状态代码200) ..

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

请按照以下步骤操作:

安装围棋 安装kubetest 提取版本 针对本地集群的测试
export KUBECONFIG=/path/to/KUBECONFIG
导出KUBE_MASTER_IP=”http://127.0.0.1:"
导出KUBE_MASTER_IP=“127.0.0.1:”
导出KUBE_MASTER=本地
kubetest--test--provider=skeleton--test_args=“--gingo.focus=\[一致性\]”tee test.out

这对我很有效,不确定是否所有步骤都是必要的:

# get kubetest, ginkgo and gomega

go get -u k8s.io/test-infra/kubetest
go get github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/...

# Install Google SDK: https://cloud.google.com/sdk/docs/downloads-versioned-archives
# Login into Google Developer Cloud, necessary to fetch kubetest binaries with extract command

gcloud auth login

# Get the binaries
# WARNING: it removes all directories with kubernetes in the name (weird), it removed my kubernetes-the-hard-way repo, thus better switch to an empty dir before proceeding
kubetest --extract=v1.18.2
cd kubernetes

# Get the kubernetes client config
# I am using my own setup to deploy k8s using ansible/kubeadm here: https://github.com/earthquakesan/kubernetes-the-hard-way
# simply go into vagrant/, then do vagrant up
# after VMs are up, follow the 18-kubeadm.md guide

scp master-1:/home/vagrant/.kube/config ./

# Finally run the tests

export KUBECONFIG=$(pwd)/config
export KUBE_MASTER_IP=192.168.5.30:6443
export KUBE_MASTER_URL=https://192.168.5.30:6443
export KUBE_MASTER=master-1
export KUBERNETES_PROVIDER=skeleton
kubetest --test --test_args="--ginkgo.focus=\[Conformance\]" > test.out

该目录中的
README.md
文件似乎链接到一些相当广泛的文档。你遇到什么麻烦了?嗨,大卫·梅兹,我在找剧本的名字。这样我就可以使用go-run命令运行go脚本。我也在寻找执行端到端一致性测试的其他方法。感谢Prakash提供的详细信息。我试图安装kubetest,但它抛出的状态代码为200。我在这篇文章的描述部分提到了日志。这些确实是有文档记录的说明。但是,文件化的说明不起作用,即使是1.13。祝你有更新的东西好运。这是我的Udemy课程中的一个最新问题;e2e过去是以这种方式安装的,但目前没有。
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
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

# get kubetest, ginkgo and gomega

go get -u k8s.io/test-infra/kubetest
go get github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/...

# Install Google SDK: https://cloud.google.com/sdk/docs/downloads-versioned-archives
# Login into Google Developer Cloud, necessary to fetch kubetest binaries with extract command

gcloud auth login

# Get the binaries
# WARNING: it removes all directories with kubernetes in the name (weird), it removed my kubernetes-the-hard-way repo, thus better switch to an empty dir before proceeding
kubetest --extract=v1.18.2
cd kubernetes

# Get the kubernetes client config
# I am using my own setup to deploy k8s using ansible/kubeadm here: https://github.com/earthquakesan/kubernetes-the-hard-way
# simply go into vagrant/, then do vagrant up
# after VMs are up, follow the 18-kubeadm.md guide

scp master-1:/home/vagrant/.kube/config ./

# Finally run the tests

export KUBECONFIG=$(pwd)/config
export KUBE_MASTER_IP=192.168.5.30:6443
export KUBE_MASTER_URL=https://192.168.5.30:6443
export KUBE_MASTER=master-1
export KUBERNETES_PROVIDER=skeleton
kubetest --test --test_args="--ginkgo.focus=\[Conformance\]" > test.out