Git Product home page Git Product logo

cyclonus's People

Contributors

dougsland avatar huntergregory avatar jaydeokar avatar jayunit100 avatar johnschnake avatar matmerr avatar mattfenwick avatar testwill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cyclonus's Issues

Create feature support matrix

Including:

underlying OS:

  • linux
  • windows

kube version:

  • 1.21
  • 1.20
  • 1.19

IP stack:

  • IPV4
  • dual-stack
  • IPV6

CNI:

  • Antrea
  • Calico
  • Cilium
  • ovn-kubernetes
  • flannel
  • weave

Cluster:

  • kind
  • k3s
  • GKE
  • AKS
  • EKS
  • bare-metal

What else?

report issues with parsing network policies

The following policy is incorrectly indented, so fails to create in kubernetes.

kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: allow-all-ingress-egress-by-label
  namespace: "y"
spec:
  policyTypes:
    - Egress
    - Ingress
  podSelector:
    matchExpressions:
      - key: pod
        operator: In
        values: [a, b, c]
  egress:
    - to:
      - podSelector:
        matchLabels:
          use: db
  ingress:
    - from:
      - ipBlock:
        cidr: 172.17.0.0/16
        except:
        - 172.17.1.0/24
      - namespaceSelector:
        matchLabels:
          project: myproject
      - podSelector:
        matchLabels:
          role: frontend
      ports:
        - protocol: TCP
          port: 6379
$ kubectl create -f policy.yaml
error: error validating "policy.yaml": error validating data: [ValidationError(NetworkPolicy.spec.egress[0].to[0]): unknown field "matchLabels" in io.k8s.api.networking.v1.NetworkPolicyPeer, ValidationError(NetworkPolicy.spec.ingress[0].from[0]): unknown field "cidr" in io.k8s.api.networking.v1.NetworkPolicyPeer, ValidationError(NetworkPolicy.spec.ingress[0].from[0]): unknown field "except" in io.k8s.api.networking.v1.NetworkPolicyPeer, ValidationError(NetworkPolicy.spec.ingress[0].from[1]): unknown field "matchLabels" in io.k8s.api.networking.v1.NetworkPolicyPeer, ValidationError(NetworkPolicy.spec.ingress[0].from[2]): unknown field "matchLabels" in io.k8s.api.networking.v1.NetworkPolicyPeer]; if you choose to ignore these errors, turn validation off with --validate=false

However, cyclonus doesn't notice these problems.

Cyclonus should notice these problems and report them.

support running from inside cluster

  • service account + privileges to
    • CRUD network policies
    • CRUD namespaces
    • CRUD pods
    • CRUD services
    • execute remote commands
  • k8s client instantation

improve clarity of analysis output

Goal: make it easier, faster, and more useful for a user to understand cyclonus output.

Ideas:

  • color
  • formatting
  • schema
  • extra information

collect cyclonus data across a variety of clusters and CNIs

Procedure:

IPV4 Progress table:

KinD:

CNI Version Linux Windows
Calico v3.18.0
Calico v3.18.1
Antrea v0.12.0
Antrea v0.12.2
Cilium v1.9.4
Cilium v1.9.5
Weave ???
ovn-kubernetes ???

Azure:

CNI Version Linux Windows
Calico v3.18.1

GKE:

CNI Version Linux Windows
Calico v3.18.0
Antrea v0.12.2
Cilium v1.9.5
ovn-kubernetes ???

EKS:

CNI Version Linux Windows
Calico v3,18.0
Antrea v0.12.2
Cilium v1.9.5
ovn-kubernetes ???

Partial data:

Network policies not supported, so don't need data:

  • Flannel

IPV6 is not yet supported by Cyclonus

Bugs reported

handle pod IPs in different /24 subnets

Cyclonus currently assumes that pods are all in the same /24 subnet; if this assumption is violated, spurious failures will be reported.

Cyclonus should not make this assumption.

UX: Rename fuzz command to generate

cyclonus currently has a fuzz command that is described as:

