3.8 KiB · text History c8d9978
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: mutantdeployments.neiam.org
spec:
  group: neiam.org
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                deployment:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true
                mutations:
                  type: array
                  items:
                    type: object
                    properties:
                      label:
                        type: string
                      env:
                        type: object
                        additionalProperties:
                          type: string
                      instances:
                        type: integer
              required:
                - deployment
                - mutations
  scope: Namespaced
  names:
    plural: mutantdeployments
    singular: mutantdeployment
    kind: MutantDeployment
    shortNames:
      - md
---
# A single mutation of a MutantDeployment, created at runtime (e.g. through
# the operator's HTTP API) so the MutantDeployment itself can stay owned by
# GitOps. Schema matches `Mutation` in src/crd.rs.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: mutations.neiam.org
spec:
  group: neiam.org
  scope: Namespaced
  names:
    plural: mutations
    singular: mutation
    kind: Mutation
    shortNames:
      - mut
  versions:
    - name: v1
      served: true
      storage: true
      subresources:
        status: {}
      additionalPrinterColumns:
        - name: Target
          type: string
          jsonPath: .spec.mutantDeployment
        - name: Label
          type: string
          jsonPath: .spec.label
        - name: Instances
          type: integer
          jsonPath: .spec.instances
        - name: Ready
          type: integer
          jsonPath: .status.readyReplicas
        - name: State
          type: string
          jsonPath: .status.state
        - name: Age
          type: date
          jsonPath: .metadata.creationTimestamp
      schema:
        openAPIV3Schema:
          type: object
          required:
            - spec
          properties:
            spec:
              type: object
              required:
                - mutantDeployment
                - label
                - instances
              properties:
                mutantDeployment:
                  description: Name of the MutantDeployment, in the same namespace, to mutate.
                  type: string
                label:
                  description: Suffix of the generated Deployment's name; unique per MutantDeployment.
                  type: string
                  pattern: '^[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?$'
                env:
                  type: object
                  default: {}
                  additionalProperties:
                    type: string
                instances:
                  type: integer
                  format: int32
                  minimum: 0
            status:
              type: object
              required:
                - state
              properties:
                state:
                  type: string
                  enum: [Progressing, Ready, Invalid, Conflict]
                message:
                  type: string
                  nullable: true
                deployment:
                  description: The generated Deployment.
                  type: string
                  nullable: true
                replicas:
                  type: integer
                  format: int32
                  nullable: true
                readyReplicas:
                  type: integer
                  format: int32
                  nullable: true