Hi,
lab “Opa in Kubernetes” (link has some issues.
First questions seems not to be related to something explained in the lessons, and then there’s an issue in step 6: the pod created with /root/test.yaml file should have some issues with nginx container that uses image nginx instead of hooli.com /nginx but if you create the pod nginx container is loaded (which shouldn’t, as confirmed by provided solution) and hooli.com /mysql container fails to load due to TLS certificate validation issue since the certificate is not for hooli.com but it has CN=origin.wme-microsites.com:
Normal Scheduled 9s default-scheduler Successfully assigned opa/test to controlplane
Normal Pulling 8s kubelet Pulling image "nginx"
Normal Pulled 5s kubelet Successfully pulled image "nginx" in 3.246s (3.246s including waiting). Image size: 72955450 bytes.
Normal Created 5s kubelet Created container nginx-frontend
Normal Started 5s kubelet Started container nginx-frontend
Normal Pulling 5s kubelet Pulling image "hooli.com/mysql"
Warning Failed 5s kubelet Failed to pull image "hooli.com/mysql": failed to pull and unpack image "hooli.com/mysql:latest": failed to resolve reference "hooli.com/mysql:latest": failed to do request: Head "https://hooli.com/v2/mysql/manifests/latest": tls: failed to verify certificate: x509: certificate is valid for origin.wme-microsites.com, *.origin.wme-microsites.com, not hooli.com
Warning Failed 5s kubelet Error: ErrImagePull
Normal BackOff 4s (x2 over 5s) kubelet Back-off pulling image "hooli.com/mysql"
Warning Failed 4s (x2 over 5s) kubelet Error: ImagePullBackOff
So, to recap, OPA policy seems not to be in place since it does not require you to use hooli.com as repository and then hooly.com does not have a valid certificate.
BTW, do we miss some contents since the first questions of this lab seem to ask about stuff not explained in the Opa in Kubernetes lesson?