chaos-mesh / chaos-mesh

A Chaos Engineering Platform for Kubernetes.
https://chaos-mesh.org
Apache License 2.0
6.79k stars 840 forks source link

NetworkChaos: spec. ipsets.ipsetType: Required value #3357

Open WangXiangUSTC opened 2 years ago

WangXiangUSTC commented 2 years ago

Bug Report

What version of Chaos Mesh are you using?

2.1.3

What did you do?

create NetworkChaos with yaml:

kind: NetworkChaos
apiVersion: [chaos-mesh.org/v1alpha1](http://chaos-mesh.org/v1alpha1)
metadata:
  namespace: default
  name: pod-network-loss-03
spec:
  selector:
    namespaces:
      - default
  mode: all
  action: loss
  duration: 4m
  loss:
    loss: '80'
    correlation: '30'
  direction: to
  externalTargets:
    - [8.8.8.8](http://8.8.8.8/)

What did you expect to see?

Create experiment success.

What did you see instead?

Failed, can see error in log:

1.6551092031537092e+09  INFO    trafficcontrol  traffic control Apply   {"namespace": "default",
 "name": "pod-network-loss-03"}
1.6551092031537251e+09  INFO    trafficcontrol  apply traffic control with filter       {"source
s": "default/pod-network-loss-03", "ipset": {"name":"pod-n_3f6ac9537e5100d_netgt","cidrs":["8.8.
8.8/32"],"source":"default/pod-network-loss-03"}}
1.655109203153744e+09   INFO    running modification on pod     {"key": "default/web-show-7c6695
c6b8-lpttv", "modification": {"Steps":[{"Source":"default/pod-network-loss-03"},{"Item":{"name":
"pod-n_3f6ac9537e5100d_netgt","cidrs":["8.8.8.8/32"],"source":"default/pod-network-loss-03"}},{"
Item":{"type":"netem","loss":{"loss":"80","correlation":"30"},"ipset"
:"pod-n_3f6ac9537e5100d_netgt","source":"default/pod-network-loss-03"}}]}}
1.6551092031587057e+09  ERROR   records fail to apply chaos     {"error": "PodNetworkChaos.chaos-mesh.org \"web-show-7c6695c6b8-lpttv\" is invalid: spec.ipsets.ipsetType: Required value"}
github.com/chaos-mesh/chaos-mesh/controllers/common/pipeline.(*Pipeline).Reconcile
        /mnt/controllers/common/pipeline/pipeline.go:73
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
        /tmp/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.0/pkg/internal/controller/controller.go:114
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
        /tmp/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.0/pkg/internal/controller/controller.go:311
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        /tmp/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.0/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
        /tmp/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.0/pkg/internal/controller/controller.go:227
boxker commented 10 months ago

I also encountered the same problem, does anyone know what the problem is? Is there any way to temporarily avoid it?

boxker commented 3 weeks ago

I also encountered the same problem, does anyone know what the problem is? Is there any way to temporarily avoid it?

This problem still exists in version 2.7.0. Can anyone help me figure out what the cause is?

boxker commented 3 weeks ago

@STRRL @g1eny0ung Would you have some time to help take a look, please?