Slide 47
Slide 47 text
TIJGUKTJOGP
%FWFMPQFS'JSTU4FDVSJUZͱ͍͏ߟ͑ํ
(BUFLFFQFS
0QFO1PMJDZ"HFOUΛݩʹͨ͠γεςϜ
package deny_host_network
violation[{"msg": msg, "details": {}}]{
input.review.object.spec.hostNetwork
msg := sprintf("hostNetwork is prohibited", [])
}
apiVersion: v1
kind: Pod
metadata:
name: example
labels:
app: example
spec:
hostNetwork: true
containers:
- name: nginx
image: nginx
ports:
- containerPort: 9001
hostPort: 9001
3FHPͰهड़͞ΕͨϙϦγʔ
ϙϦγʔʹै͏͖,VCFSOFUFT.BOJGFTU
$ kubectl apply ...ࣦഊ͢Δɻ
ະવʹϙϦγʔʹԊΘͳ͍Ϧιʔεͷ
࡞Λ͙͜ͱ͕Ͱ͖Δ😌