##---
# Source: olm/templates/09-tectoniccomponents.configmap.yaml

kind: ConfigMap
apiVersion: v1
metadata:
  name: tectonic-components
  namespace: kube-system
  labels:
    tectonic-operators.coreos.com/managed-by: tectonic-x-operator

data:
  customResourceDefinitions: |-
    - apiVersion: apiextensions.k8s.io/v1beta1
      kind: CustomResourceDefinition
      metadata:
        name: chargebacks.chargeback.coreos.com
        annotations:
          catalog.app.coreos.com/description: An instance of Chargeback
          catalog.app.coreos.com/displayName: Chargeback
      spec:
        group: chargeback.coreos.com
        version: v1alpha1
        scope: Namespaced
        names:
          plural: chargebacks
          singular: chargeback
          kind: Chargeback
          listKind: ChargebackList
      
    - apiVersion: apiextensions.k8s.io/v1beta1
      kind: CustomResourceDefinition
      metadata:
        name: prestotables.chargeback.coreos.com
        annotations:
          catalog.app.coreos.com/displayName: "Chargeback Presto Table"
          catalog.app.coreos.com/description: "A table within PrestoDB"
      spec:
        group: chargeback.coreos.com
        version: v1alpha1
        scope: Namespaced
        names:
          plural: prestotables
          singular: prestotable
          kind: PrestoTable
      
    - apiVersion: apiextensions.k8s.io/v1beta1
      kind: CustomResourceDefinition
      metadata:
        name: reports.chargeback.coreos.com
        annotations:
          catalog.app.coreos.com/displayName: "Chargeback Report"
          catalog.app.coreos.com/description: "A chargeback report for a specific time interval"
      spec:
        group: chargeback.coreos.com
        version: v1alpha1
        scope: Namespaced
        names:
          plural: reports
          kind: Report
      
    - apiVersion: apiextensions.k8s.io/v1beta1
      kind: CustomResourceDefinition
      metadata:
        name: reportdatasources.chargeback.coreos.com
        annotations:
          catalog.app.coreos.com/displayName: "Chargeback data source"
          catalog.app.coreos.com/description: "A resource describing a source of data for usage by Report Generation Queries"
      spec:
        group: chargeback.coreos.com
        version: v1alpha1
        scope: Namespaced
        names:
          plural: reportdatasources
          singular: reportdatasource
          kind: ReportDataSource
      
    - apiVersion: apiextensions.k8s.io/v1beta1
      kind: CustomResourceDefinition
      metadata:
        name: reportgenerationqueries.chargeback.coreos.com
        annotations:
          catalog.app.coreos.com/displayName: "Chargeback generation query"
          catalog.app.coreos.com/description: "A SQL query used by Chargeback to generate reports"
      spec:
        group: chargeback.coreos.com
        version: v1alpha1
        scope: Namespaced
        names:
          plural: reportgenerationqueries
          singular: reportgenerationquery
          kind: ReportGenerationQuery
      
    - apiVersion: apiextensions.k8s.io/v1beta1
      kind: CustomResourceDefinition
      metadata:
        name: reportprometheusqueries.chargeback.coreos.com
        annotations:
          catalog.app.coreos.com/displayName: "Chargeback prometheus query"
          catalog.app.coreos.com/description: "A Prometheus query by Chargeback to do metering"
      spec:
        group: chargeback.coreos.com
        version: v1alpha1
        scope: Namespaced
        names:
          plural: reportprometheusqueries
          singular: reportprometheusquery
          kind: ReportPrometheusQuery
      
    - apiVersion: apiextensions.k8s.io/v1beta1
      kind: CustomResourceDefinition
      metadata:
        name: scheduledreports.chargeback.coreos.com
        annotations:
          catalog.app.coreos.com/displayName: "Chargeback Scheduled Report"
          catalog.app.coreos.com/description: "A chargeback report that runs on a scheduled interval"
      spec:
        group: chargeback.coreos.com
        version: v1alpha1
        scope: Namespaced
        names:
          plural: scheduledreports
          kind: ScheduledReport
      
    - apiVersion: apiextensions.k8s.io/v1beta1
      kind: CustomResourceDefinition
      metadata:
        name: storagelocations.chargeback.coreos.com
        annotations:
          catalog.app.coreos.com/displayName: "Chargeback storage location"
          catalog.app.coreos.com/description: "Represents a configurable storage location for Chargeback to store metering and report data"
      spec:
        group: chargeback.coreos.com
        version: v1alpha1
        scope: Namespaced
        names:
          plural: storagelocations
          kind: StorageLocation
      
  clusterServiceVersions: |-
    - #! validate-crd: deploy/chart/templates/0000_30_02-clusterserviceversion.crd.yaml
      #! parse-kind: ClusterServiceVersion
      apiVersion: app.coreos.com/v1alpha1
      kind: ClusterServiceVersion-v1
      metadata:
        name: chargeback-helm-operator.v0.5.1
        namespace: placeholder
        annotations:
          tectonic-visibility: tectonic-feature
      spec:
        displayName: Chargeback
        description: Chargeback can generate reports based on historical usage data from a cluster, providing accountability for how resources have been used.
        keywords: [chargeback metrics reporting coreos]
        version: 0.5.1
        maturity: alpha
        maintainers:
          - email: support@coreos.com
            name: CoreOS, Inc
        provider:
          name: CoreOS, Inc
        labels:
          alm-owner-chargeback: chargeback-helm-operator
          alm-status-descriptors: chargeback-helm-operator.v0.5.1
        selector:
          matchLabels:
            alm-owner-chargeback: chargeback-helm-operator
        install:
          strategy: deployment
          spec:
            permissions:
              - rules:
                - apiGroups:
                  - chargeback.coreos.com
                  resources:
                  - '*'
                  verbs:
                  - '*'
                - apiGroups:
                  - ""
                  resources:
                  - pods
                  - pods/attach
                  - pods/exec
                  - pods/portforward
                  - pods/proxy
                  verbs:
                  - create
                  - delete
                  - deletecollection
                  - get
                  - list
                  - patch
                  - update
                  - watch
                - apiGroups:
                  - ""
                  resources:
                  - configmaps
                  - endpoints
                  - persistentvolumeclaims
                  - replicationcontrollers
                  - replicationcontrollers/scale
                  - secrets
                  - serviceaccounts
                  - services
                  - services/proxy
                  verbs:
                  - create
                  - delete
                  - deletecollection
                  - get
                  - list
                  - patch
                  - update
                  - watch
                - apiGroups:
                  - ""
                  resources:
                  - bindings
                  - events
                  - limitranges
                  - namespaces/status
                  - pods/log
                  - pods/status
                  - replicationcontrollers/status
                  - resourcequotas
                  - resourcequotas/status
                  verbs:
                  - get
                  - list
                  - watch
                - apiGroups:
                  - ""
                  resources:
                  - namespaces
                  verbs:
                  - get
                  - list
                  - watch
                - apiGroups:
                  - apps
                  resources:
                  - deployments
                  - deployments/rollback
                  - deployments/scale
                  - statefulsets
                  verbs:
                  - create
                  - delete
                  - deletecollection
                  - get
                  - list
                  - patch
                  - update
                  - watch
                - apiGroups:
                  - batch
                  resources:
                  - cronjobs
                  - jobs
                  verbs:
                  - create
                  - delete
                  - deletecollection
                  - get
                  - list
                  - patch
                  - update
                  - watch
                - apiGroups:
                  - extensions
                  resources:
                  - daemonsets
                  - deployments
                  - deployments/rollback
                  - deployments/scale
                  - replicasets
                  - replicasets/scale
                  - replicationcontrollers/scale
                  verbs:
                  - create
                  - delete
                  - deletecollection
                  - get
                  - list
                  - patch
                  - update
                  - watch
                - apiGroups:
                  - rbac.authorization.k8s.io
                  resources:
                  - rolebindings
                  - roles
                  verbs:
                  - create
                  - delete
                  - deletecollection
                  - get
                  - list
                  - patch
                  - update
                  - watch
                serviceAccountName: chargeback-helm-operator
            deployments:
              - name: chargeback-helm-operator
                spec:
                  replicas: 1
                  strategy:
                    type: Recreate
                  selector:
                    matchLabels:
                      app: chargeback-helm-operator
                  template:
                    metadata:
                      labels:
                        app: chargeback-helm-operator
                    spec:
                      containers:
                      - env:
                        - name: HELM_RELEASE_CRD_NAME
                          value: Chargeback
                        - name: HELM_RELEASE_CRD_API_GROUP
                          value: chargeback.coreos.com
                        - name: MY_POD_NAME
                          valueFrom:
                            fieldRef:
                              fieldPath: metadata.name
                        - name: MY_POD_NAMESPACE
                          valueFrom:
                            fieldRef:
                              fieldPath: metadata.namespace
                        - name: HELM_HOST
                          value: 127.0.0.1:44134
                        - name: SET_OWNER_REFERENCE_VALUE
                          value: "true"
                        - name: HELM_WAIT
                          value: "false"
                        - name: HELM_RECONCILE_INTERVAL_SECONDS
                          value: "120"
                        - name: RELEASE_HISTORY_LIMIT
                          value: "3"
                        image: quay.io/coreos/chargeback-helm-operator:0.5.1
                        imagePullPolicy: Always
                        name: chargeback-helm-operator
                        resources:
                          limits:
                            cpu: 50m
                            memory: 25Mi
                          requests:
                            cpu: 50m
                            memory: 25Mi
                      - env:
                        - name: TILLER_NAMESPACE
                          valueFrom:
                            fieldRef:
                              fieldPath: metadata.namespace
                        - name: TILLER_HISTORY_MAX
                          value: "3"
                        image: gcr.io/kubernetes-helm/tiller:v2.6.2
                        imagePullPolicy: Always
                        livenessProbe:
                          failureThreshold: 3
                          httpGet:
                            path: /liveness
                            port: 44135
                            scheme: HTTP
                          initialDelaySeconds: 1
                          periodSeconds: 10
                          successThreshold: 1
                          timeoutSeconds: 1
                        name: tiller
                        readinessProbe:
                          failureThreshold: 3
                          httpGet:
                            path: /readiness
                            port: 44135
                            scheme: HTTP
                          initialDelaySeconds: 1
                          periodSeconds: 10
                          successThreshold: 1
                          timeoutSeconds: 1
                        resources:
                          limits:
                            cpu: 50m
                            memory: 100Mi
                          requests:
                            cpu: 50m
                            memory: 50Mi
                      restartPolicy: Always
                      serviceAccount: chargeback-helm-operator
                      terminationGracePeriodSeconds: 30
        customresourcedefinitions:
          owned:
          - description: An instance of Chargeback
            displayName: Chargeback
            kind: Chargeback
            name: chargebacks.chargeback.coreos.com
            version: v1alpha1
          - description: A table within PrestoDB
            displayName: Chargeback Presto Table
            kind: PrestoTable
            name: prestotables.chargeback.coreos.com
            version: v1alpha1
          - description: A chargeback report for a specific time interval
            displayName: Chargeback Report
            kind: Report
            name: reports.chargeback.coreos.com
            version: v1alpha1
          - description: A resource describing a source of data for usage by Report Generation
              Queries
            displayName: Chargeback data source
            kind: ReportDataSource
            name: reportdatasources.chargeback.coreos.com
            version: v1alpha1
          - description: A SQL query used by Chargeback to generate reports
            displayName: Chargeback generation query
            kind: ReportGenerationQuery
            name: reportgenerationqueries.chargeback.coreos.com
            version: v1alpha1
          - description: A Prometheus query by Chargeback to do metering
            displayName: Chargeback prometheus query
            kind: ReportPrometheusQuery
            name: reportprometheusqueries.chargeback.coreos.com
            version: v1alpha1
          - description: A chargeback report that runs on a scheduled interval
            displayName: Chargeback Scheduled Report
            kind: ScheduledReport
            name: scheduledreports.chargeback.coreos.com
            version: v1alpha1
          - description: Represents a configurable storage location for Chargeback to store
              metering and report data
            displayName: Chargeback storage location
            kind: StorageLocation
            name: storagelocations.chargeback.coreos.com
            version: v1alpha1
      
  packages: |-
    - #! package-manifest: ./deploy/chart/catalog_resources/components/chargeback.v0.5.1.clusterserviceversion.yaml
      packageName: chargeback
      channels:
      - name: alpha
        currentCSV: chargeback-helm-operator.v0.5.1
      

