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

@ -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