freeradius

by Startechnica

Helm chartv1.2.0App 3.2.8Apache-2.0Verified publisher

FreeRADIUS is a modular, high performance free RADIUS suite developed and distributed under the GNU General Public License, version 2, and is free for download and use.

About this chart

Helm chart for FreeRADIUS

FreeRADIUS is a modular, high performance free RADIUS suite developed and distributed under the GNU General Public License, version 2, and is free for download and use.

Overview of FreeRADIUS

This chart is not maintained by the upstream project and any issues with the chart should be raised here

TL;DR

helm install my-release oci://ghcr.io/startechnica/charts/freeradius

Prerequisites

  • Kubernetes 1.22+
  • Helm 3.10.0+

Installing the Chart

To install the chart with the release name my-release on my-release namespace:

helm install my-release oci://ghcr.io/startechnica/charts/freeradius \
  --namespace my-release --create-namespace

The chart is published as an OCI artifact in GHCR, so no helm repo add is needed — Helm 3.10+ resolves the oci:// URL directly. The command deploys FreeRADIUS on the Kubernetes cluster in the default configuration.

Tip: List all releases using helm list -A

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release --namespace my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration and installation details

Adding extra environment variables

In case you want to add extra environment variables (useful for advanced operations like custom init scripts), you can use the extraEnvVars property. Each entry is a standard Kubernetes EnvVar, so valueFrom works too.

extraEnvVars:
  - name: LOG_LEVEL
    value: error
  - name: TZ
    value: "Europe/Amsterdam"
  - name: NODE_NAME             # downwardAPI example
    valueFrom:
      fieldRef:
        fieldPath: spec.nodeName

For larger sets of variables (or when the values live in a ConfigMap / Secret you already manage), point at them with extraEnvVarsCM / extraEnvVarsSecret. Every key from those resources is injected verbatim via envFrom.

extraEnvVarsCM: my-freeradius-env       # ConfigMap with key=value pairs
extraEnvVarsSecret: my-freeradius-creds # Secret with key=value pairs (base64)

The three properties stack — extraEnvVars entries land first (so they can override anything from the ConfigMap/Secret with the same name), followed by envFrom for the ConfigMap, then the Secret.

Chart-managed environment variables

In addition to whatever you add via extraEnvVars*, the chart injects a small fixed set of env vars into the FreeRADIUS container — every one of them backed by a Kubernetes Secret (secretKeyRef, not envFrom) and gated on the values that enable the matching feature. Reference them from your own config (or from $ENV{...} in values that go through tpl) when you need a chart-managed credential at runtime.

Env varWired whenSource SecretWhat FreeRADIUS reads it for
FREERADIUS_MODS_SQL_PASSWORDmodules.sql.enabledDB credentials (bundled mariadb / postgresql subchart Secret, or externalDatabase.existingSecret)rlm_sql password = $ENV{...} in mods-enabled/sql
FREERADIUS_SITES_STATUS_SECRETsites.status.enabledChart credentials Secret, key sites-status-secretShared secret for the status virtual server's loopback client probe { } + the radclient healthcheck
FREERADIUS_SITES_RADSEC_PRIVKEY_PASSWORDtls.enabled AND sites.radsec.tls.private_key_password is setChart credentials Secret, key sites-radsec-privkey-passwordtls { private_key_password = $ENV{...} } in both the RADSEC listener and the chart-managed home_server radsec
FREERADIUS_CLIENTS_RADSEC_SECRETtls.enabledChart credentials Secret, key clients-radsec-secretShared secret for the RADSEC loopback client 127.0.0.1 and the chart-managed home_server radsec (self-proxy pattern)
FREERADIUS_MODS_REST_PASSWORDmodules.rest.enabled (empty-string envFrom fallback always wired; an explicit env: secretKeyRef overrides when modules.rest.auth != "none")rlm_rest module Secret, key mods-rest-passwordrlm_rest body-template password field
FREERADIUS_MODS_REDIS_PASSWORDRedis-with-auth in use — bundled redis.enabled: true (auth on by default) OR explicit modules.redis.existingSecretBundled Redis subchart Secret OR BYO Secret named by modules.redis.existingSecretrlm_redis and Redis-backed rlm_cache connection password
FREERADIUS_MODS_EAP_TLS_PRIVKEY_PASSWORDmodules.eap.enabled AND modules.eap.tlsConfig.private_key_password is setChart credentials Secret, key mods-eap-tls-privkey-passwordEAP module's tls-config { private_key_password = $ENV{...} }
FREERADIUS_OIDC_CLIENT_SECRETmodules.oidc.enabled AND modules.oidc.instances.default.clientSecret is set (or its existingSecret BYO is set)Per-instance OIDC Secret (<fullname>-oidc), key client-secretOAuth2 client_secret for the default OIDC instance — read by the rlm_python3 wrapper via os.environ.get(...)
FREERADIUS_OIDC_<NAME>_CLIENT_SECRETeach non-default OIDC instance with clientSecret (or existingSecret) setPer-instance OIDC Secret (<fullname>-oidc-<name>), key client-secretOAuth2 client_secret for the named instance

