10BC0 Revert "Update gc doc with vs listeners (#4492)" (#4498) · nginx/kubernetes-ingress@8880eda · GitHub
[go: up one dir, main page]

Skip to content

Commit 8880eda

Browse files
authored
Revert "Update gc doc with vs listeners (#4492)" (#4498)
1 parent e390768 commit 8880eda

File tree

1 file changed

+22
-48
lines changed

1 file changed

+22
-48
lines changed

docs/content/configuration/global-configuration/globalconfiguration-resource.md

Lines changed: 22 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,13 @@ docs: "DOCS-588"
99
---
1010

1111

12-
The GlobalConfiguration resource allows you to define the global configuration parameters of the Ingress Controller.
13-
The resource is implemented as a [Custom Resource](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/).
12+
The GlobalConfiguration resource allows you to define the global configuration parameters of the Ingress Controller. The resource is implemented as a [Custom Resource](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/).
1413

15-
The resource supports configuring listeners for TCP, UDP and HTTP/S load balancing. Listeners are required by
16-
[TransportServer resources](/nginx-ingress-controller/configuration/transportserver-resource) and
17-
can be used to configure custom listerners as specified [here](/nginx-ingress-controller/tutorials/virtual-server-with-custom-listener-ports)
14+
The resource supports configuring listeners for TCP and UDP load balancing. Listeners are required by [TransportServer resources](/nginx-ingress-controller/configuration/transportserver-resource).
1815

1916
## Prerequisites
2017

21-
When [installing](/nginx-ingress-controller/installation/installation-with-manifests) the Ingress Controller,
22-
you need to reference a GlobalConfiguration resource in the
23-
[`-global-configuration`](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments#cmdoption-global-configuration)
24-
command-line argument. The Ingress Controller only needs one GlobalConfiguration resource.
18+
When [installing](/nginx-ingress-controller/installation/installation-with-manifests) the Ingress Controller, you need to reference a GlobalConfiguration resource in the [`-global-configuration`](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments#cmdoption-global-configuration) command-line argument. The Ingress Controller only needs one GlobalConfiguration resource.
2519

2620
## GlobalConfiguration Specification
2721

@@ -41,13 +35,6 @@ spec:
4135
- name: dns-tcp
4236
port: 5353
4337
protocol: TCP
44-
- name: http-8083
45-
port: 8083
46-
protocol: HTTP
47-
- name: https-8443
48-
port: 8443
49-
protocol: HTTP
50-
ssl: true
5138
```
5239
5340
{{% table %}}
@@ -58,8 +45,7 @@ spec:
5845
5946
### Listener
6047
61-
The listener defines a listener (a combination of a protocol and a port) that NGINX will use to accept traffic for a
62-
[TransportServer](/nginx-ingress-controller/configuration/transportserver-resource) and a [VirtualServer](nginx-ingress-controller/configuration/virtualserver-and-virtualserverroute-resources):
48+
The listener defines a listener (a combination of a protocol and a port) that NGINX will use to accept traffic for a [TransportServer](/nginx-ingress-controller/configuration/transportserver-resource):
6349
6450
```yaml
6551
name: dns-tcp
@@ -80,17 +66,16 @@ protocol: TCP
8066
8167
You can use the usual `kubectl` commands to work with a GlobalConfiguration resource.
8268

83-
For example, the following command creates a GlobalConfiguration resource defined in `global-configuration.yaml` with
84-
the name `nginx-configuration`:
69+
For example, the following command creates a GlobalConfiguration resource defined in `global-configuration.yaml` with the name `nginx-configuration`:
8570

86-
```shell
71+
```
8772
$ kubectl apply -f global-configuration.yaml
8873
globalconfiguration.k8s.nginx.org/nginx-configuration created
8974
```
9075

9176
Assuming the namespace of the resource is `nginx-ingress`, you can get the resource by running:
9277

93-
```shell
78+
```
9479
$ kubectl get globalconfiguration nginx-configuration -n nginx-ingress
9580
NAME AGE
9681
nginx-configuration 13s
@@ -107,47 +92,39 @@ Two types of validation are available for the GlobalConfiguration resource:
10792

10893
#### Structural Validation
10994

110-
The custom resource definition for the GlobalConfiguration includes structural OpenAPI schema which describes the type
111-
of every field of the resource.
95+
The custom resource definition for the GlobalConfiguration includes structural OpenAPI schema which describes the type of every field of the resource.
11296

113-
If you try to create (or update) a resource that violates the structural schema (for example, you use a string value for
114-
the port field of a listener), `kubectl` and Kubernetes API server will reject such a resource:
97+
If you try to create (or update) a resource that violates the structural schema (for example, you use a string value for the port field of a listener), `kubectl` and Kubernetes API server will reject such a resource:
11598

11699
- Example of `kubectl` validation:
117100

118-
```shell
101+
```
119102
$ kubectl apply -f global-configuration.yaml
120103
error: error validating "global-configuration.yaml": error validating data: ValidationError(GlobalConfiguration.spec.listeners[0].port): invalid type for org.nginx.k8s.v1alpha1.GlobalConfiguration.spec.listeners.port: got "string", expected "integer"; if you choose to ignore these errors, turn validation off with --validate=false
121104
```
122105

123106
- Example of Kubernetes API server validation:
124107

125-
```shell
108+
```
126109
$ kubectl apply -f global-configuration.yaml --validate=false
127-
The GlobalConfiguration "nginx-configuration" is invalid: []: Invalid value: map[string]interface {}{ ... }: validation failure list:
128-
spec.listeners.port in body must be of type integer: "string"
110+
The GlobalConfiguration "nginx-configuration" is invalid: []: Invalid value: map[string]interface {}{ ... }: validation failure list:
111+
spec.listeners.port in body must be of type integer: "string"
129112
```
130113

131114
If a resource is not rejected (it doesn't violate the structural schema), the Ingress Controller will validate it further.
132115

133116
#### Comprehensive Validation
134117

135-
The Ingress Controller validates the fields of a GlobalConfiguration resource. If a resource is invalid,
136-
the Ingress Controller will not use it. Consider the following two cases:
118+
The Ingress Controller validates the fields of a GlobalConfiguration resource. If a resource is invalid, the Ingress Controller will not use it. Consider the following two cases:
137119

138-
1. When the Ingress Controller pod starts, if the GlobalConfiguration resource is invalid, the Ingress Controller will
139-
fail to start and exit with an error.
140-
2. When the Ingress Controller is running, if the GlobalConfiguration resource becomes invalid, the Ingress Controller
141-
will ignore the new version. It will report an error and continue to use the previous version. When the resource becomes
142-
valid again, the Ingress Controller will start using it.
120+
1. When the Ingress Controller pod starts, if the GlobalConfiguration resource is invalid, the Ingress Controller will fail to start and exit with an error.
121+
1. When the Ingress Controller is running, if the GlobalConfiguration resource becomes invalid, the Ingress Controller will ignore the new version. It will report an error and continue to use the previous version. When the resource becomes valid again, the Ingress Controller will start using it.
143122

144-
**Note**: If a GlobalConfiguration is deleted while the Ingress Controller is running, the controller will keep using
145-
the previous version of the resource.
123+
**Note**: If a GlobalConfiguration is deleted while the Ingress Controller is running, the controller will keep using the previous version of the resource.
146124

147-
You can check if the Ingress Controller successfully applied the configuration for a GlobalConfiguration.
148-
For our `nginx-configuration` GlobalConfiguration, we can run:
125+
You can check if the Ingress Controller successfully applied the configuration for a GlobalConfiguration. For our `nginx-configuration` GlobalConfiguration, we can run:
149126

150-
```shell
127+
```
151128
$ kubectl describe gc nginx-configuration -n nginx-ingress
152129
. . .
153130
Events:
@@ -156,14 +133,11 @@ Events:
156133
Normal Updated 11s nginx-ingress-controller GlobalConfiguration nginx-ingress/nginx-configuration was updated
157134
```
158135

159-
Note how the events section includes a Normal event with the Updated reason that informs us that the configuration was
160-
successfully applied.
136+
Note how the events section includes a Normal event with the Updated reason that informs us that the configuration was successfully applied.
161137

162-
If you create an invalid resource, the Ingress Controller will reject it and emit a Rejected event. For example, if you
163-
create a GlobalConfiguration `nginx-configuration` with two or more listeners that have the same protocol UDP and port 53,
164-
you will get:
138+
If you create an invalid resource, the Ingress Controller will reject it and emit a Rejected event. For example, if you create a GlobalConfiguration `nginx-configuration` with two or more listeners that have the same protocol UDP and port 53, you will get:
165139

166-
```shell
140+
```
167141
$ kubectl describe gc nginx-configuration -n nginx-ingress
168142
. . .
169143
Events:

0 commit comments

Comments
 (0)
0