How to: Deployment
Example Clusterrole:

    ---
    apiVersion: rbac.authorization.k8s.io/v1beta1
    kind: ClusterRole
    metadata:
      name: xing:controller:kubernetes-oom-event-generator
    rules:
      - apiGroups:
          - ""
        resources:
          - pods
          - pods/status
        verbs:
          - get
          - list
          - watch
      - apiGroups:
          - ""
        resources:
          - events
        verbs:
          - create
          - patch
          - list
          - watch

Run this controller on Kubernetes with the following commands:

    kubectl create serviceaccount kubernetes-oom-event-generator \
      --namespace=kube-system

    kubectl create -f path/to/example-clusterrole.yml
    # alternatively run: `cat | kubectl create -f -` and paste the above example, hit Ctrl+D afterwards.

    kubectl create clusterrolebinding xing:controller:kubernetes-oom-event-generator \
      --clusterrole=xing:controller:kubernetes-oom-event-generator \
      --serviceaccount=kube-system:kubernetes-oom-event-generator

    kubectl run kubernetes-oom-event-generator \
      --image=xingse/kubernetes-oom-event-generator \
      --env=VERBOSE=2 \
      --serviceaccount=kubernetes-oom-event-generator \
      --namespace=kube-system