Part 11 · Best practices

Tenancy, least privilege and network policy

Prerequisites: 05-identities, 03-networking

11 / Isolation is a stack, not a namespace label

Business data, Kubernetes API, Pod networking and compute each need their own isolation control. A namespace alone does not provide all four.

Scroll the diagram sideways for readable labels.

Platform controls summarize Kubernetes guidance. Tenant-scoped business authorization is a reasoned requirement for the worked SaaS scenario. [S11] [S12] [S33]

Learning objective and isolation model verified

Multi-tenancy requires both control-plane and data-plane isolation. Namespaces scope many API resources but do not create independent kernels. Dedicated nodes reduce co-location but can still share cluster services; stronger isolation may justify sandboxed execution or separate clusters, with extra cost and operations.

[S33] [S11]

Network-policy mechanism verified

Without applicable NetworkPolicies, Pod ingress and egress are allowed by default. Policies require a supporting enforcement implementation and primarily express L4 rules. Default-deny egress also blocks DNS unless allowed. IAM, security groups, NetworkPolicy and business authorization cover different scopes.

[S12]

Worked example synthesis

In the insurance exercise, use tenant-scoped application queries even if each team has its own namespace. Restrict deployers and service accounts to their required API operations. Add explicit dependency flows before applying default-deny. On a Pod Identity workload, include the identity-agent credential path; on private AWS access, verify required service endpoints.

[S11] [S17] [S12]

Decision and pitfall synthesis

A tenant allowed to run arbitrary untrusted code changes the threat model. Namespace-only separation is too weak for that assumption; evaluate sandbox or dedicated-cluster designs. A toleration only permits scheduling onto a tainted node and does not, by itself, force exclusive placement. Enforce the intended placement and admission constraints.

[S33]

Further improvement synthesis

Write a permission matrix and a network dependency map, then test denied access as well as allowed access. Verify the real policy implementation on your chosen EKS compute mode. Treat base64 values and read access to Secret objects as sensitive, and keep plaintext secret manifests out of the delivered examples.

[S36] [S12] [S11]
Keep this: A namespace is an organizational boundary; build the actual trust boundary explicitly.
Check yourself: Does “one namespace per customer” enforce customer record isolation?

No. The application must enforce record access; Kubernetes namespaces scope API resources and need additional control, network and compute protections.

Sources & further reading

  1. [S11] RBAC good practices

    Kubernetes · documentation · accessed 2026-10-10 · Living documentation; target-cluster compatibility must be checked · Not stated in retrieved page

    Supports: Least privilege and weak namespace boundaries

    Read the linked primary source for implementation details and current constraints.

  2. [S12] Network policies

    Kubernetes · documentation · accessed 2026-10-10 · Living documentation; target-cluster compatibility must be checked · Not stated in retrieved page

    Supports: L4 policy, enforcement dependency, default allowance, DNS egress

    Read the linked primary source for implementation details and current constraints.

  3. [S17] EKS Pod Identity

    AWS · documentation · accessed 2026-10-10 · Living documentation; target-cluster compatibility must be checked · Not stated in retrieved page

    Supports: Service account role associations, agent, SDK support and Linux EC2 scope

    Read the linked primary source for implementation details and current constraints.

  4. [S33] Kubernetes multi-tenancy

    Kubernetes · documentation · accessed 2026-10-10 · Living documentation; target-cluster compatibility must be checked · Not stated in retrieved page

    Supports: Control and data plane isolation; shared kernels and dedicated clusters

    Read the linked primary source for implementation details and current constraints.

  5. [S36] Kubernetes Secret good practices

    Kubernetes · documentation · accessed 2026-10-10 · Living documentation; target-cluster compatibility must be checked · Not stated in retrieved page

    Supports: Base64 is encoding, least privilege and encryption considerations

    Read the linked primary source for implementation details and current constraints.