apiVersion: v1
kind: ServiceAccount
metadata:
  name: memcached-operator

---

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: memcached-operator
rules:
- apiGroups:
  - ""
  resources:
  - pods
  - services
  - endpoints
  - persistentvolumeclaims
  - events
  - configmaps
  - secrets
  verbs:
  - '*'
- apiGroups:
  - apps
  resources:
  - deployments
  - daemonsets
  - replicasets
  - statefulsets
  verbs:
  - '*'
- apiGroups:
  - cache.example.com
  resources:
  - '*'
  verbs:
  - '*'
- apiGroups:
  - apps
  resources:
  - deployments/finalizers
  resourceNames:
  - memcached-operator
  verbs:
  - "update"

---

kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: memcached-operator
subjects:
- kind: ServiceAccount
  name: memcached-operator
roleRef:
  kind: Role
  name: memcached-operator
  apiGroup: rbac.authorization.k8s.io

---

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  name: memcached-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: memcached-operator
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        name: memcached-operator
    spec:
      containers:
      - command:
        - memcached-operator
        env:
        - name: WATCH_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: OPERATOR_NAME
          value: memcached-operator
        image: quay.io/coreos/operator-sdk-dev:test-framework-operator-runtime
        imagePullPolicy: Always
        name: memcached-operator
        resources: {}
      serviceAccountName: memcached-operator
status: {}
