fix: add request_upgrades.py to image, add web dashboard
- Dockerfile: add COPY for request_upgrades.py (was missing — root cause of Monday upgrade CronJob failing with 'No such file'), add git (needed for repo cloning in upgrade workflow), copy web.py + templates/ - requirements.txt: add fastapi, uvicorn, jinja2 for web dashboard - web.py: FastAPI dashboard with image inventory and upgrade trigger pages - templates/: base layout, images page (namespace→app→container grouped with live version status), upgrade page (outdated list + trigger button + job history) - kubernetes/web-deployment.yaml: Deployment + LoadBalancer at 192.168.87.13 - kubernetes/rbac.yaml: add version-tracker-web ServiceAccount, ClusterRole (read pods/deployments/replicasets/statefulsets/daemonsets/jobs/cronjobs), and namespace Role to create upgrade Jobs - kubernetes/upgrade-cronjob.yaml: fix YAML indentation bug on GITEA_USERNAME and GITEA_COMMITTER_NAME env vars
This commit is contained in:
+91
-1
@@ -1,4 +1,5 @@
|
||||
---
|
||||
# ── version-tracker: read-only pod/namespace lister (weekly report) ──────────
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
@@ -6,7 +7,6 @@ metadata:
|
||||
namespace: k8s-version-tracker
|
||||
|
||||
---
|
||||
# Cluster-wide read access to list pods in all namespaces
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
@@ -29,3 +29,93 @@ subjects:
|
||||
- kind: ServiceAccount
|
||||
name: version-tracker
|
||||
namespace: k8s-version-tracker
|
||||
|
||||
---
|
||||
# ── upgrade-requester: read-only pod lister (upgrades go through GitOps/ArgoCD) ─
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: upgrade-requester
|
||||
namespace: k8s-version-tracker
|
||||
|
||||
---
|
||||
# Reuse the same read-only ClusterRole — no direct workload patching needed.
|
||||
# Image updates are committed to argocd-gitops and ArgoCD syncs automatically.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: upgrade-requester
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: version-tracker-reader
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: upgrade-requester
|
||||
namespace: k8s-version-tracker
|
||||
|
||||
---
|
||||
# ── version-tracker-web: dashboard service account ───────────────────────────
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: version-tracker-web
|
||||
namespace: k8s-version-tracker
|
||||
|
||||
---
|
||||
# Cluster-wide read access: pods, namespaces, and workload owners (to map pods → apps)
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: version-tracker-web-reader
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods", "namespaces"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["apps"]
|
||||
resources: ["deployments", "replicasets", "statefulsets", "daemonsets"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["batch"]
|
||||
resources: ["jobs", "cronjobs"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: version-tracker-web-reader
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: version-tracker-web-reader
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: version-tracker-web
|
||||
namespace: k8s-version-tracker
|
||||
|
||||
---
|
||||
# Namespace-scoped: create upgrade Jobs in this namespace only
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: upgrade-trigger
|
||||
namespace: k8s-version-tracker
|
||||
rules:
|
||||
- apiGroups: ["batch"]
|
||||
resources: ["jobs"]
|
||||
verbs: ["create", "get", "list", "watch"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: upgrade-trigger
|
||||
namespace: k8s-version-tracker
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: upgrade-trigger
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: version-tracker-web
|
||||
namespace: k8s-version-tracker
|
||||
|
||||
Reference in New Issue
Block a user