apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: postgres.contrail.juniper.net
spec:
  group: contrail.juniper.net
  names:
    kind: Postgres
    listKind: PostgresList
    plural: postgres
    singular: postgres
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .status.replicas
      name: Replicas
      type: integer
    - jsonPath: .status.readyReplicas
      name: Ready_Replicas
      type: integer
    - jsonPath: .status.endpoint
      name: Endpoint
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    - jsonPath: .status.active
      name: Active
      type: boolean
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: Postgres is the Schema for the Postgress 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: PostgresSpec defines the desired state of Postgres
            properties:
              commonConfiguration:
                description: PodConfiguration is the common services struct.
                properties:
                  hostAliases:
                    description: HostAliases is an optional list of hosts and IPs
                      that will be injected into the pod's hosts file if specified.
                    items:
                      description: HostAlias holds the mapping between IP and hostnames
                        that will be injected as an entry in the pod's hosts file.
                      properties:
                        hostnames:
                          description: Hostnames for the above IP address.
                          items:
                            type: string
                          type: array
                        ip:
                          description: IP address of the host file entry.
                          type: string
                      type: object
                    type: array
                  hostNetwork:
                    description: Host networking requested for this pod. Use the host's
                      network namespace. If this option is set, the ports that will
                      be used must be specified. Default to false.
                    type: boolean
                  imagePullSecrets:
                    description: ImagePullSecrets is an optional list of references
                      to secrets in the same namespace to use for pulling any of the
                      images used by this PodSpec.
                    items:
                      type: string
                    type: array
                  nodeSelector:
                    additionalProperties:
                      type: string
                    description: 'NodeSelector is a selector which must be true for
                      the pod to fit on a node. Selector which must match a node''s
                      labels for the pod to be scheduled on that node. More info:
                      https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.'
                    type: object
                  replicas:
                    description: Number of desired pods. This is a pointer to distinguish
                      between explicit zero and not specified. Defaults to 1.
                    format: int32
                    type: integer
                  tolerations:
                    description: If specified, the pod's tolerations.
                    items:
                      description: The pod this Toleration is attached to tolerates
                        any taint that matches the triple <key,value,effect> using
                        the matching operator <operator>.
                      properties:
                        effect:
                          description: Effect indicates the taint effect to match.
                            Empty means match all taint effects. When specified, allowed
                            values are NoSchedule, PreferNoSchedule and NoExecute.
                          type: string
                        key:
                          description: Key is the taint key that the toleration applies
                            to. Empty means match all taint keys. If the key is empty,
                            operator must be Exists; this combination means to match
                            all values and all keys.
                          type: string
                        operator:
                          description: Operator represents a key's relationship to
                            the value. Valid operators are Exists and Equal. Defaults
                            to Equal. Exists is equivalent to wildcard for value,
                            so that a pod can tolerate all taints of a particular
                            category.
                          type: string
                        tolerationSeconds:
                          description: TolerationSeconds represents the period of
                            time the toleration (which must be of effect NoExecute,
                            otherwise this field is ignored) tolerates the taint.
                            By default, it is not set, which means tolerate the taint
                            forever (do not evict). Zero and negative values will
                            be treated as 0 (evict immediately) by the system.
                          format: int64
                          type: integer
                        value:
                          description: Value is the taint value the toleration matches
                            to. If the operator is Exists, the value should be empty,
                            otherwise just a regular string.
                          type: string
                      type: object
                    type: array
                type: object
              serviceConfiguration:
                properties:
                  containers:
                    items:
                      description: Container defines name, image and command.
                      properties:
                        command:
                          items:
                            type: string
                          type: array
                        image:
                          type: string
                        name:
                          type: string
                      type: object
                    type: array
                  listenPort:
                    type: integer
                  replicationPassSecretName:
                    type: string
                  rootPassSecretName:
                    type: string
                  storage:
                    properties:
                      path:
                        type: string
                      size:
                        pattern: ^([0-9]+)([KMGTPE]i)?$
                        type: string
                    type: object
                type: object
            required:
            - serviceConfiguration
            type: object
          status:
            description: PostgresStatus defines the observed state of Postgres
            properties:
              active:
                type: boolean
              endpoint:
                type: string
              readyReplicas:
                format: int32
                type: integer
              replicas:
                format: int32
                type: integer
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
