kubernetes 自定义资源定义(CustomResourceDefinition)的监视测试在同一个集群上多次运行时可能会出现不稳定的情况,

iibxawm4  于 2个月前  发布在  Kubernetes
关注(0)|答案(4)|浏览(40)

发生了什么?

我们在同一个集群上多次运行一致性测试。测试最初失败,错误信息为

INFO: Unexpected error: failed to list events in namespace "crd-watch-7911": 
      <*url.Error | 0xc004873770>: 
      Get "https://<CP_IP_AND_PORT>/api/v1/namespaces/crd-watch-7911/events": dial tcp <CP_IP_AND_PORT>: connect: connection refused
      {
          Op: "Get",
          URL: "https://<CP_IP_AND_PORT>/api/v1/namespaces/crd-watch-7911/events",
          Err: <*net.OpError | 0xc0006c3220>{
              Op: "dial",
              Net: "tcp",
              Source: nil,
              Addr: <*net.TCPAddr | 0xc003832750>{
                  <redacted>
                  Zone: "",
              },
              Err: <*os.SyscallError | 0xc002a6f680>{
                  Syscall: "connect",
                  Err: <syscall.Errno>0x6f,
              },
          },
      }
  [FAILED] in [DeferCleanup (Each)] - test/e2e/framework/debug/dump.go:44 @ 02/20/24 23:38:32.653


然后,后续的所有测试都以以下错误信息失败:

[FAILED] failed to create CustomResourceDefinition: customresourcedefinitions.apiextensions.k8s.io "noxus.mygroup.example.com" already exists
  In [It] at: test/e2e/apimachinery/crd_watch.go:71 @ 02/21/24 23:36:15.799

你期望会发生什么?

一致性测试应该能够承受 transient 错误,并且在失败的运行后清理CRD。

我们如何尽可能精确地重现它?

通过在集群上创建相同的CRD并运行一致性测试,可以重复出现相同的问题。(修复也可以通过在创建CRD后至少运行两次一致性测试来验证——第一次运行可能会失败,但第二次运行应该通过)

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: noxus.mygroup.example.com
spec:
  conversion:
    strategy: None
  group: mygroup.example.com
  names:
    categories:
    - all
    kind: WishIHadChosenNoxu
    listKind: NoxuItemList
    plural: noxus
    shortNames:
    - foo
    - bar
    - abc
    - def
    singular: nonenglishnoxu
  scope: Cluster
  versions:
  - name: v1beta1
    schema:
      openAPIV3Schema:
        type: object
        x-kubernetes-preserve-unknown-fields: true
    served: true
    storage: true

我们需要了解其他任何信息吗?

  • 无响应*

Kubernetes版本

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.5", GitCommit:"6b1d87acf3c8253c123756b9e61dac642678305f", GitTreeState:"clean", BuildDate:"2021-03-18T01:10:43Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}

云提供商

这是一个裸金属集群。

OS版本

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

安装工具

容器运行时(CRI)和版本(如果适用)

相关插件(CNI,CSI,...)和版本(如果适用)

eufgjt7s

eufgjt7s1#

/area flake
/sig api-machinery
fgw7neuy

fgw7neuy2#

@neolit123: 标签 area/flake 无法应用,因为仓库中没有它们。
对此的回应:
/area flake
/sig api-machinery
使用PR评论与我互动的指南已提供。如果您对我的行为有任何疑问或建议,请针对 kubernetes/test-infra 仓库提出问题。

rqqzpn5f

rqqzpn5f4#

/assign @jpbetz
As one of the authors of test/e2e/apimachinery/crd_watch.go
Thank you.
/triage accepted

相关问题