A few things worth knowing:

  • Auto-generation. When the source value is left empty (sites.status.secret: "", sites.radsec.tls.private_key_password: "", modules.eap.tlsConfig.private_key_password: "", etc.), the chart materialises a random value into the chart credentials Secret on install and preserves it across upgrades via Helm's lookup. See §Auto-generated credentials below for the rotation caveats around helm template-based workflows.
  • Pin them via your own Secret. auth.existingSecret mounts one BYO Secret holding every chart-managed credential key; auth.existingSecretPerPassword lets you point each credential at its own Secret (e.g. one managed by an external-secrets operator). The env var names above stay the same — only the backing Secret changes.
  • Per-instance OIDC prefix. The default OIDC instance uses the bare prefix FREERADIUS_OIDC_; every other instance uses FREERADIUS_OIDC_<NAME>_ with the instance name upper-cased (e.g. modules.oidc.instances.partner-realm.clientSecret → FREERADIUS_OIDC_PARTNER_REALM_CLIENT_SECRET).
  • Not in the table above. OIDC coordinates other than CLIENT_SECRET (tokenUrl / introspectUrl / clientId / scope / connectTimeout / rolesClaim / groupsClaim / tls.* / role-and-group-and-attribute mappings / introspect / refreshTokenCache / cache.*) are baked into the per-instance rlm_python3 wrapper at chart-render time — they are not runtime env vars. Update the values and re-apply to change them.
  • Your own $ENV{...}. When you write $ENV{FREERADIUS_RADSEC_CLIENT_AP_SECRET} (or any other custom name) inside values like sites.radsec.clients[*].secret, homeServers[*].secret, or realms[*].secret, those env vars are not auto-created by the chart. Inject them yourself via extraEnvVars (inline valueFrom secretKeyRef) or extraEnvVarsSecret (a Secret you manage that the Deployment pulls in via envFrom).

Setting Pod's affinity

This chart allows you to set your custom affinity using the affinity parameter, or to lean on the bundled presets (podAntiAffinityPreset / podAffinityPreset / nodeAffinityPreset.type — each accepts soft or hard). The presets render a sensible default; setting affinity overrides them entirely. Find more information about Pod's affinity in the Kubernetes documentation.

# Option A — bundled presets (simplest)
podAntiAffinityPreset: hard              # spread replicas across nodes; default is "soft"
nodeAffinityPreset:
  type: soft
  key: workload-class
  values: [radius]

# Option B — explicit affinity passthrough (overrides every preset above)
affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
        - matchExpressions:
            - key: kubernetes.io/os
              operator: In
              values: [linux]
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchLabels:
              app.kubernetes.io/instance: my-release
              app.kubernetes.io/name: freeradius
          topologyKey: topology.kubernetes.io/zone

Deploying extra resources

There are cases where you may want to deploy extra objects alongside the chart — a ConfigMap holding sideband config, a NetworkPolicy covering a CIDR that the chart's policies don't, a ServiceMonitor with custom relabelings, an external-secrets ExternalSecret, etc. The extraDeploy parameter takes a list of arbitrary manifests; each one is rendered through tpl so {{ .Release.Name }} / {{ .Release.Namespace }} work as you'd expect.

extraDeploy:
  # Custom ConfigMap mounted into the pod via extraVolumes / extraVolumeMounts
  - apiVersion: v1
    kind: ConfigMap
    metadata:
      name: "{{ .Release.Name }}-freeradius-extra-clients"
      namespace: "{{ .Release.Namespace }}"
    data:
      extra-clients.conf: |
        client edge-router {
            ipaddr = 198.51.100.0/24
            secret = $ENV{FREERADIUS_EDGE_ROUTER_SECRET}
        }

  # NetworkPolicy that opens RADSEC to a specific peer CIDR the bundled policy doesn't cover
  - apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata:
      name: "{{ .Release.Name }}-freeradius-radsec-extra"
      namespace: "{{ .Release.Namespace }}"
    spec:
      podSelector:
        matchLabels:
          app.kubernetes.io/instance: "{{ .Release.Name }}"
          app.kubernetes.io/name: freeradius
      policyTypes: [Ingress]
      ingress:
        - from:
            - ipBlock:
                cidr: 203.0.113.0/24
          ports:
            - protocol: TCP
              port: 2083

Redis-backed cache

The rlm_cache module (modules.cache) defaults to the in-memory rbtree driver, which is per-pod. To share cache state across replicas, switch it to the redis driver and bundle a Redis. The minimum values are:

redis:
  enabled: true        # bundle a Bitnami Redis (auth is on by default)

modules:
  cache:
    enabled: true
    driver: redis      # default is rbtree (in-memory, per-pod)

Regardless of driver, rlm_cache refuses to load without a non-empty update { } section, so modules.cache.update is required. It holds the attributes to cache in FreeRADIUS map syntax (<list>:<attr> <op> <value>, one per line) and defaults to &reply: += &reply: (cache the whole reply list). Override it for what you actually need to cache.

With redis.enabled: true the chart auto-wires the connection: the cache targets the bundled <release>-redis-master Service and injects the Redis password from the subchart's Secret as $ENV{FREERADIUS_MODS_REDIS_PASSWORD} — you don't set a host or password yourself. You do not need modules.redis.enabled (that only adds the %{redis:...} xlat); the cache reuses the connection settings under modules.redis on its own.

To point the cache at an external Redis instead, leave `redis.ena

Deploy freeradius with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has freeradius 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 chartfreeradius is pinned at v1.2.0 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