---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: system:metrics-reader
rules:
- apiGroups:
  - "metrics.k8s.io"
  resources:
  - pods
  verbs:
  - get
  - list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: system:vpa-actor
rules:
- apiGroups:
  - ""
  resources:
  - pods
  - nodes
  - limitranges
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - get
  - list
  - watch
  - create
- apiGroups:
  - "poc.autoscaling.k8s.io"
  resources:
  - verticalpodautoscalers
  verbs:
  - get
  - list
  - watch
  - patch
- apiGroups:
  - "autoscaling.k8s.io"
  resources:
  - verticalpodautoscalers
  verbs:
  - get
  - list
  - watch
  - patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: system:vpa-checkpoint-actor
rules:
- apiGroups:
  - "poc.autoscaling.k8s.io"
  resources:
  - verticalpodautoscalercheckpoints
  verbs:
  - get
  - list
  - watch
  - create
  - patch
  - delete
- apiGroups:
  - "autoscaling.k8s.io"
  resources:
  - verticalpodautoscalercheckpoints
  verbs:
  - get
  - list
  - watch
  - create
  - patch
  - delete
- apiGroups:
  - ""
  resources:
  - namespaces
  verbs:
  - get
  - list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: system:evictioner
rules:
- apiGroups:
  - "apps"
  - "extensions"
  resources:
  - replicasets
  verbs:
  - get
- apiGroups:
  - ""
  resources:
  - pods/eviction
  verbs:
  - create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:metrics-reader
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:metrics-reader
subjects:
- kind: ServiceAccount
  name: vpa-recommender
  namespace: openshift-vertical-pod-autoscaler
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:vpa-actor
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:vpa-actor
subjects:
- kind: ServiceAccount
  name: vpa-recommender
  namespace: openshift-vertical-pod-autoscaler
- kind: ServiceAccount
  name: vpa-updater
  namespace: openshift-vertical-pod-autoscaler
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:vpa-checkpoint-actor
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:vpa-checkpoint-actor
subjects:
- kind: ServiceAccount
  name: vpa-recommender
  namespace: openshift-vertical-pod-autoscaler
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: system:vpa-target-reader
rules:
- apiGroups:
  - ""
  resources:
  - replicationcontrollers
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - apps
  resources:
  - daemonsets
  - deployments
  - replicasets
  - statefulsets
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - batch
  resources:
  - jobs
  - cronjobs
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - apps.openshift.io
  resources:
  - deploymentconfigs
  - deploymentconfigs/scale
  verbs:
  - get
  - list
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:vpa-target-reader-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:vpa-target-reader
subjects:
- kind: ServiceAccount
  name: vpa-recommender
  namespace: openshift-vertical-pod-autoscaler
- kind: ServiceAccount
  name: vpa-admission-controller
  namespace: openshift-vertical-pod-autoscaler
- kind: ServiceAccount
  name: vpa-updater
  namespace: openshift-vertical-pod-autoscaler
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:vpa-evictioner-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:evictioner
subjects:
- kind: ServiceAccount
  name: vpa-updater
  namespace: openshift-vertical-pod-autoscaler
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: vpa-updater
  namespace: openshift-vertical-pod-autoscaler
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: vpa-recommender
  namespace: openshift-vertical-pod-autoscaler
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: vpa-admission-controller
  namespace: openshift-vertical-pod-autoscaler
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: system:vpa-admission-controller
rules:
- apiGroups:
  - ""
  resources:
  - pods
  - configmaps
  - nodes
  - limitranges
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - "admissionregistration.k8s.io"
  resources:
  - mutatingwebhookconfigurations
  verbs:
  - create
  - delete
  - get
  - list
- apiGroups:
  - "poc.autoscaling.k8s.io"
  resources:
  - verticalpodautoscalers
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - "autoscaling.k8s.io"
  resources:
  - verticalpodautoscalers
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - "coordination.k8s.io"
  resources:
  - leases
  verbs:
  - create
  - update
  - get
  - list
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:vpa-admission-controller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:vpa-admission-controller
subjects:
- kind: ServiceAccount
  name: vpa-admission-controller
  namespace: openshift-vertical-pod-autoscaler
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: system:vpa-status-reader
rules:
- apiGroups:
  - "coordination.k8s.io"
  resources:
  - leases
  verbs:
  - get
  - list
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:vpa-status-reader-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:vpa-status-reader
subjects:
- kind: ServiceAccount
  name: vpa-updater
  namespace: openshift-vertical-pod-autoscaler

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: vertical-pod-autoscaler-operator
rules:
- apiGroups:
  - ""
  resources:
  - services
  verbs:
  - create
  - get
  - update
  - list
  - watch
- apiGroups:
  - autoscaling.openshift.io
  resources:
  - "*"
  verbs:
  - "*"
- apiGroups:
  - config.openshift.io
  resources:
  - verticalpodoperatorcontrollers
  - verticalpodoperatorcontrollers/status
  verbs:
  - create
  - get
  - update

---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: vertical-pod-autoscaler-operator
  namespace: openshift-vertical-pod-autoscaler
rules:
- apiGroups:
  - autoscaling.openshift.io
  resources:
  - "*"
  verbs:
  - "*"
- apiGroups:
  - apps
  resources:
  - deployments
  - daemonsets
  - replicasets
  - statefulsets
  verbs:
  - "*"
- apiGroups:
  - ""
  resources:
  - pods
  - events
  - configmaps
  - secrets
  verbs:
  - "*"

---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: vertical-pod-autoscaler-operator
  namespace: openshift-vertical-pod-autoscaler
subjects:
- kind: ServiceAccount
  name: vertical-pod-autoscaler-operator
  namespace: openshift-vertical-pod-autoscaler
roleRef:
  kind: Role
  name: vertical-pod-autoscaler-operator
  apiGroup: rbac.authorization.k8s.io

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: vertical-pod-autoscaler-operator
subjects:
- kind: ServiceAccount
  name: vertical-pod-autoscaler-operator
  namespace: openshift-vertical-pod-autoscaler
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: vertical-pod-autoscaler-operator

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: vertical-pod-autoscaler-operator
  namespace: openshift-vertical-pod-autoscaler
