apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: proxies.sidecar.atomix.io
spec:
  group: sidecar.atomix.io
  scope: Namespaced
  names:
    kind: Proxy
    listKind: ProxyList
    plural: proxies
    singular: proxy
  versions:
  - name: v2beta1
    served: true
    storage: true
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        required:
        - spec
        properties:
          spec:
            type: object
            required:
            - pod
            - primitive
            - agent
            properties:
              pod:
                type: object
                x-kubernetes-preserve-unknown-fields: true
              primitive:
                type: object
                x-kubernetes-preserve-unknown-fields: true
              agent:
                type: object
                x-kubernetes-preserve-unknown-fields: true
              permissions:
                type: object
                properties:
                  read:
                    type: boolean
                  write:
                    type: boolean
              config:
                type: object
                x-kubernetes-preserve-unknown-fields: true
          status:
            type: object
            properties:
              ready:
                type: boolean
    additionalPrinterColumns:
    - name: Pod
      type: string
      description: The pod
      jsonPath: .spec.pod.name
    - name: Primitive
      type: string
      description: The store
      jsonPath: .spec.primitive.name
    - name: Read Access
      type: boolean
      description: The read permission
      jsonPath: .spec.permissions.read
    - name: Write Access
      type: boolean
      description: The write permission
      jsonPath: .spec.permissions.write
    - name: Ready
      type: boolean
      description: The proxy status
      jsonPath: .status.ready