Skip to content

Commit be69d4a

Browse files
authored
docs(tenants): finish isolated-field removal and document opt-in policy labels (#481)
## What Three-file update that closes out the `isolated` field removal in the v1 docs and documents the new opt-in network-policy label mechanism that replaced it. Changed files: - `content/en/docs/v1/getting-started/create-tenant.md` — drop the outdated Dashboard-tab bullet about the `isolated` checkbox, drop `isolated: true` from the kubectl YAML example, and add an info callout after the tabs block pointing at the upgrade notes and listing both labels inline so readers of either tab see the same guidance. - `content/en/docs/v1/operations/upgrades/_index.md` — expand the pre-existing "Tenant `isolated` flag removed" stub with a target/label table, a complete `Deployment` example that includes `spec.selector.matchLabels`, and a short prose explanation that the Cilium `allow-to-apiserver` policy matches via the `kube-apiserver` entity rather than by hard-coded Service IP. - `content/en/docs/v1/guides/tenants/_index.md` — add a new "Network Isolation Between Tenants" section so operators landing directly on the Tenant System guide learn about the mandatory isolation model and the opt-in labels without having to read the upgrade notes. - `content/en/docs/v1/operations/stretched/seaweedfs-multidc.md` — remove the stale `isolated: true` from the two v1 Tenant YAML examples and add a short note pointing at the upgrade guide so a reader comparing with an older version of the doc understands why the field disappeared. ## Why Two recurring pain points from the community chat: 1. Users still see `isolated` in examples (`create-tenant.md`, `seaweedfs-multidc.md`) even though the field was deleted from the `tenant` chart in Cozystack v1.0. Copy-pasting the old YAML leaves a silently-ignored field in their manifests; in the worst case it breaks validation on stricter admission setups. 2. With isolation now always on, the next question every time is *how do I let my operator reach `kube-apiserver` from inside a tenant namespace*. The answer is the two Cilium-policy-gated pod labels shipped by the tenant chart (`policy.cozystack.io/allow-to-apiserver` and `policy.cozystack.io/allow-to-etcd`), but they are documented nowhere outside the chart source — users ended up discovering the labels by reading `packages/apps/tenant/templates/networkpolicy.yaml` in the upstream repo. This PR documents both the removal and the replacement in the three places a user is likely to land: the getting-started flow, the Tenant System guide, and the v0→v1 upgrade notes. ## Verification - `hugo` builds cleanly; all three affected pages render with the new sections. - Label names verified against `packages/apps/tenant/templates/networkpolicy.yaml` in upstream `cozystack/cozystack`: - `policy.cozystack.io/allow-to-apiserver` → consumed by `CiliumNetworkPolicy` `allow-to-apiserver` (egress to `kube-apiserver` entity on port 6443). - `policy.cozystack.io/allow-to-etcd` → consumed by `CiliumClusterwideNetworkPolicy` `<tenant>-ingress-etcd`. - The `kube-apiserver` Cilium entity claim is verified against Cilium's [entity documentation](https://docs.cilium.io/en/stable/security/policy/language/#entities-based). - Hugo auto-generates `#tenant-isolated-flag-removed` from the heading `Tenant \`isolated\` flag removed` (backticks are stripped, spaces become hyphens); the three cross-file `{{% ref %}}` links resolve correctly in the built site. - `grep -rn "isolated:\s*\(true\|false\)" content/en/docs/v1/` after the change only finds the intentional mention in `upgrades/_index.md` describing the historical `isolated: false` behaviour — no stale YAML examples remain. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated tenant configuration documentation to reflect removal of the `isolated` field * Added details on automatic Cilium-enforced network isolation for all tenants * Documented pod label requirements for accessing kube-apiserver and etcd * Added upgrade guidance for the `isolated` flag removal with migration examples <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 20851be + ab91c81 commit be69d4a

4 files changed

Lines changed: 84 additions & 9 deletions

File tree

content/en/docs/v1/getting-started/create-tenant.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ doing so is **not recommended** for production environments.
7171
The `etcd` option is required for nested Kubernetes.
7272
Select it before installing the **Kubernetes** application in the tenant.
7373
Only disable it if you're certain the tenant won’t use nested Kubernetes.
74-
1. The `isolated` option determines whether sibling tenants can communicate over the network.
75-
This does **not** affect visibility in the dashboard.
76-
In most cases, it should be enabled (i.e., isolation is on).
7774
1. By default, no resource quotas are set.
7875
This means no usage limits.
7976
You can define quotas to prevent resource overuse.
@@ -106,7 +103,6 @@ spec:
106103
etcd: true
107104
host: team1.example.org
108105
ingress: true
109-
isolated: true
110106
monitoring: false
111107
resourceQuotas: {}
112108
seaweedfs: false
@@ -124,6 +120,18 @@ kubectl -n tenant-root apply -f hr-tenant-team1.yaml
124120
{{% /tab %}}
125121
{{< /tabs >}}
126122

123+
{{% alert color="info" %}}
124+
Cilium network policies in Cozystack v1.0+ always isolate sibling tenants from
125+
each other — there is no `isolated` field in either the Dashboard form or
126+
the HelmRelease values. Pods inside a tenant namespace also cannot reach
127+
`kube-apiserver` by default, or the tenant's own `etcd` when the tenant was
128+
created with `etcd: true`. To opt a pod into one of those paths, label it
129+
with `policy.cozystack.io/allow-to-apiserver: "true"` or
130+
`policy.cozystack.io/allow-to-etcd: "true"` respectively. See
131+
[Tenant `isolated` flag removed]({{% ref "/docs/v1/operations/upgrades#tenant-isolated-flag-removed" %}})
132+
in the upgrade notes for the full table and a worked example.
133+
{{% /alert %}}
134+
127135
You can assist tenant users with installing database applications or nested Kubernetes clusters.
128136
As an administrator, you can switch context in the dashboard to access any tenant.
129137
Tenant users, however, can only access their own tenant and any child tenants.

content/en/docs/v1/guides/tenants/_index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,26 @@ Here's how this configuration will be resolved:
5555
![tenant services](./tenants2.png)
5656

5757

58+
### Network Isolation Between Tenants
59+
60+
Every tenant namespace is isolated from its siblings by Cilium network
61+
policies installed automatically by the `tenant` chart. There is no
62+
per-tenant opt-out: the previous `isolated` field was removed in
63+
Cozystack v1.0. Pods inside a tenant namespace also cannot reach
64+
`kube-apiserver` by default, or the tenant's own `etcd` when the tenant
65+
was created with `etcd: true` — they need to opt in with one of two pod
66+
labels:
67+
68+
- `policy.cozystack.io/allow-to-apiserver: "true"` — reach the
69+
in-cluster Kubernetes API (for operators, dashboards, etc.).
70+
- `policy.cozystack.io/allow-to-etcd: "true"` — reach the tenant's
71+
own etcd (only applicable when the tenant was created with
72+
`etcd: true`).
73+
74+
See [Tenant `isolated` flag removed]({{% ref "/docs/v1/operations/upgrades#tenant-isolated-flag-removed" %}})
75+
in the upgrade notes for a full worked example.
76+
77+
5878
### Unique Domain Names
5979

6080
Each tenant has its own domain.

content/en/docs/v1/operations/stretched/seaweedfs-multidc.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ A convenient workflow is:
2323

2424
### 1. Create a Tenant without SeaweedFS
2525

26+
The `isolated` field that earlier Cozystack releases exposed on the
27+
Tenant object was removed in v1.0. See
28+
[Tenant `isolated` flag removed]({{% ref "/docs/v1/operations/upgrades#tenant-isolated-flag-removed" %}})
29+
in the upgrade notes for the current network-isolation model.
30+
2631
```yaml
2732
apiVersion: apps.cozystack.io/v1alpha1
2833
kind: Tenant
@@ -33,7 +38,6 @@ spec:
3338
etcd: false
3439
host: ""
3540
ingress: false
36-
isolated: true
3741
monitoring: false
3842
seaweedfs: false
3943
```
@@ -77,7 +81,6 @@ spec:
7781
etcd: false
7882
host: ""
7983
ingress: false
80-
isolated: true
8184
monitoring: false
8285
seaweedfs: true
8386
```

content/en/docs/v1/operations/upgrades/_index.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,53 @@ The migration is automatic for existing MongoDB instances.
136136
137137
### Tenant `isolated` flag removed
138138

139-
The `isolated` field has been removed from Tenant configuration. Network isolation via
140-
NetworkPolicy is now always enforced for all tenants. If you previously relied on
141-
`isolated: false` to allow unrestricted traffic between tenants, this is no longer possible.
139+
The `isolated` field has been removed from Tenant configuration. Network isolation
140+
is now always enforced for every tenant via Cilium network policies — there is no
141+
per-tenant opt-out. If you previously relied on `isolated: false` to allow
142+
unrestricted traffic between tenants, this is no longer possible.
143+
144+
Workloads inside a tenant namespace still need to reach a few control-plane
145+
targets (the in-cluster Kubernetes API server, the tenant's own `etcd`, and so on).
146+
The tenant chart ships a set of Cilium network policies that open these paths
147+
on an **opt-in** basis, gated on pod labels. If a pod inside a tenant namespace
148+
cannot reach one of these targets, add the corresponding label to its pod
149+
template:
150+
151+
| Target | Label on the pod |
152+
| --- | --- |
153+
| The in-cluster Kubernetes API server | `policy.cozystack.io/allow-to-apiserver: "true"` |
154+
| Tenant-owned `etcd` cluster services (only applicable when the tenant was created with `etcd: true`) | `policy.cozystack.io/allow-to-etcd: "true"` |
155+
156+
The `allow-to-apiserver` policy the tenant chart installs matches traffic
157+
against Cilium's built-in `kube-apiserver` entity, which Cilium resolves to
158+
the real API server endpoints. You do not need to know your Service CIDR or
159+
the address of the `kubernetes` Service — the label on the pod is enough.
160+
161+
Example — allowing a Deployment's pods to reach `kube-apiserver`:
162+
163+
```yaml
164+
apiVersion: apps/v1
165+
kind: Deployment
166+
metadata:
167+
name: my-operator
168+
spec:
169+
selector:
170+
matchLabels:
171+
app: my-operator
172+
template:
173+
metadata:
174+
labels:
175+
app: my-operator
176+
policy.cozystack.io/allow-to-apiserver: "true"
177+
spec:
178+
containers:
179+
- name: my-operator
180+
image: example.com/my-operator:v1.0.0
181+
```
182+
183+
Without the label, traffic to `kube-apiserver` is blocked by the
184+
`allow-to-apiserver` `CiliumNetworkPolicy` that the tenant chart installs in
185+
every tenant namespace. The same pattern applies to `allow-to-etcd`.
142186

143187
### Internal architecture changes
144188

0 commit comments

Comments
 (0)