VMware DNS chaos
VMware DNS chaos causes DNS errors in the VMware VMs which results in the DNS server being unavailable or malfunctioning for a specific duration.
- It checks the performance of the application (or process) running on the VMware VMs.
Usage
View fault usage
Prerequisites
- Kubernetes > 1.16
- Execution plane is connected to vCenter and the hosts on port 443.
- VMware tool is installed on the target VM with remote execution enabled.
- Adequate vCenter permissions to access the hosts and the VMs.
- Create a Kubernetes secret that has the Vcenter credentials in the
CHAOS_NAMESPACE
. Below is a sample secret file:
apiVersion: v1
kind: Secret
metadata:
name: vcenter-secret
namespace: litmus
type: Opaque
stringData:
VCENTERSERVER: XXXXXXXXXXX
VCENTERUSER: XXXXXXXXXXXXX
VCENTERPASS: XXXXXXXXXXXXX
Note
You can pass the VM credentials as secrets or as a ChaosEngine
environment variable.
Default validations
The VM should be in a healthy state before and after injecting chaos.
Fault tunables
Fault tunables
Mandatory fields
Variables | Description | Notes |
---|---|---|
VM_USER_NAME | Username of the target VM(s). | Multiple usernames can be provided as comma-separated values (when there are multiple VMs subject to chaos). It also helps run the govc command. |
VM_PASSWORD | Password for the target VM(s). | It helps run the govc command. |
PORT | DNS Port | Defaults to 54 |
Optional fields
Variables | Description | Notes |
---|---|---|
TOTAL_CHAOS_DURATION | Duration that you specify, through which chaos is injected into the target resource (in seconds). | Defaults to 30s. |
CHAOS_INTERVAL | Time interval between two successive instance terminations (in seconds). | Defaults to 30s. |
SEQUENCE | Sequence of chaos execution for multiple instances. | Defaults to parallel. Supports serial sequence as well. |
RAMP_TIME | Period to wait before and after injecting chaos (in seconds). | For example, 30s. |
TARGET_HOSTNAMES | List of the target host names. If it is not provided, all host names (or domains) are targeted. | For example, '["litmuschaos","chaosnative.com"]'. |
MATCH_SCHEME | Determines whether the DNS query should exactly match the targets or can be a substring. | Defaults to exact. |
UPSTREAM_SERVER | Custom upstream server to which the intercepted DNS requests will be forwarded. | Defaults to the server mentioned in resolv.conf file. |
Secret Fields
Variables | Description | Notes |
---|---|---|
GOVC_URL | vCenter server URL used to perform API calls using the govc command. | It is derived from a secret. |
GOVC_USERNAME | Username of the vCenter server used for authentication purposes. | It can be set up using a secret. |
GOVC_PASSWORD | Password of the vCenter server used for authentication purposes. | It can be set up using a secret. |
GOVC_INSECURE | Runs the govc command in insecure mode. It is set to true . | It can be set up using a secret. |
Fault examples
Common fault tunables
Refer to the common attributes to tune the common tunables for all the faults.
Run DNS chaos with port
It specifies the DNS port where DNS chaos is injected. You can tune it using the PORT
environment variable.
Use the following example to tune it:
# induces DNS chaos on the VMware VM
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: VMware-engine
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-DNS-chaos
spec:
components:
env:
- name: PORT
value: '54'
- name: VM_NAME
value: 'vm-1,vm-2'
- name: VM_USER_NAME
value: 'ubuntu,debian'
- name: VM_PASSWORD
value: '123,123'
Run DNS chaos with target host names
It contains the list of the target host names into which DNS chaos is injected. You can tune it using the TARGET_HOSTNAMES
environment variable.
Use the following example to tune it:
# induces DNS chaos on the VMware VMs
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-DNS-chaos
spec:
components:
env:
# list of target host names
- name: TARGET_HOSTNAMES
value: '["litmuschaos","chaosnative.com"]'
- name: VM_NAME
value: 'vm-1,vm-2'
- name: VM_USER_NAME
value: 'ubuntu,debian'
- name: VM_PASSWORD
value: '123,123'
Run DNS chaos with match scheme
It determines whether the DNS query should exactly match the targets or can be a substring. You can tune it using the MATCH_SCHEME
environment variable.
Use the following example to tune it:
# induces DNS chaos on the VMware VMs
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-DNS-chaos
spec:
components:
env:
# match scheme type
- name: MATCH_SCHEME
value: 'exact'
- name: VM_NAME
value: 'vm-1,vm-2'
- name: VM_USER_NAME
value: 'ubuntu,debian'
- name: VM_PASSWORD
value: '123,123'
Run DNS chaos with upstream server
It specifies the custom upstream server to which the intercepted DNS requests are forwarded. It defaults to the server mentioned in the resolv.conf file. The value can be provided using UPSTREAM_SERVER
environment variable.
Use the following example to tune it:
# induces DNS chaos on the VMware VMs
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-DNS-chaos
spec:
components:
env:
# name of the upstream server
- name: UPSTREAM_SERVER
value: '8.8.8.8'
- name: VM_NAME
value: 'vm-1,vm-2'
- name: VM_USER_NAME
value: 'ubuntu,debian'
- name: VM_PASSWORD
value: '123,123'