Coder Social home page Coder Social logo

k8s_dns_chaos's Introduction

k8s_dns_chaos

Name

k8s_dns_chaos - enables inject DNS chaos in a Kubernetes cluster for Chaos Engineering.

Description

This plugin implements the Kubernetes DNS-Based Service Discovery Specification.

CoreDNS running with the k8s_dns_chaos plugin can be used to do chaos tests on DNS.

This plugin can only be used once per Server Block.

Note:

It works with CoreDNS 7d5f5b87a4fb310d442f7ef0d52e3fead0e10d39.

Syntax

k8s_dns_chaos [ZONES...]

The k8s_dns_chaos supports all options in plugin kubernetes, besides, it also supports other configuration items for chaos.

kubernetes [ZONES...] {
    endpoint URL
    tls CERT KEY CACERT
    kubeconfig KUBECONFIG CONTEXT
    namespaces NAMESPACE...
    labels EXPRESSION
    pods POD-MODE
    endpoint_pod_names
    ttl TTL
    noendpoints
    transfer to ADDRESS...
    fallthrough [ZONES...]
    ignore empty_service

    chaos ACTION SCOPE [PODS...]
    grpcport PORT
}

Only [ZONES...], chaos and grpcport is different with plugin with kubernetes:

  • [ZONES...] defines which zones of the host will be treated as internal hosts in the Kubernetes cluster.

  • chaos ACTION SCOPE [PODS...] set the behavior and scope of chaos.

    Valid value for Action:

    • random: return random IP for DNS request.
    • error: return error for DNS request.

    Valid value for SCOPE:

    • inner: chaos only works on the inner host of the Kubernetes cluster.
    • outer: chaos only works on the outer host of the Kubernetes cluster.
    • all: chaos works on all the hosts.

    [PODS...] defines which Pods will take effect, the format is Namespace.PodName.

  • grpcport PORT sets the port of GRPC service, which is used for the hot update of the chaos rules. The default value is 9288. The interface of the GRPC service is defined in dns.proto.

Examples

All DNS requests in Pod busybox.busybox-0 will get error:

    k8s_dns_chaos cluster.local in-addr.arpa ip6.arpa {
        pods insecure
        fallthrough in-addr.arpa ip6.arpa
        ttl 30
        chaos error all busybox.busybox-0
    }

The shell command below will execute failed:

    kubectl exec busybox-0 -it -n busybox -- ping -c 1 google.com
    ping: bad address 'google.com'

k8s_dns_chaos's People

Contributors

wangxiangustc avatar yangkeao avatar

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.