-
Notifications
You must be signed in to change notification settings - Fork 6
Kubernetes: add deny all global network policy #1164
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
Kubernetes: add deny all global network policy #1164
Conversation
Changes * Use calico CNI for networking as we use it in master deployments * Move local-reated targets to a seperate Makefile (keep clean main Makefile used in master/stag/prod) * Add delete (local) cluster target
…ll-global-network-policy
…ll-global-network-policy
…-all-global-network-policy
matusdrobuliak66
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
GitHK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
mrnicegyu11
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deep 🛞 k8s stuff, looks good from what I can see. left a few minor comments, but no blockers found
|
This won't work since we don't have Calico API server installed on master deployment (see kubernetes-sigs/kubespray#12445). Calico API server is needed to use Until it is installed we cannot continue |
Unblocked by https://git.speag.com/oSparc/osparc-ops-deployment-configuration/-/merge_requests/1527. Calico API server is installed now |
…-all-global-network-policy
This reverts commit af61d4a.
What do these changes do?
Add global default deny all network policy following https://docs.tigera.io/calico/latest/network-policy/get-started/kubernetes-default-deny.
This means all applications by default will only be able to talk to kube dns server (via port 53).
In order to allow other traffic, a network policy for an application needs to be explicitly specified. As example, we start with portainer and adminer applications. Other existing applications will be added after. All new applications (as long as they use their own namespace) will be restricted by global deny network policy automatically.
Implementation details
Since calico is currently installed via kubespray and has no configuration in helm, we add a separate helm chart to keep calico configuration (in this case global policy only)
Make portainer a custom chart (with dependency from portainer k8s helm chart). This lets us create a network policy for the portainer in the same chart and reuse values. It is very unfortunate that Portainer does not support extra objects, so we have to create a separate chart with dependency.
Important:
FYI @GitHK this is an example of denying network for apps that will solve https://github.com/ITISFoundation/private-issues/issues/45. Also @pcrespov may appreciate these enforced by default security measures
Related issue/s
Related PR/s
Checklist