This commit is contained in:
Thomas Kruse
2026-09-02 22:11:05 +02:00
commit 24b9717db2
49 changed files with 818 additions and 0 deletions

8
pod-sec/0-ns.yaml Normal file
View File

@ -0,0 +1,8 @@
apiVersion: v1
kind: Namespace
metadata:
name: restricted
labels:
pod-security.kubernetes.io/enforce: baseline
pod-security.kubernetes.io/audit: privileged
pod-security.kubernetes.io/warn: restricted

42
pod-sec/1-pod.yaml Normal file
View File

@ -0,0 +1,42 @@
apiVersion: v1
kind: Pod
metadata:
name: safe
namespace: restricted
spec:
volumes:
- name: data
emptyDir: {}
initContainers:
- name: init
image: alpine:3
volumeMounts:
- name: data
mountPath: /data
args:
- /bin/sh
- -c
- mkdir /data/nginx; chown -R 1000 /data
containers:
- name: app
image: nginx
resources: {}
ports:
- containerPort: 80
volumeMounts:
- name: data
mountPath: /var/cache
- name: data
mountPath: /run
securityContext:
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
add:
- BIND_SERVICE

13
pod-sec/101-pod.yaml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Pod
metadata:
name: demo
namespace: restricted
spec:
containers:
- name: demo
image: ghcr.io/trion-development/echoserver:1
resources: {}
ports:
- containerPort: 3000

2
pod-sec/commands Normal file
View File

@ -0,0 +1,2 @@
kubectl run --dry-run=client -o yaml --image ghcr.io/trion-development/echoserver:1 echo