Generate network policies, install the policies one at a time in kubernetes, and compare actual measured connectivity to expected connectivity using a truth table.

Fuzzing is described by Wikipedia as:

Fuzzing or fuzz testing is an automated software testing technique that involves providing invalid, unexpected, or random data as inputs to a computer program.

Since generate is a more accurate description of what the fuzz command currently does, would it make sense to rename the command from fuzz to generate?

Feature request: ability to mark test failures as expected

Cilium currently does not pass all of cyclonus's tests (cilium/cilium#14678), and as cyclonus's test suite expands Cilium might fail other tests due to missing features in Cilium's NetworkPolicy implementation.

So that cyclonus can be used in Cilium's CI (which requires all tests to pass before a PR can be merged), it would be nice if individual tests could be marked as "expected to fail". For these tests, cyclonus should still run them, but report success if they fail and failure if they succeed. This allows CI to pass for known failures, and will alert developers to update the cyclonus test configuration if/when Cilium fixes the bug.

Marking individual tests as "expected to fail" could either be done through a CLI option or a configuration file, depending on the number of tests expected to fail.

state validation fails due to new default namespace labels

This happens on newer kube versions, see: kubernetes/kubernetes#96968

Logs:
Untitled.txt

time="2021-04-09T09:52:57Z" level=fatal msg="for namespace y, expected labels map[ns:y] (found map[kubernetes.io/metadata.name:y ns:y])\n
github.com/mattfenwick/cyclonus/pkg/connectivity.(*TestCaseState).verifyClusterStateHelper
  /Users/mfenwick/go/src/github.com/mattfenwick/cyclonus/pkg/connectivity/testcasestate.go:238
github.com/mattfenwick/cyclonus/pkg/connectivity.(*TestCaseState).VerifyClusterState
  /Users/mfenwick/go/src/github.com/mattfenwick/cyclonus/pkg/connectivity/testcasestate.go:286
github.com/mattfenwick/cyclonus/pkg/connectivity.(*Interpreter).ExecuteTestCase
  /Users/mfenwick/go/src/github.com/mattfenwick/cyclonus/pkg/connectivity/interpreter.go:85
github.com/mattfenwick/cyclonus/pkg/cli.RunGenerateCommand\n\t/Users/mfenwick/go/src/github.com/mattfenwick/cyclonus/pkg/cli/generate.go:135\ngithub.com/mattfenwick/cyclonus/pkg/cli.SetupGenerateCommand.func1\n\t/Users/mfenwick/go/src/github.com/mattfenwick/cyclonus/pkg/cli/generate.go:44\ngithub.com/spf13/cobra.
(*Command).execute\n\t/Users/mfenwick/go/pkg/mod/github.com/spf13/[email protected]/command.go:846\ngithub.com/spf13/cobra.
(*Command).ExecuteC\n\t/Users/mfenwick/go/pkg/mod/github.com/spf13/[email protected]/command.go:950\ngithub.com/spf13/cobra.
(*Command).Execute\n\t/Users/mfenwick/go/pkg/mod/github.com/spf13/[email protected]/command.go:887\ngithub.com/mattfenwick/cyclonus/pkg/cli.RunRootCommand\n\t/Users/mfenwick/go/src/github.com/mattfenwick/cyclonus/pkg/cli/root.go:13\nmain.main\n\t/Users/mfenwick/go/src/github.com/mattfenwick/cyclonus/cmd/cyclonus/main.go:8\nruntime.main\n\t/usr/local/Cellar/go/1.15.5/libexec/src/runtime/proc.go:204\nruntime.goexit\n\t/usr/local/Cellar/go/1.15.5/libexec/src/runtime/asm_amd64.s:1374"

TODOs:

  • get a cluster of 1.21 to repro this against
  • come up with some code that works on both <= 1.20 and >= 1.21
  • (maybe) just ignore extra labels
  • (maybe) detect cluster version and do the right thing automatically
  • (maybe) provide a CLI switch to turn on/off the labels

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.