apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: spinnakerservices.spinnaker.io
spec:
  group: spinnaker.io
  names:
    kind: SpinnakerService
    listKind: SpinnakerServiceList
    plural: spinnakerservices
    shortNames:
    - spinsvc
    singular: spinnakerservice
  scope: Namespaced
  versions:
  - name: v1alpha2
    subresources:
      status: {}
    additionalPrinterColumns:
    - jsonPath: .status.version
      description: Version
      name: version
      type: string
    - jsonPath: .status.lastDeployed.config.lastUpdatedAt
      description: Last Configured
      name: lastConfigured
      type: date
    - jsonPath: .status.status
      description: Status
      name: status
      type: string
    - jsonPath: .status.serviceCount
      description: Services
      name: services
      type: number
    - jsonPath: .status.uiUrl
      description: URL
      name: url
      type: string
    - jsonPath: .status.apiUrl
      description: API URL
      name: apiUrl
      priority: 1
      type: string
    schema:
      openAPIV3Schema:
        description: SpinnakerService is the Schema for the spinnakerservices 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/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/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: SpinnakerServiceSpec defines the desired state of SpinnakerService
            properties:
              accounts:
                properties:
                  dynamic:
                    description: Enable accounts to be added dynamically
                    type: boolean
                  enabled:
                    description: Enable the injection of SpinnakerAccount
                    type: boolean
                type: object
              expose:
                description: ExposeConfig represents the configuration for exposing
                  Spinnaker
                properties:
                  service:
                    description: ExposeConfigService represents the configuration for
                      exposing Spinnaker using k8s services
                    properties:
                      annotations:
                        additionalProperties:
                          type: string
                        type: object
                      overrides:
                        additionalProperties:
                          description: ExposeConfigServiceOverrides represents expose
                            configurations of type service, overriden by specific services
                          properties:
                            annotations:
                              additionalProperties:
                                type: string
                              type: object
                            publicPort:
                              format: int32
                              type: integer
                            type:
                              type: string
                          type: object
                        type: object
                      publicPort:
                        format: int32
                        type: integer
                      type:
                        type: string
                    type: object
                  type:
                    type: string
                type: object
              kustomize:
                additionalProperties:
                  properties:
                    deployment:
                      properties:
                        patches:
                          description: Patches is a list of patches, where each one
                            can be either a Strategic Merge Patch or a JSON patch. Each
                            patch can be applied to multiple target objects.
                          items:
                            type: string
                          type: array
                        patchesJson6902:
                          description: JSONPatches is a list of JSONPatch for applying
                            JSON patch. Format documented at https://tools.ietf.org/html/rfc6902
                            and http://jsonpatch.com
                          type: string
                        patchesStrategicMerge:
                          description: PatchesStrategicMerge specifies the relative
                            path to a file containing a strategic merge patch.  Format
                            documented at https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md
                            URLs and globs are not supported.
                          items:
                            description: PatchStrategicMerge represents a relative path
                              to a strategic merge patch with the format https://github.com/kubernetes/community/blob/master/contributors/devel/sig-api-machinery/strategic-merge-patch.md
                            type: string
                          type: array
                      type: object
                    service:
                      properties:
                        patches:
                          description: Patches is a list of patches, where each one
                            can be either a Strategic Merge Patch or a JSON patch. Each
                            patch can be applied to multiple target objects.
                          items:
                            type: string
                          type: array
                        patchesJson6902:
                          description: JSONPatches is a list of JSONPatch for applying
                            JSON patch. Format documented at https://tools.ietf.org/html/rfc6902
                            and http://jsonpatch.com
                          type: string
                        patchesStrategicMerge:
                          description: PatchesStrategicMerge specifies the relative
                            path to a file containing a strategic merge patch.  Format
                            documented at https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md
                            URLs and globs are not supported.
                          items:
                            description: PatchStrategicMerge represents a relative path
                              to a strategic merge patch with the format https://github.com/kubernetes/community/blob/master/contributors/devel/sig-api-machinery/strategic-merge-patch.md
                            type: string
                          type: array
                      type: object
                  type: object
                description: Patch Kustomization of service and deployment per service
                type: object
              spinnakerConfig:
                properties:
                  config:
                    description: Main deployment configuration to be passed to Halyard
                    type: object
                  files:
                    additionalProperties:
                      type: string
                    description: Supporting files for the Spinnaker config
                    type: object
                  profiles:
                    additionalProperties:
                      type: string
                    description: Service profiles will be parsed as YAML
                    type: object
                  service-settings:
                    additionalProperties:
                      type: string
                    description: Parsed service settings - comments are stripped
                    type: object
                type: object
              validation:
                description: validation settings for the deployment
                properties:
                  canary:
                    additionalProperties:
                      properties:
                        enabled:
                          description: Enable or disable validation, defaults to false
                          type: boolean
                        failOnError:
                          description: Report errors but do not fail validation, defaults
                            to true
                          type: boolean
                        frequencySeconds:
                          x-kubernetes-int-or-string: true
                          description: Number of seconds between each validation
                      required:
                      - enabled
                      type: object
                    type: object
                  ci:
                    additionalProperties:
                      properties:
                        enabled:
                          description: Enable or disable validation, defaults to false
                          type: boolean
                        failOnError:
                          description: Report errors but do not fail validation, defaults
                            to true
                          type: boolean
                        frequencySeconds:
                          x-kubernetes-int-or-string: true
                          description: Number of seconds between each validation
                      required:
                      - enabled
                      type: object
                    type: object
                  failFast:
                    description: Fail validation on the first failed validation, defaults
                      to false
                    type: boolean
                  failOnError:
                    description: Report errors but do not fail validation, defaults
                      to true
                    type: boolean
                  frequencySeconds:
                    x-kubernetes-int-or-string: true
                    description: Number of seconds between each validation
                  metricStores:
                    additionalProperties:
                      properties:
                        enabled:
                          description: Enable or disable validation, defaults to false
                          type: boolean
                        failOnError:
                          description: Report errors but do not fail validation, defaults
                            to true
                          type: boolean
                        frequencySeconds:
                          x-kubernetes-int-or-string: true
                          description: Number of seconds between each validation
                      required:
                      - enabled
                      type: object
                    type: object
                  notifications:
                    additionalProperties:
                      properties:
                        enabled:
                          description: Enable or disable validation, defaults to false
                          type: boolean
                        failOnError:
                          description: Report errors but do not fail validation, defaults
                            to true
                          type: boolean
                        frequencySeconds:
                          x-kubernetes-int-or-string: true
                          description: Number of seconds between each validation
                      required:
                      - enabled
                      type: object
                    type: object
                  persistentStorage:
                    additionalProperties:
                      properties:
                        enabled:
                          description: Enable or disable validation, defaults to false
                          type: boolean
                        failOnError:
                          description: Report errors but do not fail validation, defaults
                            to true
                          type: boolean
                        frequencySeconds:
                          x-kubernetes-int-or-string: true
                          description: Number of seconds between each validation
                      required:
                      - enabled
                      type: object
                    type: object
                  providers:
                    additionalProperties:
                      properties:
                        enabled:
                          description: Enable or disable validation, defaults to false
                          type: boolean
                        failOnError:
                          description: Report errors but do not fail validation, defaults
                            to true
                          type: boolean
                        frequencySeconds:
                          x-kubernetes-int-or-string: true
                          description: Number of seconds between each validation
                      required:
                      - enabled
                      type: object
                    type: object
                  pubsub:
                    additionalProperties:
                      properties:
                        enabled:
                          description: Enable or disable validation, defaults to false
                          type: boolean
                        failOnError:
                          description: Report errors but do not fail validation, defaults
                            to true
                          type: boolean
                        frequencySeconds:
                          x-kubernetes-int-or-string: true
                          description: Number of seconds between each validation
                      required:
                      - enabled
                      type: object
                    type: object
                type: object
            required:
            - spinnakerConfig
            type: object
          status:
            description: SpinnakerServiceStatus defines the observed state of SpinnakerService
            properties:
              accountCount:
                description: Number of accounts
                type: integer
              apiUrl:
                description: Exposed Gate URL
                type: string
              lastDeployed:
                additionalProperties:
                  properties:
                    hash:
                      type: string
                    lastUpdatedAt:
                      format: date-time
                      type: string
                  required:
                  - hash
                  type: object
                description: Last deployed hashes
                type: object
              serviceCount:
                description: Number of services in Spinnaker
                type: integer
              services:
                description: Services deployment information
                items:
                  description: SpinnakerDeploymentStatus represents the deployment status
                    of a single service
                  properties:
                    image:
                      description: Image deployed
                      type: string
                    name:
                      description: Name of the service deployed
                      type: string
                    readyReplicas:
                      description: Total number of ready pods targeted by this deployment.
                      format: int32
                      type: integer
                    replicas:
                      description: Total number of non-terminated pods targeted by this
                        deployment (their labels match the selector).
                      format: int32
                      type: integer
                  required:
                  - name
                  type: object
                type: array
              status:
                description: Overall Spinnaker status
                type: string
              uiUrl:
                description: Exposed Deck URL
                type: string
              version:
                description: Current deployed version of Spinnaker
                type: string
            type: object
        type: object
    served: true
    storage: true
