FYI. The issue persists:
student-node ~ ➜ k get -n kube-system ds weave-net -o yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
…
name: weave-net
namespace: kube-system
spec:
…
spec:
containers:
- command:
- /home/weave/launch.sh
env:
- name: HOSTNAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: IPALLOC_RANGE
value: 10.50.0.0/16
- name: INIT_CONTAINER
value: “true”
image: docker.io/weaveworks/weave-kube:2.8.1
name: weave
The issue is present only when the Weave IP is not the same as the kube proxy one.
k get cm -n kube-system kube-proxy -o jsonpath={'.data.config\.conf}' | yq e .clusterCIDR -
It doesn’t matter what the value is, they just need to be the same for it to be working.
This is a lot better explanation than the one in the solution.
Ultimate CKA Mock Lab 3 - Question 19
The solution’s language makes it seem like you change the pod selector under spec and doesn’t mention the idea that you do not want the - in the pod selector under ingress > from.
I need to wrap my head around network policies a bit more. I went through the course but I missed the additive nature of the above.
Recommend updating the lab solution to this one:
# Cluster 1, NetPol, cyan-pod-cka28-trb
For this question, please set the context to cluster1 by running:
```
kubectl config use-context cluster1
```
One of the nginx based pod called `cyan-pod-cka28-trb` is running under `cyan-ns-cka28-trb` namespace and it is exposed within the cluster using `cyan-svc-cka28-trb` service.
This is a restricted pod so a network policy called `cyan-np-cka28-trb` has been created in the same namespace to apply some restrictions on this pod.
Two other pods called `cyan-white-cka28-trb1` and `cyan-black-cka28-trb` are also running in the default namespace.
The nginx based app running on the `cyan-pod-cka28-trb` pod is exposed internally on the default nginx port (80).
**Expectation**: This app should only be accessible from the `cyan-white-cka28-trb` pod.
**Problem**: This app is not accessible from anywhere.
This file has been truncated. show original