6 changed files with 161 additions and 5 deletions

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ spec:
name: cluster-fun (v2) name: cluster-fun (v2)
source: source:
repoURL: 'https://stakater.github.io/stakater-charts' repoURL: 'https://stakater.github.io/stakater-charts'
targetRevision: 2.2.18 targetRevision: v0.0.129
chart: reloader chart: reloader
syncPolicy: syncPolicy:
automated: {} automated: {}
+25
View File
@@ -0,0 +1,25 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: sre-agent
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: cluster.fun
destination:
namespace: default
name: cluster-fun (v2)
source:
path: manifests/sre-agent
repoURL: "https://git.cluster.fun/AverageMarcus/cluster.fun.git"
targetRevision: HEAD
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
ignoreDifferences:
- kind: Secret
jsonPointers:
- /data
+1 -1
View File
@@ -217,7 +217,7 @@ spec:
serviceAccountName: prometheus-server serviceAccountName: prometheus-server
containers: containers:
- name: vmagent - name: vmagent
image: "victoriametrics/vmagent:v1.154.1@sha256:970ba603235839655e03501311c683d2269b882f7bcf0ac98892ae422603cb61" image: "victoriametrics/vmagent:v1.155.0@sha256:8e3c03905be15bba8312d4868e8ae6f9fc2fefee0a41d544472034249ca42bb4"
imagePullPolicy: "IfNotPresent" imagePullPolicy: "IfNotPresent"
args: args:
- -remoteWrite.url=http://vmcluster.auth-proxy.svc/insert/0/prometheus/ - -remoteWrite.url=http://vmcluster.auth-proxy.svc/insert/0/prometheus/
+2 -2
View File
@@ -206,7 +206,7 @@ spec:
priorityClassName: critical priorityClassName: critical
containers: containers:
- name: nextcloud - name: nextcloud
image: "nextcloud:35.0.2-apache@sha256:89af7ee7a96ff5e9668280566209268ae6b2d02327f6ef6d56f6d68228cf9431" image: "nextcloud:35.0.2-apache@sha256:0347adaf2fa460aa9589f8c2b1ed246788d11a72ad9918d55ca288f3137fe5ca"
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
env: env:
- name: SQLITE_DATABASE - name: SQLITE_DATABASE
@@ -340,7 +340,7 @@ spec:
mountPath: /var/www/html/config/smtp.config.php mountPath: /var/www/html/config/smtp.config.php
subPath: smtp.config.php subPath: smtp.config.php
- name: cron - name: cron
image: "nextcloud:35.0.2-apache@sha256:89af7ee7a96ff5e9668280566209268ae6b2d02327f6ef6d56f6d68228cf9431" image: "nextcloud:35.0.2-apache@sha256:0347adaf2fa460aa9589f8c2b1ed246788d11a72ad9918d55ca288f3137fe5ca"
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: command:
- /cron.sh - /cron.sh
+131
View File
@@ -0,0 +1,131 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: sre-agent
namespace: default
---
apiVersion: v1
kind: Secret
metadata:
name: sre-agent
namespace: default
annotations:
kubernetes.io/service-account.name: sre-agent
type: kubernetes.io/service-account-token
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: sre-agent
labels:
app.kubernetes.io/name: sre-agent
rules:
# Node-level diagnostics
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["nodes/proxy", "nodes/metrics", "nodes/stats"]
verbs: ["get", "list"]
# Pod diagnostics
- apiGroups: [""]
resources: ["pods", "pods/log", "pods/status", "pods/ephemeralcontainers"]
verbs: ["get", "list", "watch"]
# Services, endpoints, networking
- apiGroups: [""]
resources: ["services", "endpoints", "endpointslices", "namespaces"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims", "persistentvolumes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["configmaps", "secrets"]
verbs: ["get", "list"] # readable only, no modify/delete
- apiGroups: [""]
resources: ["resourcequotas", "limitranges"]
verbs: ["get", "list"]
# Network policies
- apiGroups: ["networking.k8s.io"]
resources: ["*"]
verbs: ["get", "list", "watch"]
- apiGroups: ["discovery.k8s.io"]
resources: ["*"]
verbs: ["get", "list", "watch"]
# Workloads
- apiGroups: ["apps"]
resources: ["*"]
verbs: ["get", "list", "watch"]
- apiGroups: ["apps"]
resources: ["deployments/scale", "replicasets/scale"]
verbs: ["get"]
# Jobs & cronjobs
- apiGroups: ["batch"]
resources: ["*"]
verbs: ["get", "list", "watch"]
- apiGroups: ["batch"]
resources: ["jobs/log"]
verbs: ["get", "list"]
# Autoscaling
- apiGroups: ["autoscaling"]
resources: ["*"]
verbs: ["get", "list", "watch"]
# RBAC visibility (diagnose who owns what)
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["*"]
verbs: ["get", "list", "watch"]
# Custom Resource Definitions (so we can inspect custom resources)
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get", "list", "watch"]
# Priority classes
- apiGroups: ["scheduling.k8s.io"]
resources: ["priorityclasses"]
verbs: ["get", "list"]
# Certificate rotation
- apiGroups: ["certificates.k8s.io"]
resources: ["certificatesigningrequests", "certificatesigningrequests/approval"]
verbs: ["get", "list", "watch"]
# Metrics Server (if installed)
- apiGroups: ["metrics.k8s.io"]
resources: ["*"]
verbs: ["get", "list"]
# Admission controllers / pod security (diagnostic)
- apiGroups: ["policy"]
resources: ["*"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: sre-agent-binding
labels:
app.kubernetes.io/name: sre-agent
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: sre-agent
subjects:
- kind: ServiceAccount
name: sre-agent
namespace: default
+1 -1
View File
@@ -58,7 +58,7 @@ spec:
spec: spec:
containers: containers:
- name: trek - name: trek
image: mauriceboe/trek:4.3.4@sha256:6b7c8f275cc0ff3ca44979084bf078f553c96a0564493a132c1631ffaf6c3e77 image: mauriceboe/trek:5.0.1@sha256:6f590b97c09158e92e9bc7d914ea1af207077735f07f7b622b1f6fb690442bc3
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
envFrom: envFrom:
- configMapRef: - configMapRef: