---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: submariner-lighthouse
  namespace: submariner-operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  creationTimestamp: null
  name: submariner:lighthouse
  namespace: submariner-operator
rules:
  - apiGroups:
      - ""
    resources:
      - services
      - namespaces
    verbs:
      - get
      - list
      - watch
      - update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: submariner:lighthouse
  namespace: submariner-operator
subjects:
  - kind: ServiceAccount
    name: submariner-lighthouse
    namespace: submariner-operator
roleRef:
  kind: ClusterRole
  name: submariner:lighthouse
  apiGroup: rbac.authorization.k8s.io

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: lighthouse-agent
  namespace: submariner-operator
  labels:
    app: lighthouse-agent
spec:
  selector:
    matchLabels:
      app: lighthouse-agent
  template:
    metadata:
      labels:
        app: lighthouse-agent
    spec:
      containers:
        - name: lighthouse-agent
          image: lighthouse-agent:local
      serviceAccount: submariner:lighthouse
      serviceAccountName: submariner-lighthouse
