mirror of
https://gitlab.kube.huskypup.net/Scooby/Homelabv4.git
synced 2026-08-21 05:26:49 +00:00
Fix degraded ArgoCD applications
- frigate: Remove duplicate PVCs (Helm manages them), update config size to 15Gi - gitlab: Fix sync-admin-job secretKeyRef schema error, fetch password via kubectl - nextcloud: Remove duplicate PVC, remove invalid pod-level securityContext - rook-ceph: Update cephfs-smb-pvc to 50Gi, remove unsupported dashboard.config - nessus: Add privileged PSS label for NET_ADMIN/NET_RAW capabilities - scylla-manager: Add privileged PSS label for SYS_NICE capability - n8n: Create missing n8n-main-persistence PVC - projects: Add authentik namespace to applications project destinations Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
4b28424719
commit
7640fb895b
@@ -1,29 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: frigate-config
|
|
||||||
namespace: frigate
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: frigate
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
storageClassName: rook-ceph-block
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 500Mi
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: frigate-media
|
|
||||||
namespace: frigate
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: frigate
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
storageClassName: rook-ceph-block
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 500Gi
|
|
||||||
@@ -138,7 +138,7 @@ persistence:
|
|||||||
enabled: true
|
enabled: true
|
||||||
storageClass: rook-ceph-block
|
storageClass: rook-ceph-block
|
||||||
accessMode: ReadWriteOnce
|
accessMode: ReadWriteOnce
|
||||||
size: 500Mi
|
size: 15Gi
|
||||||
media:
|
media:
|
||||||
enabled: true
|
enabled: true
|
||||||
storageClass: rook-ceph-block
|
storageClass: rook-ceph-block
|
||||||
|
|||||||
@@ -26,7 +26,10 @@ spec:
|
|||||||
|
|
||||||
apk add --no-cache postgresql-client curl
|
apk add --no-cache postgresql-client curl
|
||||||
|
|
||||||
echo "🔄 Syncing GitLab admin permissions from Authentik..."
|
echo "Syncing GitLab admin permissions from Authentik..."
|
||||||
|
|
||||||
|
# Fetch Authentik DB password from secret in authentik namespace
|
||||||
|
AUTHENTIK_DB_PASSWORD=$(kubectl get secret pg-authentik-app -n authentik -o jsonpath='{.data.password}' | base64 -d)
|
||||||
|
|
||||||
# Get list of users in "authentik Admins" group
|
# Get list of users in "authentik Admins" group
|
||||||
ADMIN_USERS=$(PGPASSWORD="$AUTHENTIK_DB_PASSWORD" psql -h pg-authentik-rw.authentik.svc.cluster.local -U app -d app -t -c "
|
ADMIN_USERS=$(PGPASSWORD="$AUTHENTIK_DB_PASSWORD" psql -h pg-authentik-rw.authentik.svc.cluster.local -U app -d app -t -c "
|
||||||
@@ -38,16 +41,16 @@ spec:
|
|||||||
" | xargs)
|
" | xargs)
|
||||||
|
|
||||||
if [ -z "$ADMIN_USERS" ]; then
|
if [ -z "$ADMIN_USERS" ]; then
|
||||||
echo "⚠️ No users found in 'authentik Admins' group"
|
echo "No users found in 'authentik Admins' group"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "✓ Found admin users: $ADMIN_USERS"
|
echo "Found admin users: $ADMIN_USERS"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# For each admin user, grant admin access in GitLab
|
# For each admin user, grant admin access in GitLab
|
||||||
for email in $ADMIN_USERS; do
|
for email in $ADMIN_USERS; do
|
||||||
echo "🔐 Checking user: $email"
|
echo "Checking user: $email"
|
||||||
|
|
||||||
# Use GitLab Rails runner to promote user
|
# Use GitLab Rails runner to promote user
|
||||||
kubectl exec -n gitlab deployment/gitlab-toolbox -- \
|
kubectl exec -n gitlab deployment/gitlab-toolbox -- \
|
||||||
@@ -55,26 +58,19 @@ spec:
|
|||||||
user = User.find_by(email: '$email')
|
user = User.find_by(email: '$email')
|
||||||
if user
|
if user
|
||||||
if user.admin?
|
if user.admin?
|
||||||
puts ' ✓ Already admin'
|
puts ' Already admin'
|
||||||
else
|
else
|
||||||
user.update(admin: true)
|
user.update(admin: true)
|
||||||
puts ' ✅ Promoted to admin'
|
puts ' Promoted to admin'
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
puts ' ⚠️ User not found (needs to login via SSO first)'
|
puts ' User not found (needs to login via SSO first)'
|
||||||
end
|
end
|
||||||
" || echo " ❌ Failed to update user"
|
" || echo " Failed to update user"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "✅ Admin sync complete"
|
echo "Admin sync complete"
|
||||||
env:
|
|
||||||
- name: AUTHENTIK_DB_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: pg-authentik-app
|
|
||||||
namespace: authentik
|
|
||||||
key: password
|
|
||||||
serviceAccountName: gitlab-sync-admin
|
serviceAccountName: gitlab-sync-admin
|
||||||
---
|
---
|
||||||
# ServiceAccount for the sync job
|
# ServiceAccount for the sync job
|
||||||
@@ -112,3 +108,30 @@ roleRef:
|
|||||||
kind: Role
|
kind: Role
|
||||||
name: gitlab-sync-admin
|
name: gitlab-sync-admin
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
---
|
||||||
|
# Role to read Authentik DB secret
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: gitlab-sync-admin-reader
|
||||||
|
namespace: authentik
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["secrets"]
|
||||||
|
verbs: ["get"]
|
||||||
|
resourceNames: ["pg-authentik-app"]
|
||||||
|
---
|
||||||
|
# RoleBinding for Authentik secret access
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: gitlab-sync-admin-reader
|
||||||
|
namespace: authentik
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: gitlab-sync-admin
|
||||||
|
namespace: gitlab
|
||||||
|
roleRef:
|
||||||
|
kind: Role
|
||||||
|
name: gitlab-sync-admin-reader
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: n8n-main-persistence
|
||||||
|
namespace: n8n
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: n8n
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: rook-ceph-block
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: nextcloud-nextcloud
|
|
||||||
namespace: nextcloud
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/managed-by: Helm
|
|
||||||
app.kubernetes.io/name: nextcloud
|
|
||||||
app.kubernetes.io/instance: nextcloud
|
|
||||||
annotations:
|
|
||||||
meta.helm.sh/release-name: nextcloud
|
|
||||||
meta.helm.sh/release-namespace: nextcloud
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
storageClassName: rook-ceph-block # Rook-Ceph block storage
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 50Gi # whatever size you want
|
|
||||||
@@ -90,12 +90,6 @@ persistence:
|
|||||||
accessMode: ReadWriteOnce
|
accessMode: ReadWriteOnce
|
||||||
size: 50Gi
|
size: 50Gi
|
||||||
|
|
||||||
securityContext:
|
|
||||||
allowPrivilegeEscalation: false
|
|
||||||
capabilities:
|
|
||||||
drop:
|
|
||||||
- ALL
|
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 50m
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ spec:
|
|||||||
automated:
|
automated:
|
||||||
prune: true
|
prune: true
|
||||||
selfHeal: true
|
selfHeal: true
|
||||||
|
managedNamespaceMetadata:
|
||||||
|
labels:
|
||||||
|
pod-security.kubernetes.io/enforce: privileged
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
- ServerSideApply=true
|
- ServerSideApply=true
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ spec:
|
|||||||
automated:
|
automated:
|
||||||
prune: true
|
prune: true
|
||||||
selfHeal: true
|
selfHeal: true
|
||||||
|
managedNamespaceMetadata:
|
||||||
|
labels:
|
||||||
|
pod-security.kubernetes.io/enforce: privileged
|
||||||
syncOptions:
|
syncOptions:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
- ServerSideApply=true
|
- ServerSideApply=true
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ spec:
|
|||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
- namespace: nessus
|
- namespace: nessus
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
|
- namespace: authentik
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
clusterResourceWhitelist:
|
clusterResourceWhitelist:
|
||||||
- group: '*'
|
- group: '*'
|
||||||
kind: '*'
|
kind: '*'
|
||||||
|
|||||||
@@ -64,13 +64,6 @@ cephClusterSpec:
|
|||||||
enabled: true
|
enabled: true
|
||||||
ssl: false # TLS handled by ingress
|
ssl: false # TLS handled by ingress
|
||||||
port: 7000
|
port: 7000
|
||||||
# Authentication: OAuth2-Proxy via ingress annotations
|
|
||||||
# See: infrastructure/rook-ceph/ingress.yaml
|
|
||||||
# Blueprint: infrastructure/authentik/ceph-dashboard-blueprint.yaml
|
|
||||||
config:
|
|
||||||
mgr/dashboard/standby_behaviour: "error"
|
|
||||||
mgr/dashboard/remote_user_header: "X-Forwarded-User"
|
|
||||||
mgr/dashboard/remote_user_trust_proxy: "true"
|
|
||||||
|
|
||||||
# Network configuration
|
# Network configuration
|
||||||
network:
|
network:
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ spec:
|
|||||||
storageClassName: rook-cephfs
|
storageClassName: rook-cephfs
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 1Gi
|
storage: 50Gi
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
|
|||||||
Reference in New Issue
Block a user