This commit is contained in:
thomas
2026-09-03 13:41:35 +00:00
parent 24b9717db2
commit f929a46d2b
9 changed files with 90 additions and 1 deletions

View File

@ -10,4 +10,10 @@ spec:
resources: {} resources: {}
ports: ports:
- containerPort: 3000 - containerPort: 3000
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
capabilities:
drop: ["ALL"]

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: isolated

11
training/np/1-np.yaml Normal file
View File

@ -0,0 +1,11 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: all-deny
namespace: isolated
spec:
podSelector:
matchLabels:
app: http
policyTypes:
- Egress

14
training/np/2-pod.yaml Normal file
View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: Pod
metadata:
name: web
namespace: isolated
labels:
app: http
spec:
containers:
- name: myapp
image: nginx
resources: {}
ports:
- containerPort: 80

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: web
namespace: isolated
spec:
selector:
app: http
ports:
- port: 80
targetPort: 80

14
training/rbac/pod.yaml Normal file
View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: Pod
metadata:
labels:
run: shell
name: shell
spec:
serviceAccount: demo
containers:
- image: ghcr.io/trion-development/kubectl:1
name: shell
tty: true
resources: {}

12
training/rbac/rb.yaml Normal file
View File

@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: pod-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: pod-reader
subjects:
- kind: ServiceAccount
name: demo
namespace: default

13
training/rbac/role.yaml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pod-reader
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch

4
training/rbac/sa.yaml Normal file
View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: demo