---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: clusterimpairments.apps.redhat.com
spec:
  group: apps.redhat.com
  names:
    kind: ClusterImpairment
    listKind: ClusterImpairmentList
    plural: clusterimpairments
    singular: clusterimpairment
  scope: Cluster
  versions:
  - additionalPrinterColumns:
    - description: Run status
      jsonPath: .status.run_status
      name: Status
      type: string
    - description: Run status details
      jsonPath: .status.status_details
      name: Details
      type: string
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: ClusterImpairment is the Schema for the clusterimpairments API
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: "Spec defines the desired state of ClusterImpairment"
            type: object
            properties:
              duration:
                description: "The duration of the impairment in seconds."
                type: integer
              startDelay:
                description: "The delay (in seconds) before starting the impairments. At least 5 seconds recommended for Kubernetes and for synchronization of the impairments."
                type: integer
              interfaces:
                description: "All interfaces that the impairments should be applied to. Must be valid interfaces or the impairments will fail to apply."
                type: array
                items:
                  type: string
              ingress:
                description: "The configuration section that specifies the ingress impairments."
                type: object
                properties:
                  bandwidth:
                    description: "The bandwidth limit in kbit/sec"
                    type: integer
                  latency:
                    description: "The latency applied in ms"
                    type: number
                  latencyOptions:
                    description: "Advanced latency options. Example: jitter"
                    type: object
                    properties:
                      jitter:
                        description: "Variation in the latency that follows the specified distribution."
                        type: number
                      jitterCorrelation:
                        description: "The correlation between sequential jitter values"
                        type: number
                      distribution:
                        description: "The way the jitter is distributed. Options: Normal, Uniform, Pareto, Paretonormal"
                        type: string
                      reorder:
                        description: "The percentage of packets that are not delayed, causing reordering"
                        type: number
                      reorderCorrelation:
                        description: "The correlation between sequential reorder values"
                        type: number
                  loss:
                    description: "The packet loss in percent"
                    type: number
                  lossOptions:
                    description: "Advanced packet loss options"
                    type: object
                    properties:
                      correlation:
                        type: number
                        description: "The correlation between sequential packet loss values"
                  corruption:
                    description: "The percent of packets that are corrupted"
                    type: number
                  corruptionOptions:
                    description: "Advanced corruption options"
                    type: object
                    properties:
                      correlation:
                        type: number
                        description: "The correlation between sequential corruption values"
                  duplication:
                    description: "The percent of packets duplicated"
                    type: number
                  duplicationOptions:
                    description: "Advanced duplication options"
                    type: object
                    properties:
                      correlation:
                        type: number
                        description: "The correlation between sequential duplication values"
              egress:
                description: "The configuration section that specifies the egress impairments."
                type: object
                properties:
                  bandwidth:
                    description: "The bandwidth limit in kbit/sec"
                    type: integer
                  latency:
                    description: "The latency applied in ms"
                    type: number
                  latencyOptions:
                    description: "Advanced latency options. Example: jitter"
                    type: object
                    properties:
                      jitter:
                        description: "Variation in the latency that follows the specified distribution."
                        type: number
                      jitterCorrelation:
                        description: "The correlation between sequential jitter values"
                        type: number
                      distribution:
                        description: "The way the jitter is distributed. Options: Normal, Uniform, Pareto, Paretonormal"
                        type: string
                      reorder:
                        description: "The percentage of packets that are not delayed, causing reordering"
                        type: number
                      reorderCorrelation:
                        description: "The correlation between sequential reorder values"
                        type: number
                  loss:
                    description: "The packet loss in percent"
                    type: number
                  lossOptions:
                    description: "Advanced packet loss options"
                    type: object
                    properties:
                      correlation:
                        type: number
                        description: "The correlation between sequential packet loss values"
                  corruption:
                    description: "The percent of packets that are corrupted"
                    type: number
                  corruptionOptions:
                    description: "Advanced corruption options"
                    type: object
                    properties:
                      correlation:
                        type: number
                        description: "The correlation between sequential corruption values"
                  duplication:
                    description: "The percent of packets duplicated"
                    type: number
                  duplicationOptions:
                    description: "Advanced duplication options"
                    type: object
                    properties:
                      correlation:
                        type: number
                        description: "The correlation between sequential duplication values"
              linkFlapping:
                description: "The configuration section that specifies the link flapping impairments."
                type: object
                properties:
                  enable:
                    description: "Whether to enable link flapping."
                    type: boolean
                  downTime:
                    description: "The duration that the link should be disabled."
                    type: integer
                  upTime:
                    description: "The duration that the link should be enabled."
                    type: integer
              nodeSelector:
                description: "The configuration section that specifies the node selector that should be applied to the daemonset. Default: worker nodes."
                type: object
                properties:
                  key:
                    description: "The key for the node selector"
                    type: string
                  value:
                    description: "The value for the node selector"
                    type: string
          status:
            description: "Status defines the observed state of ClusterImpairment"
            type: object
            x-kubernetes-preserve-unknown-fields: true
        type: object
    served: true
    storage: true
    subresources:
      status:
        run_status: not_run
