chaos-mesh icon indicating copy to clipboard operation
chaos-mesh copied to clipboard

Experiment Dns-Chaos is not filtering by pattern

Open Alan-Vlc opened this issue 2 years ago • 1 comments

Bug Report

What version of Kubernetes are you using? Client Version v1.24.10 Server Version v1.24.12-gke.500

What version of Chaos Mesh are you using? 2.6.1 What did you do? / Minimal Reproducible Example I have created an experiment of type Dns Fault --> Error and configured only the pattern "google.com".

kind: DNSChaos
apiVersion: chaos-mesh.org/v1alpha1
metadata:
  namespace: demotest-back
  name: dns-error-google
spec:
  action: error
  selector:
    namespaces:
      - demotest-back
    labelSelectors:
      run: tmp-shell
  mode: all
  patterns:
    - google.com

What did you expect to see? The documentation says that only the resolution of google.com should receive an error, the rest of the urls should resolve correctly.

Also, the documentation indicates that pattern is an optional parameter and it is not...

What did you see instead? All DNS resolutions don't work.

tmp-shell:~# nslookup google.com
;; communications error to 100.70.20.182#53: timed out
;; communications error to 100.70.20.182#53: timed out
;; communications error to 100.70.20.182#53: timed out
;; no servers could be reached


tmp-shell:~# nslookup github.com
;; communications error to 100.70.20.182#53: timed out
;; communications error to 100.70.20.182#53: timed out
;; communications error to 100.70.20.182#53: timed out
;; no servers could be reached

Output of chaosctl

kubectl describe dnschaos dns-error-google  -n demotest-back
Name:         dns-error-google
Namespace:    demotest-back
Labels:       <none>
Annotations:  <none>
API Version:  chaos-mesh.org/v1alpha1
Kind:         DNSChaos
Metadata:
  Creation Timestamp:  2023-08-03T09:21:15Z
  Finalizers:
    chaos-mesh/records
  Generation:  5
  Managed Fields:
    API Version:  chaos-mesh.org/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:finalizers:
          .:
          v:"chaos-mesh/records":
      f:status:
        f:conditions:
        f:experiment:
          f:containerRecords:
          f:desiredPhase:
    Manager:      chaos-controller-manager
    Operation:    Update
    Time:         2023-08-03T09:21:15Z
    API Version:  chaos-mesh.org/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:spec:
        .:
        f:action:
        f:mode:
        f:patterns:
        f:selector:
          .:
          f:labelSelectors:
            .:
            f:run:
          f:namespaces:
      f:status:
        .:
        f:experiment:
    Manager:         chaos-dashboard
    Operation:       Update
    Time:            2023-08-03T09:21:15Z
  Resource Version:  520830293
  UID:               8129bdd2-43e0-47f4-b3cb-198913c5a547
Spec:
  Action:  error
  Mode:    all
  Patterns:
    google.com
  Selector:
    Label Selectors:
      Run:  tmp-shell
    Namespaces:
      demotest-back
Status:
  Conditions:
    Status:  True
    Type:    Selected
    Status:  True
    Type:    AllInjected
    Status:  False
    Type:    AllRecovered
    Status:  False
    Type:    Paused
  Experiment:
    Container Records:
      Events:
        Operation:      Apply
        Timestamp:      2023-08-03T09:21:15Z
        Type:           Succeeded
      Id:               demotest-back/tmp-shell/tmp-shell
      Injected Count:   1
      Phase:            Injected
      Recovered Count:  0
      Selector Key:     .
    Desired Phase:      Run
Events:
  Type    Reason           Age   From            Message
  ----    ------           ----  ----            -------
  Normal  FinalizerInited  18m   initFinalizers  Finalizer has been inited
  Normal  Updated          18m   initFinalizers  Successfully update finalizer of resource
  Normal  Started          18m   desiredphase    Experiment has started
  Normal  Updated          18m   desiredphase    Successfully update desiredPhase of resource
  Normal  Applied          18m   records         Successfully apply chaos for demotest-back/tmp-shell/tmp-shell
  Normal  Updated          18m   records         Successfully update records of resource

Thans for your help

Alan-Vlc avatar Aug 03 '23 09:08 Alan-Vlc

I am not sure about that issue is cause by chaos mesh, or your DNS in Kubernetes Clueter already was broken.

Logs from chaos DNS pod might be helpful.

STRRL avatar Aug 08 '23 14:08 STRRL