123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- apiVersion: v1
- kind: Namespace
- metadata:
- name: metallb-system
- labels:
- app: metallb
- ---
- apiVersion: v1
- kind: ServiceAccount
- metadata:
- namespace: metallb-system
- name: controller
- labels:
- app: metallb
- ---
- apiVersion: v1
- kind: ServiceAccount
- metadata:
- namespace: metallb-system
- name: speaker
- labels:
- app: metallb
- ---
- apiVersion: rbac.authorization.k8s.io/v1
- kind: ClusterRole
- metadata:
- name: metallb-system:controller
- labels:
- app: metallb
- rules:
- - apiGroups: [""]
- resources: ["services"]
- verbs: ["get", "list", "watch", "update"]
- - apiGroups: [""]
- resources: ["services/status"]
- verbs: ["update"]
- - apiGroups: [""]
- resources: ["events"]
- verbs: ["create", "patch"]
- ---
- apiVersion: rbac.authorization.k8s.io/v1
- kind: ClusterRole
- metadata:
- name: metallb-system:speaker
- labels:
- app: metallb
- rules:
- - apiGroups: [""]
- resources: ["services", "endpoints", "nodes"]
- verbs: ["get", "list", "watch"]
- ---
- apiVersion: rbac.authorization.k8s.io/v1
- kind: Role
- metadata:
- namespace: metallb-system
- name: config-watcher
- labels:
- app: metallb
- rules:
- - apiGroups: [""]
- resources: ["configmaps"]
- verbs: ["get", "list", "watch"]
- - apiGroups: [""]
- resources: ["events"]
- verbs: ["create"]
- ---
- ## Role bindings
- apiVersion: rbac.authorization.k8s.io/v1
- kind: ClusterRoleBinding
- metadata:
- name: metallb-system:controller
- labels:
- app: metallb
- subjects:
- - kind: ServiceAccount
- name: controller
- namespace: metallb-system
- roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: metallb-system:controller
- ---
- apiVersion: rbac.authorization.k8s.io/v1
- kind: ClusterRoleBinding
- metadata:
- name: metallb-system:speaker
- labels:
- app: metallb
- subjects:
- - kind: ServiceAccount
- name: speaker
- namespace: metallb-system
- roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: metallb-system:speaker
- ---
- apiVersion: rbac.authorization.k8s.io/v1
- kind: RoleBinding
- metadata:
- namespace: metallb-system
- name: config-watcher
- labels:
- app: metallb
- subjects:
- - kind: ServiceAccount
- name: controller
- - kind: ServiceAccount
- name: speaker
- roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: Role
- name: config-watcher
- ---
- apiVersion: apps/v1
- kind: DaemonSet
- metadata:
- namespace: metallb-system
- name: speaker
- labels:
- app: metallb
- component: speaker
- spec:
- selector:
- matchLabels:
- app: metallb
- component: speaker
- template:
- metadata:
- labels:
- app: metallb
- component: speaker
- annotations:
- prometheus.io/scrape: "true"
- prometheus.io/port: "7472"
- spec:
- serviceAccountName: speaker
- terminationGracePeriodSeconds: 0
- hostNetwork: true
- containers:
- - name: speaker
- image: metallb/speaker:v0.7.3
- imagePullPolicy: IfNotPresent
- args:
- - --port=7472
- - --config=config
- env:
- - name: METALLB_NODE_NAME
- valueFrom:
- fieldRef:
- fieldPath: spec.nodeName
- ports:
- - name: monitoring
- containerPort: 7472
- resources:
- limits:
- cpu: 100m
- memory: 100Mi
-
- securityContext:
- allowPrivilegeEscalation: false
- readOnlyRootFilesystem: true
- capabilities:
- drop:
- - all
- add:
- - net_raw
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- namespace: metallb-system
- name: controller
- labels:
- app: metallb
- component: controller
- spec:
- revisionHistoryLimit: 3
- selector:
- matchLabels:
- app: metallb
- component: controller
- template:
- metadata:
- labels:
- app: metallb
- component: controller
- annotations:
- prometheus.io/scrape: "true"
- prometheus.io/port: "7472"
- spec:
- serviceAccountName: controller
- terminationGracePeriodSeconds: 0
- securityContext:
- runAsNonRoot: true
- runAsUser: 65534 # nobody
- containers:
- - name: controller
- image: metallb/controller:v0.7.3
- imagePullPolicy: IfNotPresent
- args:
- - --port=7472
- - --config=config
- ports:
- - name: monitoring
- containerPort: 7472
- resources:
- limits:
- cpu: 100m
- memory: 100Mi
-
- securityContext:
- allowPrivilegeEscalation: false
- capabilities:
- drop:
- - all
- readOnlyRootFilesystem: true
- ---
|