Add RBAC for backend to manage pods + update backend
- Create ServiceAccount backend-sa - Create ClusterRole for pod management - Bind role to ServiceAccount - Update deployment to use ServiceAccount - Update backend submodule with TLS fix Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: backend
|
app: backend
|
||||||
spec:
|
spec:
|
||||||
|
serviceAccountName: backend-sa
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: gitea-registry
|
- name: gitea-registry
|
||||||
containers:
|
containers:
|
||||||
|
|||||||
30
k8s/backend/rbac.yaml
Normal file
30
k8s/backend/rbac.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: backend-sa
|
||||||
|
namespace: control-plane
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: backend-pod-manager
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["pods"]
|
||||||
|
verbs: ["get", "list", "watch", "create", "delete"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["pods/log"]
|
||||||
|
verbs: ["get"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: backend-pod-manager-binding
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: backend-pod-manager
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: backend-sa
|
||||||
|
namespace: control-plane
|
||||||
Reference in New Issue
Block a user