finish the main code

This commit is contained in:
Rainy21
2026-04-28 13:11:31 -04:00
commit 71a9858ddd
14 changed files with 234 additions and 0 deletions
+54
View File
@@ -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