training
This commit is contained in:
@ -10,4 +10,10 @@ spec:
|
||||
resources: {}
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
runAsNonRoot: true
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
capabilities:
|
||||
drop: ["ALL"]
|
||||
4
training/np/0-namespace.yaml
Normal file
4
training/np/0-namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: isolated
|
||||
11
training/np/1-np.yaml
Normal file
11
training/np/1-np.yaml
Normal 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
14
training/np/2-pod.yaml
Normal 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
|
||||
11
training/np/3-service.yaml
Normal file
11
training/np/3-service.yaml
Normal 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
14
training/rbac/pod.yaml
Normal 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
12
training/rbac/rb.yaml
Normal 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
13
training/rbac/role.yaml
Normal 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
4
training/rbac/sa.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: demo
|
||||
Reference in New Issue
Block a user