Skip to content

Commit f742479

Browse files
docs: add apisix.apache.org/parameters-namespace to annotation doc (#2702) (#385)
(cherry picked from commit 2b7b24780c51932e5fec4c630e9200b2a8cbf955) Co-authored-by: Traky Deng <trakydeng@gmail.com>
1 parent fdbed99 commit f742479

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

docs/en/latest/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"reference/example",
4242
"reference/troubleshoot",
4343
"reference/configuration-file",
44-
"reference/ingress-annotation"
44+
"reference/annotations"
4545
]
4646
},
4747
{

docs/en/latest/reference/ingress-annotation.md renamed to docs/en/latest/reference/annotations.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: Ingress Annotations
2+
title: Annotations
33
slug: /reference/apisix-ingress-controller/annotation
4-
description: Learn how annotations extend the functionality of Kubernetes Ingress resource in APISIX Ingress Controller to configure routing, security, and gateway behaviors.
4+
description: Learn how annotations extend the functionality of Kubernetes Ingress and IngressClass resource in APISIX Ingress Controller to configure routing, security, and gateway behaviors.
55
---
66

7-
Annotations are key-value pairs that allow controllers to configure functionalities that are not available through standard Kubernetes resource fields. In APISIX Ingress Controller, annotations are commonly used with Ingress resources to configure gateway behaviors, routing rules, upstream settings, plugins, and other features. Alternatively, you can use APISIX CRDs to configure these features for a better experience.
7+
Annotations are key-value pairs that allow controllers to configure functionalities that are not available through standard Kubernetes resource fields. In APISIX Ingress Controller, annotations are commonly used to configure gateway behaviors, routing rules, upstream settings, plugins, and other features. Alternatively, you can use APISIX CRDs to configure these features for a better experience.
88

99
This document describes all available annotations and their uses.
1010

11-
## All Annotations
11+
## Ingress Annotations
1212

1313
| Annotation |
1414
| ------------------------------------------------------ |
@@ -52,6 +52,12 @@ This document describes all available annotations and their uses.
5252
| `k8s.apisix.apache.org/auth-type` |
5353
| `k8s.apisix.apache.org/svc-namespace` |
5454

55+
## IngressClass Annotations
56+
57+
| Annotation |
58+
| ------------------------------------------------------ |
59+
| `apisix.apache.org/parameters-namespace` |
60+
5561
## Annotation Details
5662

5763
Note that annotation keys and values can only be strings.
@@ -272,8 +278,9 @@ apiVersion: networking.k8s.io/v1
272278
kind: Ingress
273279
metadata:
274280
name: cross-namespace-ingress
281+
namespace: aic # Ingress is in aic namespace
275282
annotations:
276-
k8s.apisix.apache.org/svc-namespace: "other-namespace"
283+
k8s.apisix.apache.org/svc-namespace: "other-namespace" # Service is in other-namespace
277284
spec:
278285
ingressClassName: apisix
279286
rules:
@@ -610,3 +617,26 @@ spec:
610617
port:
611618
number: 80
612619
```
620+
621+
### GatewayProxy Namespace Specification
622+
623+
The `apisix.apache.org/parameters-namespace` annotation enables the specification of a custom namespace for GatewayProxy resources referenced by an IngressClass. This is used when a GatewayProxy resource resides in a specific namespace, as IngressClass is cluster-scoped and requires the namespace to locate the resource.
624+
625+
The annotation takes precedence over the `parameters.namespace` field in the IngressClass spec. If neither is specified, it defaults to the `default` namespace.
626+
627+
For example:
628+
629+
```yaml
630+
apiVersion: networking.k8s.io/v1
631+
kind: IngressClass
632+
metadata:
633+
name: apisix
634+
annotations:
635+
apisix.apache.org/parameters-namespace: "apisix-system"
636+
spec:
637+
controller: apisix.apache.org/ingress-controller
638+
parameters:
639+
apiGroup: apisix.apache.org
640+
kind: GatewayProxy
641+
name: apisix-config
642+
```

0 commit comments

Comments
 (0)