---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.17.3
  name: stackconfigpolicies.stackconfigpolicy.k8s.elastic.co
spec:
  group: stackconfigpolicy.k8s.elastic.co
  names:
    categories:
    - elastic
    kind: StackConfigPolicy
    listKind: StackConfigPolicyList
    plural: stackconfigpolicies
    shortNames:
    - scp
    singular: stackconfigpolicy
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: Resources configured
      jsonPath: .status.readyCount
      name: Ready
      type: string
    - jsonPath: .status.phase
      name: Phase
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: StackConfigPolicy represents a StackConfigPolicy resource in
          a Kubernetes cluster.
        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:
            properties:
              elasticsearch:
                properties:
                  clusterSettings:
                    description: ClusterSettings holds the Elasticsearch cluster settings
                      (/_cluster/settings)
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  config:
                    description: Config holds the settings that go into elasticsearch.yml.
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  indexLifecyclePolicies:
                    description: IndexLifecyclePolicies holds the Index Lifecycle
                      policies settings (/_ilm/policy)
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  indexTemplates:
                    description: IndexTemplates holds the Index and Component Templates
                      settings
                    properties:
                      componentTemplates:
                        description: ComponentTemplates holds the Component Templates
                          settings (/_component_template)
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                      composableIndexTemplates:
                        description: ComposableIndexTemplates holds the Index Templates
                          settings (/_index_template)
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  ingestPipelines:
                    description: IngestPipelines holds the Ingest Pipelines settings
                      (/_ingest/pipeline)
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  secretMounts:
                    description: SecretMounts are additional Secrets that need to
                      be mounted into the Elasticsearch pods.
                    items:
                      description: SecretMount contains information about additional
                        secrets to be mounted to the elasticsearch pods
                      properties:
                        mountPath:
                          description: MountPath denotes the path to which the secret
                            should be mounted to inside the elasticsearch pod
                          type: string
                        secretName:
                          description: SecretName denotes the name of the secret that
                            needs to be mounted to the elasticsearch pod
                          type: string
                      type: object
                    type: array
                    x-kubernetes-preserve-unknown-fields: true
                  secureSettings:
                    description: SecureSettings are additional Secrets that contain
                      data to be configured to Elasticsearch's keystore.
                    items:
                      description: SecretSource defines a data source based on a Kubernetes
                        Secret.
                      properties:
                        entries:
                          description: |-
                            Entries define how to project each key-value pair in the secret to filesystem paths.
                            If not defined, all keys will be projected to similarly named paths in the filesystem.
                            If defined, only the specified keys will be projected to the corresponding paths.
                          items:
                            description: KeyToPath defines how to map a key in a Secret
                              object to a filesystem path.
                            properties:
                              key:
                                description: Key is the key contained in the secret.
                                type: string
                              path:
                                description: |-
                                  Path is the relative file path to map the key to.
                                  Path must not be an absolute file path and must not contain any ".." components.
                                type: string
                            required:
                            - key
                            type: object
                          type: array
                        secretName:
                          description: SecretName is the name of the secret.
                          type: string
                      required:
                      - secretName
                      type: object
                    type: array
                    x-kubernetes-preserve-unknown-fields: true
                  securityRoleMappings:
                    description: SecurityRoleMappings holds the Role Mappings settings
                      (/_security/role_mapping)
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  snapshotLifecyclePolicies:
                    description: SnapshotLifecyclePolicies holds the Snapshot Lifecycle
                      Policies settings (/_slm/policy)
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  snapshotRepositories:
                    description: SnapshotRepositories holds the Snapshot Repositories
                      settings (/_snapshot)
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                type: object
              kibana:
                properties:
                  config:
                    description: Config holds the settings that go into kibana.yml.
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  secureSettings:
                    description: SecureSettings are additional Secrets that contain
                      data to be configured to Kibana's keystore.
                    items:
                      description: SecretSource defines a data source based on a Kubernetes
                        Secret.
                      properties:
                        entries:
                          description: |-
                            Entries define how to project each key-value pair in the secret to filesystem paths.
                            If not defined, all keys will be projected to similarly named paths in the filesystem.
                            If defined, only the specified keys will be projected to the corresponding paths.
                          items:
                            description: KeyToPath defines how to map a key in a Secret
                              object to a filesystem path.
                            properties:
                              key:
                                description: Key is the key contained in the secret.
                                type: string
                              path:
                                description: |-
                                  Path is the relative file path to map the key to.
                                  Path must not be an absolute file path and must not contain any ".." components.
                                type: string
                            required:
                            - key
                            type: object
                          type: array
                        secretName:
                          description: SecretName is the name of the secret.
                          type: string
                      required:
                      - secretName
                      type: object
                    type: array
                    x-kubernetes-preserve-unknown-fields: true
                type: object
              resourceSelector:
                description: |-
                  A label selector is a label query over a set of resources. The result of matchLabels and
                  matchExpressions are ANDed. An empty label selector matches all objects. A null
                  label selector matches no objects.
                properties:
                  matchExpressions:
                    description: matchExpressions is a list of label selector requirements.
                      The requirements are ANDed.
                    items:
                      description: |-
                        A label selector requirement is a selector that contains values, a key, and an operator that
                        relates the key and values.
                      properties:
                        key:
                          description: key is the label key that the selector applies
                            to.
                          type: string
                        operator:
                          description: |-
                            operator represents a key's relationship to a set of values.
                            Valid operators are In, NotIn, Exists and DoesNotExist.
                          type: string
                        values:
                          description: |-
                            values is an array of string values. If the operator is In or NotIn,
                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
                            the values array must be empty. This array is replaced during a strategic
                            merge patch.
                          items:
                            type: string
                          type: array
                          x-kubernetes-list-type: atomic
                      required:
                      - key
                      - operator
                      type: object
                    type: array
                    x-kubernetes-list-type: atomic
                  matchLabels:
                    additionalProperties:
                      type: string
                    description: |-
                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
                      map is equivalent to an element of matchExpressions, whose key field is "key", the
                      operator is "In", and the values array contains only "value". The requirements are ANDed.
                    type: object
                type: object
                x-kubernetes-map-type: atomic
              secureSettings:
                description: 'Deprecated: SecureSettings only applies to Elasticsearch
                  and is deprecated. It must be set per application instead.'
                items:
                  description: SecretSource defines a data source based on a Kubernetes
                    Secret.
                  properties:
                    entries:
                      description: |-
                        Entries define how to project each key-value pair in the secret to filesystem paths.
                        If not defined, all keys will be projected to similarly named paths in the filesystem.
                        If defined, only the specified keys will be projected to the corresponding paths.
                      items:
                        description: KeyToPath defines how to map a key in a Secret
                          object to a filesystem path.
                        properties:
                          key:
                            description: Key is the key contained in the secret.
                            type: string
                          path:
                            description: |-
                              Path is the relative file path to map the key to.
                              Path must not be an absolute file path and must not contain any ".." components.
                            type: string
                        required:
                        - key
                        type: object
                      type: array
                    secretName:
                      description: SecretName is the name of the secret.
                      type: string
                  required:
                  - secretName
                  type: object
                type: array
            type: object
          status:
            properties:
              details:
                additionalProperties:
                  additionalProperties:
                    description: ResourcePolicyStatus models the status of the policy
                      for one resource to be configured.
                    properties:
                      currentVersion:
                        description: |-
                          CurrentVersion denotes the current version of filesettings applied to the Elasticsearch cluster
                          This field does not apply to Kibana resources
                        format: int64
                        type: integer
                      error:
                        properties:
                          message:
                            type: string
                          version:
                            format: int64
                            type: integer
                        type: object
                      expectedVersion:
                        description: |-
                          ExpectedVersion denotes the expected version of filesettings that should be applied to the Elasticsearch cluster
                          This field does not apply to Kibana resources
                        format: int64
                        type: integer
                      phase:
                        type: string
                    type: object
                  type: object
                description: Details holds the status details for each resource to
                  be configured.
                type: object
              errors:
                description: Errors is the number of resources which have an incorrect
                  configuration
                type: integer
              observedGeneration:
                description: ObservedGeneration is the most recent generation observed
                  for this StackConfigPolicy.
                format: int64
                type: integer
              phase:
                description: Phase is the phase of the StackConfigPolicy.
                type: string
              ready:
                description: Ready is the number of resources successfully configured.
                type: integer
              readyCount:
                description: ReadyCount is a human representation of the number of
                  resources successfully configured.
                type: string
              resources:
                description: Resources is the number of resources to be configured.
                type: integer
              resourcesStatuses:
                additionalProperties:
                  description: ResourcePolicyStatus models the status of the policy
                    for one resource to be configured.
                  properties:
                    currentVersion:
                      description: |-
                        CurrentVersion denotes the current version of filesettings applied to the Elasticsearch cluster
                        This field does not apply to Kibana resources
                      format: int64
                      type: integer
                    error:
                      properties:
                        message:
                          type: string
                        version:
                          format: int64
                          type: integer
                      type: object
                    expectedVersion:
                      description: |-
                        ExpectedVersion denotes the expected version of filesettings that should be applied to the Elasticsearch cluster
                        This field does not apply to Kibana resources
                      format: int64
                      type: integer
                    phase:
                      type: string
                  type: object
                description: |-
                  ResourcesStatuses holds the status for each resource to be configured.
                  Deprecated: Details is used to store the status of resources from ECK 2.11
                type: object
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
