mirror of
https://github.com/Rainyy21/k3s-health-dashboard.git
synced 2026-10-11 00:00:20 -04:00
finish the main code
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
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
|
||||
Reference in New Issue
Block a user