#! parse-kind: ClusterServiceVersion
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  name: etcdoperator.v0.9.0
  namespace: placeholder
  annotations:
    tectonic-visibility: ocs
    alm-examples: '[{"apiVersion":"etcd.database.coreos.com/v1beta2","kind":"EtcdCluster","metadata":{"name":"example","namespace":"default"},"spec":{"size":3,"version":"3.2.13"}},{"apiVersion":"etcd.database.coreos.com/v1beta2","kind":"EtcdRestore","metadata":{"name":"example-etcd-cluster"},"spec":{"etcdCluster":{"name":"example-etcd-cluster"},"backupStorageType":"S3","s3":{"path":"<full-s3-path>","awsSecret":"<aws-secret>"}}},{"apiVersion":"etcd.database.coreos.com/v1beta2","kind":"EtcdBackup","metadata":{"name":"example-etcd-cluster-backup"},"spec":{"etcdEndpoints":["<etcd-cluster-endpoints>"],"storageType":"S3","s3":{"path":"<full-s3-path>","awsSecret":"<aws-secret>"}}}]'
spec:
  displayName: etcd
  description: |
    etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines. It’s open-source and available on GitHub. etcd gracefully handles leader elections during network partitions and will tolerate machine failure, including the leader. Your applications can read and write data into etcd.
    A simple use-case is to store database connection details or feature flags within etcd as key value pairs. These values can be watched, allowing your app to reconfigure itself when they change. Advanced uses take advantage of the consistency guarantees to implement database leader elections or do distributed locking across a cluster of workers.

    _The etcd Open Cloud Service is Public Alpha. The goal before Beta is to fully implement backup features._

    ### Reading and writing to etcd

    Communicate with etcd though its command line utility `etcdctl` or with the API using the automatically generated Kubernetes Service.

    [Read the complete guide to using the etcd Open Cloud Service](https://coreos.com/tectonic/docs/latest/alm/etcd-ocs.html)

    ### Supported Features


    **High availability**


    Multiple instances of etcd are networked together and secured. Individual failures or networking issues are transparently handled to keep your cluster up and running.


    **Automated updates**


    Rolling out a new etcd version works like all Kubernetes rolling updates. Simply declare the desired version, and the etcd service starts a safe rolling update to the new version automatically.


    **Backups included**


    Coming soon, the ability to schedule backups to happen on or off cluster.
  keywords: ['etcd', 'key value', 'database', 'coreos', 'open source']
  version: 0.9.0
  maturity: alpha
  maintainers:
  - name: CoreOS, Inc
    email: support@coreos.com

  provider:
    name: CoreOS, Inc
  labels:
    alm-owner-etcd: etcdoperator
    operated-by: etcdoperator
  selector:
    matchLabels:
      alm-owner-etcd: etcdoperator
      operated-by: etcdoperator
  links:
  - name: Blog
    url: https://coreos.com/etcd
  - name: Documentation
    url: https://coreos.com/operators/etcd/docs/latest/
  - name: etcd Operator Source Code
    url: https://github.com/coreos/etcd-operator

  icon:
  - base64data: [encoded data, 5840 characters]
    mediatype: image/png
  install:
    strategy: deployment
    spec:
      permissions:
      - serviceAccountName: etcd-operator
        rules:
        - apiGroups:
          - etcd.database.coreos.com
          resources:
          - etcdclusters
          - etcdbackups
          - etcdrestores
          verbs:
          - "*"
        - apiGroups:
          - ""
          resources:
          - pods
          - services
          - endpoints
          - persistentvolumeclaims
          - events
          verbs:
          - "*"
        - apiGroups:
          - apps
          resources:
          - deployments
          verbs:
          - "*"
        - apiGroups:
          - ""
          resources:
          - secrets
          verbs:
          - get
      deployments:
      - name: etcd-operator
        spec:
          replicas: 1
          selector:
            matchLabels:
              name: etcd-operator-alm-owned
          template:
            metadata:
              name: etcd-operator-alm-owned
              labels:
                name: etcd-operator-alm-owned
            spec:
              serviceAccountName: etcd-operator
              containers:
              - name: etcd-operator
                command:
                - etcd-operator
                - --create-crd=false
                image: quay.io/coreos/etcd-operator@sha256:db563baa8194fcfe39d1df744ed70024b0f1f9e9b55b5923c2f3a413c44dc6b8
                env:
                - name: MY_POD_NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: MY_POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
              - name: etcd-backup-operator
                image: quay.io/coreos/etcd-operator@sha256:db563baa8194fcfe39d1df744ed70024b0f1f9e9b55b5923c2f3a413c44dc6b8
                command:
                - etcd-backup-operator
                - --create-crd=false
                env:
                - name: MY_POD_NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: MY_POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
              - name: etcd-restore-operator
                image: quay.io/coreos/etcd-operator@sha256:db563baa8194fcfe39d1df744ed70024b0f1f9e9b55b5923c2f3a413c44dc6b8
                command:
                - etcd-restore-operator
                - --create-crd=false
                env:
                - name: MY_POD_NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: MY_POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
  customresourcedefinitions:
    owned:
    - name: etcdclusters.etcd.database.coreos.com
      version: v1beta2
      kind: EtcdCluster
      displayName: etcd Cluster
      description: Represents a cluster of etcd nodes.
      resources:
        - kind: Service
          version: v1
        - kind: Pod
          version: v1
      specDescriptors:
        - description: The desired number of member Pods for the etcd cluster.
          displayName: Size
          path: size
          x-descriptors:
            - 'urn:alm:descriptor:com.tectonic.ui:podCount'
        - description: Limits describes the minimum/maximum amount of compute resources required/allowed
          displayName: Resource Requirements
          path: pod.resources
          x-descriptors:
            - 'urn:alm:descriptor:com.tectonic.ui:resourceRequirements'
      statusDescriptors:
        - description: The status of each of the member Pods for the etcd cluster.
          displayName: Member Status
          path: members
          x-descriptors:
            - 'urn:alm:descriptor:com.tectonic.ui:podStatuses'
        - description: The service at which the running etcd cluster can be accessed.
          displayName: Service
          path: serviceName
          x-descriptors:
            - 'urn:alm:descriptor:io.kubernetes:Service'
        - description: The current size of the etcd cluster.
          displayName: Cluster Size
          path: size
        - description: The current version of the etcd cluster.
          displayName: Current Version
          path: currentVersion
        - description: 'The target version of the etcd cluster, after upgrading.'
          displayName: Target Version
          path: targetVersion
        - description: The current status of the etcd cluster.
          displayName: Status
          path: phase
          x-descriptors:
            - 'urn:alm:descriptor:io.kubernetes.phase'
        - description: Explanation for the current status of the cluster.
          displayName: Status Details
          path: reason
          x-descriptors:
            - 'urn:alm:descriptor:io.kubernetes.phase:reason'
    - name: etcdbackups.etcd.database.coreos.com
      version: v1beta2
      kind: EtcdBackup
      displayName: etcd Backup
      description: Represents the intent to backup an etcd cluster.
      specDescriptors:
        - description: Specifies the endpoints of an etcd cluster.
          displayName: etcd Endpoint(s)
          path: etcdEndpoints
          x-descriptors:
            - 'urn:alm:descriptor:etcd:endpoint'
        - description: The full AWS S3 path where the backup is saved.
          displayName: S3 Path
          path: s3.path
          x-descriptors:
            - 'urn:alm:descriptor:aws:s3:path'
        - description: The name of the secret object that stores the AWS credential and config files.
          displayName: AWS Secret
          path: s3.awsSecret
          x-descriptors:
            - 'urn:alm:descriptor:io.kubernetes:Secret'
      statusDescriptors:
        - description: Indicates if the backup was successful.
          displayName: Succeeded
          path: succeeded
          x-descriptors:
            - 'urn:alm:descriptor:text'
        - description: Indicates the reason for any backup related failures.
          displayName: Reason
          path: reason
          x-descriptors:
            - 'urn:alm:descriptor:io.kubernetes.phase:reason'
    - name: etcdrestores.etcd.database.coreos.com
      version: v1beta2
      kind: EtcdRestore
      displayName: etcd Restore
      description: Represents the intent to restore an etcd cluster from a backup.
      specDescriptors:
        - description: References the EtcdCluster which should be restored,
          displayName: etcd Cluster
          path: etcdCluster.name
          x-descriptors:
            - 'urn:alm:descriptor:io.kubernetes:EtcdCluster'
            - 'urn:alm:descriptor:text'
        - description: The full AWS S3 path where the backup is saved.
          displayName: S3 Path
          path: s3.path
          x-descriptors:
            - 'urn:alm:descriptor:aws:s3:path'
        - description: The name of the secret object that stores the AWS credential and config files.
          displayName: AWS Secret
          path: s3.awsSecret
          x-descriptors:
            - 'urn:alm:descriptor:io.kubernetes:Secret'
      statusDescriptors:
        - description: Indicates if the restore was successful.
          displayName: Succeeded
          path: succeeded
          x-descriptors:
            - 'urn:alm:descriptor:text'
        - description: Indicates the reason for any restore related failures.
          displayName: Reason
          path: reason
          x-descriptors:
            - 'urn:alm:descriptor:io.kubernetes.phase:reason'
