mirror of
https://github.com/Rainyy21/k3s-health-dashboard.git
synced 2026-10-10 22:00:19 -04:00
55 lines
1.1 KiB
YAML
55 lines
1.1 KiB
YAML
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: dashboard-sa
|
|
namespace: default
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: dashboard-reader
|
|
rules:
|
|
- apiGroups: [""]
|
|
resources: ["nodes", "pods", "namespaces", "events"]
|
|
verbs: ["get", "list", "watch"]
|
|
- apiGroups: ["metrics.k8s.io"]
|
|
resources: ["nodes", "pods"]
|
|
verbs: ["get", "list"]
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: dashboard-reader-binding
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: dashboard-sa
|
|
namespace: default
|
|
roleRef:
|
|
kind: ClusterRole
|
|
name: dashboard-reader
|
|
apiGroup: rbac.authorization.k8s.io
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: k3s-dashboard
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: k3s-dashboard
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: k3s-dashboard
|
|
spec:
|
|
serviceAccountName: dashboard-sa
|
|
containers:
|
|
- name: dashboard
|
|
image: your-registry/k3s-dashboard:latest
|
|
env:
|
|
- name: IN_CLUSTER
|
|
value: "true"
|
|
ports:
|
|
- containerPort: 8080
|