Skip to content

Conversation

@YuryHrytsuk
Copy link
Collaborator

@YuryHrytsuk YuryHrytsuk commented Aug 4, 2025

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

  • I tested and it works

@YuryHrytsuk YuryHrytsuk added this to the Voyager milestone Aug 4, 2025
@YuryHrytsuk YuryHrytsuk self-assigned this Aug 4, 2025
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@YuryHrytsuk YuryHrytsuk requested a review from GitHK August 5, 2025 06:20
Copy link
Member

@mrnicegyu11 mrnicegyu11 left a 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

@YuryHrytsuk
Copy link
Collaborator Author

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 projectcalico.org/v3 objects (e.g. network policies).

Until it is installed we cannot continue

@YuryHrytsuk
Copy link
Collaborator Author

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 projectcalico.org/v3 objects (e.g. network policies).

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

@YuryHrytsuk YuryHrytsuk merged commit af61d4a into ITISFoundation:main Aug 6, 2025
3 checks passed
YuryHrytsuk added a commit that referenced this pull request Aug 6, 2025
@YuryHrytsuk YuryHrytsuk deleted the kubernetes-add-deny-all-global-network-policy branch August 6, 2025 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants