---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: governance-policy-propagator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: governance-policy-propagator
  template:
    metadata:
      labels:
        name: governance-policy-propagator
    spec:
      serviceAccountName: governance-policy-propagator
      containers:
        - name: governance-policy-propagator
          image: quay.io/open-cluster-management/governance-policy-propagator:latest
          command:
            - governance-policy-propagator
          args:
            - "--health-probe-bind-address=:8081"
            - "--metrics-bind-address=:8383"
            - "--leader-elect"
          ports:
            - containerPort: 8383
              protocol: TCP
              name: http
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "governance-policy-propagator"
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: governance-policy-propagator-global
subjects:
- kind: ServiceAccount
  name: governance-policy-propagator
  namespace: open-cluster-management
roleRef:
  kind: ClusterRole
  name: governance-policy-propagator
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: governance-policy-propagator-leader-election-rolebinding
subjects:
- kind: ServiceAccount
  name: governance-policy-propagator
  namespace: open-cluster-management
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: governance-policy-propagator-leader-election-role
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: governance-policy-propagator
  namespace: open-cluster-management
