The Kubernetes environment has been configured with a network policy of deny all by default.
For ingress into your pod from outside the cluster, you need to change your policy to be this:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: access-apache-web-server
namespace: 80247-tdddev
spec:
podSelector:
matchLabels:
app: 80247-tdddev # apache-web-server pod selector
ingress:
-from:
-namespaceSelector:
matchLabels:
name: ingress-nginx
For the readiness/liveness probes to work, you may need to specify this additional policy. I have not actually tried this… but give it a try
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name:access-apache-web-server-from-kube-system
namespace: 80247-tdddev
spec:
podSelector:
matchLabels:
app: 80247-tdddev # apache-web-server pod selector
ingress:
- from:
-namespaceSelector:
matchLabels:
name: kube-system