---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: postgres.postgres.krestomat.io
spec:
  group: postgres.krestomat.io
  names:
    kind: Postgres
    listKind: PostgresList
    plural: postgres
    singular: postgres
  scope: Namespaced
  versions:
  - name: v1alpha1
    schema:
      openAPIV3Schema:
        description: Postgres is the Schema for the postgres 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 Postgres
            type: object
            x-kubernetes-preserve-unknown-fields: true
          status:
            description: Status defines the observed state of Postgres
            type: object
            x-kubernetes-preserve-unknown-fields: true
        type: object
    additionalPrinterColumns:
    - description: Age of the resource
      jsonPath: .metadata.creationTimestamp
      name: AGE
      type: date
    - description: Site status such as Unknown/SettingUp/Ready/Failed/Terminating
        etc
      jsonPath: .status.state
      name: STATUS
      type: string
    - description: Time of latest transition
      jsonPath: .status.conditions[?(@.type=='Ready')].lastTransitionTime
      name: SINCE
      type: date
    - description: "Postgres CR mode: one of 'standalone', 'readreplicas'"
      jsonPath: .spec.postgresMode
      name: MODE
      type: string
    - description: Generated service name to access primary
      jsonPath: .status.service
      name: SERVICE
      type: string
    - description: Generated service name to access readonly replicas when 'readreplicas' mode
      jsonPath: .status.serviceReadOnly
      name: SERVICE-READONLY
      type: string
    served: true
    storage: true
    subresources:
      status: {}
