base-cluster-v2
by 4ALLPORTAL
Foundational base cluster setup — FluxCD, Traefik ingress, cert-manager, ExternalDNS, an internal Librespeed speedtest endpoint, and a full LGTM observability stack (Grafana, Loki, Mimir, Tempo, and Alloy-based metrics/log/trace collection), and a least-privilege RBAC baseline. Successor to the base-cluster chart.
About this chart
base-cluster-v2
Foundational base cluster setup — FluxCD, Traefik ingress, cert-manager, ExternalDNS, an internal Librespeed speedtest endpoint, and a full LGTM observability stack (Grafana, Loki, Mimir, Tempo, and Alloy-based metrics/log/trace collection), and a least-privilege RBAC baseline. Successor to the base-cluster chart.
Homepage: https://4allportal.com
Scope
This chart bootstraps the foundation of a Kubernetes cluster:
-
FluxCD — the GitOps engine. Deployed by this chart only when
flux.install=true; the default assumes Flux was already installed viaflux bootstrap. -
Traefik — the cluster's primary ingress controller.
-
cert-manager — issues TLS certificates from Let's Encrypt via the Cloudflare DNS01 solver. CRDs ship in
crds/so first-install ordering is predictable. -
ExternalDNS — publishes DNS records for ingresses to Cloudflare.
-
Librespeed speedtest — an internal endpoint at
https://speedtest.<cluster>.<domain>that doubles as a connectivity smoke test. -
Sealed Secrets — Bitnami controller for storing encrypted secrets in Git (
sealedSecrets.enabled). -
Reflector — mirrors source Secrets/ConfigMaps into other namespaces via annotations (
reflector.enabled). -
metrics-server — exposes
metrics.k8s.ioforkubectl topand HPAs (metricsServer.enabled). -
Janitor — k8s-cleaner, a CRD-driven controller that deletes stale resources on a schedule: completed Jobs and failed or evicted Pods by default, plus succeeded Pods via
janitor.cleaners.succeededPods(off, because the owning controller normally reaps those). Rules areCleanerCRs generated fromjanitor.cleaners.*;janitor.excludedNamespaceskeeps them off system namespaces (janitor.enabled). Each rule only acts once a resource has been terminal forminAgeHours(default 24), so recent failures stay around long enough to debug. Cron schedules are evaluated in UTC.Before enabling a rule on a new cluster, set
janitor.cleaners.<rule>.dryRun: true— the flag is per rule, there is no chart-wide switch. It renders that Cleaner withaction: Scan, which matches and reports without deleting:kubectl get reports.apps.projectsveltos.io kubectl get reports.apps.projectsveltos.io <cleaner-name> -o yaml # matched resourcesReports come from the
CleanerReportnotification thatjanitor.report.enabledattaches to every rule; without it the controller records matches only in its own log. A Report is a snapshot of the last run, not a log: it appears after the rule's first run and is overwritten on every subsequent one, soresourceInfo: []means "the last run matched nothing" — not "nothing was ever cleaned". No Report at all means the rule has not run yet (confirm with.status.lastRunTimeon the Cleaner); use the controller log for history. -
descheduler — kubernetes-sigs descheduler as a CronJob for pod rebalancing. Off by default (it evicts running pods); enable per cluster via
descheduler.enabled. -
Observability stack — grafana/k8s-monitoring (Alloy Operator, split into a clustered
alloy-metricscollector and a node-localalloy-logsDaemonSet) → Mimir/Loki/Tempo backends + Grafana UI + OTEL Collector for traces; Mimir-internal Alertmanager pings an UptimeRobot heartbeat. IngressMonitorController auto-creates UptimeRobot monitors fromEndpointMonitorCRs. Opt-in viamonitoring.enabled; each sub-component has its own toggle. -
RBAC baseline — least-privilege ClusterRoles for platform staff and for tenant namespaces, bound to your identity provider's groups from values (
rbac.enabled). See RBAC.
Out of scope — security scanning, and the authentication half of access control: this chart decides what a group may do, not how a person becomes a member of one. Wiring kube-apiserver to the identity provider is its own story.
Versions
Component upstream versions are pinned exactly in
templates/_versions.tpl. Bumping any component is an explicit edit to that
file plus a chart version bump.
Certificates
The cluster's own wildcard (*.<clusterName>.<baseDomain>) is issued into the
traefik namespace and used by ingresses that bring no certificate of their own.
global.certificates issues additional ones into the release namespace, keyed by
name, with the Secret named <key>-certificate:
global:
certificates:
example-com-wildcard:
dnsNames:
- example.com
- "*.example.com"
A Secret is only usable from the namespace it lives in, so a wildcard meant for
workloads elsewhere has to be mirrored. secretTemplate is handed to
cert-manager, which stamps its annotations and labels onto the issued Secret and
keeps them across renewals — which is what makes kubernetes-reflector pick it up.
Annotating the Secret by hand works until the first renewal quietly drops the
annotations and the mirrored copies stop being updated:
secretTemplate:
annotations:
reflector.v1.k8s.emberstack.com/reflection-allowed: "true"
reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "app-.*"
reflector.v1.k8s.emberstack.com/reflection-auto-enabled: "true"
reflector.v1.k8s.emberstack.com/reflection-auto-namespaces: "app-.*"
Name the target namespaces. A TLS Secret carries the private key, so leaving the
namespace annotations off — which mirrors into every namespace, including
kube-system — hands the wildcard's key to anyone who can read Secrets anywhere
in the cluster.
The namespace fields take a comma-separated list or a regular expression, so a pattern covers namespaces that do not exist yet and needs no upkeep as they are added. Reflector matches on the namespace name only; it does not read labels or annotations on the namespace itself.
Note that a wildcard certificate matches exactly one label: a.example.com is
covered, a.b.example.com is not.
Network policies
global.networkPolicy.type defaults to auto: the chart emits
CiliumNetworkPolicy objects when the cilium.io/v2 API is present, otherwise
nothing. On Talos pre-Cilium, set this to none if you'd rather not pre-stage
the policies (they are inert without Cilium).
RBAC
Six roles, bound to nobody until you say so. Installing or upgrading the chart
with the defaults adds the role definitions and changes no one's access — every
subject list under rbac ships empty.
| Role | Kind | Grants |
|---|---|---|
cluster-admin (built-in) | ClusterRoleBinding | everything. Bound only from rbac.cluster.admin, which is empty by default |
base-cluster:cluster-reader | ClusterRoleBinding | read-only cluster-wide, no Secrets |
base-cluster:tenant-admin | RoleBinding per namespace | the namespace, including its Secrets, ServiceAccounts and RoleBindings |
base-cluster:tenant-developer | RoleBinding per namespace | the namespace's workloads, exec and port-forward — no Secrets |
base-cluster:tenant-connector | RoleBinding per namespace | tenant-viewer plus port-forward — reach a database with your own client and credentials. No Secrets, no exec |
base-cluster:tenant-viewer | RoleBinding per namespace | read-only in the namespace, no Secrets |
base-cluster:namespace-lister | ClusterRoleBinding | list namespace names. Bound automatically to every subject under rbac.tenants (rbac.tenant.listNamespaces) |
The tenant roles are ClusterRoles bound with a RoleBinding, the same way the
built-in admin/edit/view work: one definition, confined to a namespace by
the binding. A Role per tenant would be N copies drifting apart.
RBAC cannot filter a list down to the namespaces a user is bound in: kubectl get namespaces either returns every namespace or fails. Without
namespace-lister the namespace pickers in k9s, Lens or Headlamp stay empty for
tenant users. With it they see every namespace name, and only the contents of
the ones they are bound in.
What the tiers deliberately cannot do
RBAC has no deny rule, so a permission is excluded by never being granted. The
exclusions below are the ones that would otherwise turn a tier into
cluster-admin by a side door. They are why the core ("") API group is
enumerated resource by resource in the templates while every other group is
covered by rbac.readableApiGroups:
-
Secrets are absent from every tier but
tenant-admin. Adding""torbac.readableApiGroupswould hand out every Secret in the cluster; extend the enumerated core rule instead.For
cluster-reader,tenant-connectorandtenant-viewerthat exclusion is absolute. Fortenant-developerit is not, and no RBAC rule can make it so: anyone who can create a workload in a namespace can mount that namespace's Secrets into a pod and read them from there. What the tier does buy is thatkubectl get secretfails, a Secret cannot be read or modified by accident, and the roundabout route leaves a Pod spec behind in the audit log. Where a credential must be unreachable, put it in a namespace whose developers are not bound — the namespace is the boundary, the tier is not. -
escalate,bindandimpersonateappear nowhere.tenant-admincan create RoleBindings, but the RBAC authorizer refuses a binding that grants more than the binder already holds — so it can delegate its own permissions and no more. -
NetworkPolicies and CiliumNetworkPolicies are read-only in every tier. A tenant that can widen its own ingress rules is not isolated, and the cluster's default-deny posture depends on those objects.
-
pods/execandpods/portforwardare not granted cluster-wide. A shell in any pod reads every Secret mounted anywhere. Inside a tenant namespace both are on, where the blast radius is the tenant's own.tenant-connectorgets port-forward without exec: a forwarded connection enters the pod's network namespace on loopback, past any NetworkPolicy, but still has to authenticate to the service behind it. -
CRDs, admission webhooks, ResourceQuotas and LimitRanges stay with the platform team in every tier.
-
Flux objects are read-only in every tenant tier. Without the Flux multi-tenancy lockdown the controllers apply them as cluster-admin, so a tenant that could write one could grant itself anything.
Binding groups
rbac:
cluster:
admin:
groups: ["8f1c1d2e-...-...."] # platform team
reader:
groups: ["2b90ffac-...-...."] # everyone else
tenants:
team-a:
admin:
groups: ["c07a41b9-...-...."]
developer:
users: ["[email protected]"]
mysql-prod:
connector:
groups: ["c07a41b9-...-...."]
Entra ID puts group object IDs in the token, not display names, so on
Entra-backed clusters these values are GUIDs. Until kube-apiserver is wired to
the identity provider there are no group claims to match: list users (the
username claim, or a client-certificate CN) or serviceAccounts instead —
the shape is identical, so switching over later is an edit to one list.
The tenant namespaces must already exist; the chart binds into them, it does not create them. A RoleBinding naming a missing namespace fails the release, which beats rendering a binding that silently protects nothing.
Leaving rbac.cluster.admin empty locks nobody out. The Talos admin
kubeconfig (talosctl kubeconfig) and kubeadm's super-admin.conf authenticate
as system:masters, which the authorizer honours ahead of RBAC — that stays the
break-glass path. kubeadm's admin.conf does not: since v1.29 it authenticates
as kubeadm:cluster-admins, which depends on RBAC.
Successor to base-cluster
This is a clean v1 of a chart that succeeds the older base-cluster chart.
The older chart remains in this repo for clusters that haven't migrated.
Maintainers
| Name | Url | |
|---|---|---|
| jpkraemer-mg | [email protected] | |
| Dominic-Beer | [email protected] | |
| C-schwarz-4ap | [email protected] |
Values
| Key | Type | Default | Description |
|---|---|---|---|
| backup.edition | string | "community" | |
| backup.enabled | bool | false | |
| backup.licenseSecretName | string | "" | |
| backup.retryBackup.enabled | bool | false | |
| backup.retryBackup.image.registry | string | "" | |
| backup.retryBackup.image.repository | string | "alpine/k8s" | |
| backup.retryBackup.image.tag | string | "1.37.2" | |
| backup.retryBackup.resources.limits.cpu | string | "100m" | |
| backup.retryBackup.resources.limits.memory | string | "64Mi" | |
| backup.retryBackup.resources.requests.cpu | string | "10m" | |
| backup.retryBackup.resources.requests.memory | string | "32Mi" | |
| backup.retryBackup.schedule | string | "30 0-8 * * *" | |
| backup.taskQueue.enabled | bool | false | |
| backup.taskQueue.maxConcurrentSessions | int | 10 | |
| backup.values | object | {} | |
| certManager.caInjector.resources.limits.cpu | string | "500m" | |
| certManager.caInjector.resources.limits.memory | string | "512Mi" | |
| certManager.caInjector.resources.requests.cpu | string | "250m" | |
| certManager.caInjector.resources.requests.memory | string | "512Mi" | |
| certManager.resources.limits.cpu | string | "500m" | |
| certManager.resources.limits.memory | string | "512Mi" | |
| certManager.resources.requests.cpu | string | "250m" | |
| certManager.resources.requests. |
Deploy base-cluster-v2 with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has base-cluster-v2 on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartbase-cluster-v2 is pinned at v2.20.8 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply