projectcapsule / projectcapsule/website

Invalid example of tenant isolation with CiliumNetworkPolicy

Open Beginner friendly
#73 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
2
Forks
21
Avg merge
22h 24m
Merged PRs (30d)
12

Description

The example cilium network policy for cilium is invalid.


❌ this matches labels on pods, not labels on namespaces

- fromEndpoints:
   - matchLabels:
      capsule.clastix.io/tenant: "{{tenant.name}}"  # Pods in other namespaces with same tenant

❌ fromNamespaces/toNamespaces is not available in CNP

- fromNamespaces:
   - matchLabels:
      company.com/system: "true"  # System namespaces (monitoring, ingress, etc.)
...
- toNamespaces:
   - matchLabels:
     capsule.clastix.io/tenant: "{{tenant.name}}"  # Egress to all tenant namespaces

corrected version:

apiVersion: capsule.clastix.io/v1beta2
kind: GlobalTenantResource
metadata:
  name: default-networkpolicies
  namespace: solar-system
spec:
  resyncPeriod: 60s
  resources:
    - rawItems:
        - apiVersion: cilium.io/v2
          kind: CiliumNetworkPolicy
          metadata:
            name: default-policy
          spec:
            endpointSelector: {}  # Apply to all pods in the namespace
            ingress:
              - fromEndpoints:
                  - matchLabels: {}  # Same namespace pods (intra-namespace)
              - fromEntities:
                  - cluster  # For completeness; can be used to allow internal cluster traffic if needed
              - fromEndpoints:
                  - matchLabels:
                      io.cilium.k8s.namespace.labels.company.com/system: "true"  # System namespaces (monitoring, ingress, etc.)
              - fromEndpoints:
                  - matchLabels:
                      io.cilium.k8s.namespace.labels.capsule.clastix.io/tenant: "{{tenant.name}}"  # Ingress from other namespaces with same tenant
            egress:
              - toCIDR:
                  - 10.96.0.10/32  # kube-dns IP
                toPorts:
                  - ports:
                      - port: "53"
                        protocol: UDP
                      - port: "53"
                        protocol: TCP
              - toEndpoints:
                 - matchLabels:
                     io.cilium.k8s.namespace.labels.capsule.clastix.io/tenant: "{{tenant.name}}"  # Egress to other namespaces with same tenant

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the networking documentation at the linked “non-native network policies” section and compare the rendered CiliumNetworkPolicy example with the corrected YAML in the issue. Update the example so it uses namespace label selectors and supported fields, then verify the page renders the corrected policy and no longer presents the invalid snippets.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes
Domain
documentation, networking
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.