document h2c_upstream k8s ingress annotation - #2361
Conversation
Adds the new ingress.pomerium.io/h2c_upstream annotation to the Ingress annotations reference and a short HTTP/2 Cleartext Upstreams section under Services, noting it cannot be combined with secure_upstream. Companion to pomerium/ingress-controller#1516.
✅ Deploy Preview for pomerium-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Greptile SummaryThis PR documents the new Kubernetes Ingress annotation for cleartext HTTP/2 upstream connections.
Confidence Score: 4/5The documentation is safe to merge after a non-blocking consistency fix to list every incompatible upstream annotation in the reference row. The new section and links are sound, but the annotation table incompletely summarizes the controller constraint and can mislead readers who use it as a standalone reference. Files Needing Attention: content/docs/deploy/k8s/ingress.md
|
| Filename | Overview |
|---|---|
| content/docs/deploy/k8s/ingress.md | Adds the h2c annotation reference and usage guidance; the reference row omits three conflicts documented later on the same page. |
Reviews (1): Last reviewed commit: "document h2c_upstream k8s ingress annota..." | Re-trigger Greptile
|
|
||
| | Annotation | Description | | ||
| | --- | --- | | ||
| | `ingress.pomerium.io/h2c_upstream` | When set to `"true"`, use cleartext HTTP/2 (`h2c`) when connecting to the upstream endpoint. See the [example below](#http2-cleartext-upstreams) for more information. Cannot be combined with `secure_upstream`. | |
There was a problem hiding this comment.
Incomplete incompatibility list
The annotation reference says h2c_upstream cannot be combined only with secure_upstream, while the detailed section also lists ssh_upstream, tcp_upstream, and udp_upstream. Someone relying on the table can therefore configure a combination that the documented controller behavior rejects instead of creating the route.
This red test demonstrates the incomplete table entry:
import assert from 'node:assert/strict';
import fs from 'node:fs';
import test from 'node:test';
test('h2c annotation row lists every incompatible upstream mode', () => {
const markdown = fs.readFileSync('content/docs/deploy/k8s/ingress.md', 'utf8');
const row = markdown
.split('\n')
.find((line) => line.startsWith('| `ingress.pomerium.io/h2c_upstream`'));
for (const annotation of [
'secure_upstream',
'ssh_upstream',
'tcp_upstream',
'udp_upstream',
]) {
assert.match(row, new RegExp(`\\`${annotation}\\``));
}
});It fails on the current row at the ssh_upstream assertion, while the detailed section establishes that all four annotations are incompatible.
| | `ingress.pomerium.io/h2c_upstream` | When set to `"true"`, use cleartext HTTP/2 (`h2c`) when connecting to the upstream endpoint. See the [example below](#http2-cleartext-upstreams) for more information. Cannot be combined with `secure_upstream`. | | |
| | `ingress.pomerium.io/h2c_upstream` | When set to `"true"`, use cleartext HTTP/2 (`h2c`) when connecting to the upstream endpoint. See the [example below](#http2-cleartext-upstreams) for more information. Cannot be combined with `secure_upstream`, `ssh_upstream`, `tcp_upstream`, or `udp_upstream`. | |
## Summary
Pomerium core supports plaintext HTTP/2 upstreams via the `h2c://`
scheme in route `to` URLs, but Ingress resources had no way to request
it: the controller builds `to` URLs from Service/Endpoints and picks the
scheme itself.
- Add an `ingress.pomerium.io/h2c_upstream: "true"` annotation, modeled
on `secure_upstream`, that emits `h2c://` upstream URLs.
- Reject `h2c_upstream` when combined with `secure_upstream` (or
`ssh_upstream` / `tcp_upstream` / `udp_upstream`), since the schemes are
mutually exclusive per route and core would otherwise silently degrade
mixed lists to HTTP/1.1.
- Consolidate the scheme-annotation list into a single ordered table
shared by scheme selection and validation. Existing precedence among the
older annotations is unchanged.
## Example
```yaml
metadata:
annotations:
ingress.pomerium.io/h2c_upstream: "true"
```
Combining it with `secure_upstream` fails with:
```
annotations: ingress.pomerium.io/h2c_upstream and ingress.pomerium.io/secure_upstream are mutually exclusive
```
## Test plan
- [x] `make test` (envtest + `pomerium/ctrl`) passes
- [x] `golangci-lint run ./...` clean
- [x] New table cases in `TestEndpointsHTTPS` for `h2c://` endpoint URLs
- [x] New `TestH2CUpstreamConflicts` covering all four conflicting
annotation pairs
Documentation PR: pomerium/documentation#2361
Summary
Documents the new
ingress.pomerium.io/h2c_upstreamIngress annotation introduced in pomerium/ingress-controller#1516.h2c_upstreamrow to the Ingress annotations reference table.h2c://scheme docs in the routetoreference.h2c_upstreamcannot be combined withsecure_upstream(or the ssh/tcp/udp upstream annotations).Related