Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f.service.md network policy example does not block the service #40

Closed
askrht opened this issue May 27, 2019 · 3 comments
Closed

f.service.md network policy example does not block the service #40

askrht opened this issue May 27, 2019 · 3 comments

Comments

@askrht
Copy link
Contributor

askrht commented May 27, 2019

In the exercise for applying a network policy, the command a busybox without the label also return nginx home page.

kubectl run busybox --image=busybox --rm -it --restart=Never -- wget -O- http://nginx:80                       # This should not work but it works fine

kubectl run busybox --image=busybox --rm -it --restart=Never --labels=access=true -- wget -O- http://nginx:80  # This should be fine

I am using the latest minikube in Ubuntu 16.04

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2", GitCommit:"66049e3b21efe110454d67df4fa62b08ea79a19b", GitTreeState:"clean", BuildDate:"2019-05-16T16:23:09Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
@dgkanatsios
Copy link
Owner

dgkanatsios commented May 27, 2019

Are you using a network provider that supports Network Policy on your Minikube cluster? Check here for reference.
I'll update the exercise for clarity

@dgkanatsios
Copy link
Owner

Feel free to re-open if you think issue is unresolved :)

@askrht
Copy link
Contributor Author

askrht commented May 27, 2019

No need. It worked after I followed your hint and added Cilium to my minikube on Ubuntu 16.04. Commands below

minikube stop; minikube delete; rm -rf ~/.minikube # will reset minikube completely
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube && sudo mv minikube /usr/local/bin/
minikube start --network-plugin=cni --memory=4096
kubectl create -f https://raw.githubusercontent.com/cilium/cilium/v1.5/examples/kubernetes/1.14/cilium-minikube.yaml

Added links to official documentation before an exercise. Sending a pull request your way. You can check the final look at my fork https://github.com/askrht/CKAD-exercises

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants