首页 > 解决方案 > How to execute the master go scritpt in kubernetes

问题描述

We have found the list of tests in the below URL. Can anyone please let me know the main go script to execute the list of test for end-to-end kubernetes test. https://github.com/kubernetes/kubernetes/tree/master/test/e2e

We have already installed kubernetes in Ubuntu and trying to get the main script that executes all the e2e test.

I have problem in installing kubetest. Please help me to solve the issue. The complete information is given below.

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

.. .. Parsing meta tags from https://k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1?go-get=1 (status code 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: command not found

标签: gokubernetes

解决方案


请按照以下步骤操作:

安装围棋

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


推荐阅读