Skip to content

Safer APISIX defaults: ClusterIP gateway, etcd only when used, no catch-all route - #33

Merged
vramperez merged 5 commits into
masterfrom
apisix-safe-defaults
Nov 12, 2026
Merged

vramperez merged 5 commits into
masterfrom
apisix-safe-defaults

Conversation

@vramperez

@vramperez vramperez commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Three defaults of the chart published or ran things that a release does not use:

Value Before Now
apisix.service.type NodePort (the apisix chart's default) ClusterIP
apisix.etcd.enabled true false
apisix.catchAllRoute.enabled true false
  • Gateway Service: as a NodePort, the gateway answered plain HTTP on a port of every node, outside of the Ingress that carries its host and TLS. It is now published through an Ingress; NodePort or LoadBalancer are one value away. externalTrafficPolicy is left empty because apisix chart versions before 2.18 write it for every type, and the API server rejects it on a ClusterIP Service.
  • etcd: the default standalone mode reads the routes from a ConfigMap and never connects to etcd. That etcd ran three replicas of bitnamilegacy/etcd:latest without authentication, each on an 8Gi volume, and held APISIX back with a wait-etcd init container. It is now deployed only when apisix.etcd.enabled is set.
  • Catch-all route: every release routed /* to my-broker:8080, which does not exist, checked against the verifier's mySecuredService. Unmatched requests went through the OIDC flow and ended in an upstream error instead of a 404.

Upgrades

APISIX reads its configuration from etcd in any mode other than standalone, unless the role is traditional with config_provider: yaml. Such a release that relied on the old default would lose etcd on upgrade and its gateway would serve no routes. Instead, the chart now refuses to render it without apisix.etcd.enabled or an apisix.externalEtcd.host of its own, and names both. The example host the apisix chart ships in externalEtcd.host does not count as one.

On an upgrade of a standalone release, the etcd StatefulSet is removed but its PersistentVolumeClaims, one per replica (three by default), are kept. kubectl delete pvc data-<release>-etcd-0 data-<release>-etcd-1 data-<release>-etcd-2 removes them.

A release that used the catch-all route sets apisix.catchAllRoute.enabled: true, and one that reached the gateway through the NodePort sets apisix.service.type: NodePort. The integration tests do the latter, since they call the gateway on port 30080 of the node.

Tests

  • helm lint and the kubeconform validation of the shared chart lint, with the defaults and with ci/traditional-etcd-values.yaml (traditional mode with its etcd)
  • Render: the guard fails for traditional with etcd and for decoupled data or control plane without an etcd. It passes with etcd.enabled, with an external etcd, with traditional and config_provider: yaml (the integration tests), and in standalone. Checked with apisix chart 2.16.0 and 2.18.2
  • APISIX 3.17 in standalone mode starts with an empty route list and answers 404

vramperez and others added 3 commits November 12, 2026 14:27
The gateway Service took the default of the apisix chart, NodePort, so besides
the Ingress that carries its host and TLS, the gateway answered plain HTTP on a
port of every node, outside of anything the Ingress enforces. It is now a
ClusterIP Service and is published through an Ingress. NodePort or LoadBalancer
are still one value away.

`externalTrafficPolicy` is left empty: apisix chart versions before 2.18 write
it for every Service type, and the API server rejects it on a ClusterIP one.

The integration tests reach the gateway on a fixed port of the node, so their
deployment sets NodePort explicitly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chart deployed an etcd for APISIX by default, although its default
standalone mode reads the routes from a ConfigMap and never connects to it. That
etcd ran the unmaintained `bitnamilegacy/etcd:latest` image, without
authentication, on an 8Gi volume, and held APISIX back with a wait-etcd init
container. It is no longer deployed unless `apisix.etcd.enabled` is set.

A release whose APISIX reads its configuration from etcd (a mode other than
standalone, unless the role is traditional with `config_provider: yaml`) and has
neither that etcd nor `apisix.externalEtcd.host` now fails to render, naming the
values to set. Otherwise an upgrade from a version that deployed etcd by default
would remove it and leave the gateway without routes. The example host the apisix
chart ships in `externalEtcd.host` does not count as one.

The chart lint renders a traditional deployment with its etcd as well
(`ci/traditional-etcd-values.yaml`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every release got a route for every path (/*) to `my-broker:8080`, a Service
that does not exist, checked against the `mySecuredService` service of the
verifier. Requests that matched no route went through the OIDC flow and ended in
an error from a missing upstream instead of a 404, and the gateway published a
route nobody had configured. The route is now off unless
`apisix.catchAllRoute.enabled` is set; `apisix.routes` publishes each service on
its own host and paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Please apply exactly one of the following labels to the PR: 'patch', 'minor', 'major'.

@vramperez
vramperez merged commit c1aa96c into master Nov 12, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants