This commit is contained in:
sandervanvugt 2022-11-30 10:52:54 -08:00
parent 5114697963
commit 50a8876e65
4 changed files with 42 additions and 2 deletions

29
nwp-lab9-1.yaml Normal file
View File

@ -0,0 +1,29 @@
---
apiVersion: v1
kind: Pod
metadata:
name: nwp-nginx
namespace: default
labels:
app: nwp-nginx
spec:
containers:
- name: nwp-nginx
image: nginx:1.17
...
---
apiVersion: v1
kind: Pod
metadata:
name: nwp-busybox
namespace: nwp-namespace
labels:
app: sleepy
spec:
containers:
- name: nwp-busybox
image: busybox
command:
- sleep
- "3600"

11
nwp-lab9-2.yaml Normal file
View File

@ -0,0 +1,11 @@
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
namespace: default
name: deny-from-other-namespaces
spec:
podSelector:
matchLabels:
ingress:
- from:
- podSelector: {}

View File

@ -11,6 +11,6 @@ spec:
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
tolerations: tolerations:
- key: "storage" - key: "storage"
operator: "Equals" operator: "Equal"
value: "ssd" value: "ssd"
effect: "NoSchedule" effect: "NoSchedule"

View File

@ -11,6 +11,6 @@ spec:
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
tolerations: tolerations:
- key: "storage" - key: "storage"
operator: "Equals" operator: "Equal"
value: "hdd" value: "hdd"
effect: "NoSchedule" effect: "NoSchedule"