base-cluster-v2

by 4ALLPORTAL

Helm chartv2.20.8App 1.36.4Verified publisher

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 via flux 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.io for kubectl top and 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 are Cleaner CRs generated from janitor.cleaners.*; janitor.excludedNamespaces keeps them off system namespaces (janitor.enabled). Each rule only acts once a resource has been terminal for minAgeHours (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 with action: Scan, which matches and reports without deleting:

    kubectl get reports.apps.projectsveltos.io
    kubectl get reports.apps.projectsveltos.io <cleaner-name> -o yaml   # matched resources
    

    Reports come from the CleanerReport notification that janitor.report.enabled attaches 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, so resourceInfo: [] 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.lastRunTime on 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-metrics collector and a node-local alloy-logs DaemonSet) → Mimir/Loki/Tempo backends + Grafana UI + OTEL Collector for traces; Mimir-internal Alertmanager pings an UptimeRobot heartbeat. IngressMonitorController auto-creates UptimeRobot monitors from EndpointMonitor CRs. Opt-in via monitoring.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.

RoleKindGrants
cluster-admin (built-in)ClusterRoleBindingeverything. Bound only from rbac.cluster.admin, which is empty by default
base-cluster:cluster-readerClusterRoleBindingread-only cluster-wide, no Secrets
base-cluster:tenant-adminRoleBinding per namespacethe namespace, including its Secrets, ServiceAccounts and RoleBindings
base-cluster:tenant-developerRoleBinding per namespacethe namespace's workloads, exec and port-forward — no Secrets
base-cluster:tenant-connectorRoleBinding per namespacetenant-viewer plus port-forward — reach a database with your own client and credentials. No Secrets, no exec
base-cluster:tenant-viewerRoleBinding per namespaceread-only in the namespace, no Secrets
base-cluster:namespace-listerClusterRoleBindinglist 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 "" to rbac.readableApiGroups would hand out every Secret in the cluster; extend the enumerated core rule instead.

    For cluster-reader, tenant-connector and tenant-viewer that exclusion is absolute. For tenant-developer it 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 that kubectl get secret fails, 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, bind and impersonate appear nowhere. tenant-admin can 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/exec and pods/portforward are 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-connector gets 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

NameEmailUrl
jpkraemer-mg[email protected]
Dominic-Beer[email protected]
C-schwarz-4ap[email protected]

Values

KeyTypeDefaultDescription
backup.editionstring"community"
backup.enabledboolfalse
backup.licenseSecretNamestring""
backup.retryBackup.enabledboolfalse
backup.retryBackup.image.registrystring""
backup.retryBackup.image.repositorystring"alpine/k8s"
backup.retryBackup.image.tagstring"1.37.2"
backup.retryBackup.resources.limits.cpustring"100m"
backup.retryBackup.resources.limits.memorystring"64Mi"
backup.retryBackup.resources.requests.cpustring"10m"
backup.retryBackup.resources.requests.memorystring"32Mi"
backup.retryBackup.schedulestring"30 0-8 * * *"
backup.taskQueue.enabledboolfalse
backup.taskQueue.maxConcurrentSessionsint10
backup.valuesobject{}
certManager.caInjector.resources.limits.cpustring"500m"
certManager.caInjector.resources.limits.memorystring"512Mi"
certManager.caInjector.resources.requests.cpustring"250m"
certManager.caInjector.resources.requests.memorystring"512Mi"
certManager.resources.limits.cpustring"500m"
certManager.resources.limits.memorystring"512Mi"
certManager.resources.requests.cpustring"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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartbase-cluster-v2 is pinned at v2.20.8 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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