We'll create an alpine-based Pod that we'll use to demonstrate communication between Namespaces.
kubectl config use-context minikube kubectl run test --image=alpine \ --restart=Never sleep 10000
We switched to the minikube context (default Namespace) and created a Pod with a container based on the alpine image. We let it sleep for a long time. Otherwise, the container would be without a process and would stop almost immediately.
Before we proceed, we should confirm that the Pod is indeed running.
kubectl get pod test
The output is as follows:
NAME READY STATUS RESTARTS AGE test 1/1 Running 0 10m
Please wait a few moments if, in your case, the Pod is not yet ready.
Before we proceed, we'll install curl inside the container in the test Pod.
kubectl exec -it test \ -- apk add -U curl
We already explored...