freeradius
by Startechnica
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.
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 var | Wired when | Source Secret | What FreeRADIUS reads it for |
|---|---|---|---|
FREERADIUS_MODS_SQL_PASSWORD | modules.sql.enabled | DB credentials (bundled mariadb / postgresql subchart Secret, or externalDatabase.existingSecret) | rlm_sql password = $ENV{...} in mods-enabled/sql |
FREERADIUS_SITES_STATUS_SECRET | sites.status.enabled | Chart credentials Secret, key sites-status-secret | Shared secret for the status virtual server's loopback client probe { } + the radclient healthcheck |
FREERADIUS_SITES_RADSEC_PRIVKEY_PASSWORD | tls.enabled AND sites.radsec.tls.private_key_password is set | Chart credentials Secret, key sites-radsec-privkey-password | tls { private_key_password = $ENV{...} } in both the RADSEC listener and the chart-managed home_server radsec |
FREERADIUS_CLIENTS_RADSEC_SECRET | tls.enabled | Chart credentials Secret, key clients-radsec-secret | Shared secret for the RADSEC loopback client 127.0.0.1 and the chart-managed home_server radsec (self-proxy pattern) |
FREERADIUS_MODS_REST_PASSWORD | modules.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-password | rlm_rest body-template password field |
FREERADIUS_MODS_REDIS_PASSWORD | Redis-with-auth in use — bundled redis.enabled: true (auth on by default) OR explicit modules.redis.existingSecret | Bundled Redis subchart Secret OR BYO Secret named by modules.redis.existingSecret | rlm_redis and Redis-backed rlm_cache connection password |
FREERADIUS_MODS_EAP_TLS_PRIVKEY_PASSWORD | modules.eap.enabled AND modules.eap.tlsConfig.private_key_password is set | Chart credentials Secret, key mods-eap-tls-privkey-password | EAP module's tls-config { private_key_password = $ENV{...} } |
FREERADIUS_OIDC_CLIENT_SECRET | modules.oidc.enabled AND modules.oidc.instances.default.clientSecret is set (or its existingSecret BYO is set) | Per-instance OIDC Secret (<fullname>-oidc), key client-secret | OAuth2 client_secret for the default OIDC instance — read by the rlm_python3 wrapper via os.environ.get(...) |
FREERADIUS_OIDC_<NAME>_CLIENT_SECRET | each non-default OIDC instance with clientSecret (or existingSecret) set | Per-instance OIDC Secret (<fullname>-oidc-<name>), key client-secret | OAuth2 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'slookup. See §Auto-generated credentials below for the rotation caveats aroundhelm template-based workflows. - Pin them via your own Secret.
auth.existingSecretmounts one BYO Secret holding every chart-managed credential key;auth.existingSecretPerPasswordlets 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
defaultOIDC instance uses the bare prefixFREERADIUS_OIDC_; every other instance usesFREERADIUS_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 likesites.radsec.clients[*].secret,homeServers[*].secret, orrealms[*].secret, those env vars are not auto-created by the chart. Inject them yourself viaextraEnvVars(inlinevalueFromsecretKeyRef) orextraEnvVarsSecret(a Secret you manage that the Deployment pulls in viaenvFrom).
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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartfreeradius is pinned at v1.2.0 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