Skip to content

Commit 9fd3dde

Browse files
Additional changes to types.go
1 parent 8225cda commit 9fd3dde

File tree

68 files changed

+12075
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+12075
-71
lines changed

docs/crd/k8s.nginx.org_transportservers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The `.spec` object supports the following fields:
3131
| `upstreamParameters` | `object` | UpstreamParameters defines parameters for an upstream. |
3232
| `upstreamParameters.connectTimeout` | `string` | The timeout for establishing a connection with a proxied server. The default is 60s. |
3333
| `upstreamParameters.nextUpstream` | `boolean` | If a connection to the proxied server cannot be established, determines whether a client connection will be passed to the next server. The default is true. |
34-
| `upstreamParameters.nextUpstreamTimeout` | `string` | The time allowed to pass a connection to the next server. The default us 0. |
34+
| `upstreamParameters.nextUpstreamTimeout` | `string` | The time allowed to pass a connection to the next server. The default is 0. |
3535
| `upstreamParameters.nextUpstreamTries` | `integer` | The number of tries for passing a connection to the next server. The default is 0. |
3636
| `upstreamParameters.udpRequests` | `integer` | The number of datagrams, after receiving which, the next datagram from the same client starts a new session. The default is 0. |
3737
| `upstreamParameters.udpResponses` | `integer` | The number of datagrams expected from the proxied server in response to a client datagram. By default, the number of datagrams is not limited. |
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Example
2+
3+
In this example we deploy the NGINX or NGINX Plus Ingress Controller, a simple web application and then configure load
4+
balancing for that application using the Ingress resource.
5+
6+
## Running the Example
7+
8+
## 1. Deploy the Ingress Controller
9+
10+
1. Follow the [installation](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/)
11+
instructions to deploy the Ingress Controller.
12+
13+
2. Save the public IP address of the Ingress Controller into a shell variable:
14+
15+
```console
16+
IC_IP=XXX.YYY.ZZZ.III
17+
```
18+
19+
3. Save the HTTPS port of the Ingress Controller into a shell variable:
20+
21+
```console
22+
IC_HTTPS_PORT=<port number>
23+
```
24+
25+
## 2. Deploy the Cafe Application
26+
27+
Create the coffee and the tea deployments and services:
28+
29+
```console
30+
kubectl create -f cafe.yaml
31+
```
32+
33+
## 3. Configure Load Balancing
34+
35+
1. Create a secret with an SSL certificate and a key:
36+
37+
```console
38+
kubectl create -f cafe-secret.yaml
39+
```
40+
41+
2. Create an Ingress resource:
42+
43+
```console
44+
kubectl create -f cafe-ingress.yaml
45+
```
46+
47+
## 4. Test the Application
48+
49+
1. To access the application, curl the coffee and the tea services. We'll use ```curl```'s --insecure option to turn off
50+
certificate verification of our self-signed certificate and the --resolve option to set the Host header of a request
51+
with ```cafe.example.com```
52+
53+
To get coffee:
54+
55+
```console
56+
curl --resolve cafe.example.com:$IC_HTTPS_PORT:$IC_IP https://cafe.example.com:$IC_HTTPS_PORT/coffee --insecure
57+
```
58+
59+
```text
60+
Server address: 10.12.0.18:80
61+
Server name: coffee-7586895968-r26zn
62+
...
63+
```
64+
65+
If your prefer tea:
66+
67+
```console
68+
$ curl --resolve cafe.example.com:$IC_HTTPS_PORT:$IC_IP https://cafe.example.com:$IC_HTTPS_PORT/tea --insecure
69+
70+
```text
71+
Server address: 10.12.0.19:80
72+
Server name: tea-7cd44fcb4d-xfw2x
73+
...
74+
```
75+
76+
1. You can view an NGINX status page, either stub_status for NGINX, or the Live Activity Monitoring Dashboard for NGINX
77+
Plus:
78+
1. Follow the [instructions](https://docs.nginx.com/nginx-ingress-controller/logging-and-monitoring/status-page/) to
79+
access the status page.
80+
1. For NGINX Plus, If you go to the Upstream tab, you'll see: ![dashboard](dashboard.png)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: cafe-ingress
5+
spec:
6+
ingressClassName: nginx
7+
tls:
8+
- hosts:
9+
- cafe.example.com
10+
secretName: cafe-secret
11+
rules:
12+
- host: cafe.example.com
13+
http:
14+
paths:
15+
- path: /tea
16+
pathType: Prefix
17+
backend:
18+
service:
19+
name: tea-svc
20+
port:
21+
number: 80
22+
- path: /coffee
23+
pathType: Prefix
24+
backend:
25+
service:
26+
name: coffee-svc
27+
port:
28+
number: 80
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common-secrets/cafe-secret-cafe.example.com.yaml
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: coffee
5+
spec:
6+
replicas: 2
7+
selector:
8+
matchLabels:
9+
app: coffee
10+
template:
11+
metadata:
12+
labels:
13+
app: coffee
14+
spec:
15+
containers:
16+
- name: coffee
17+
image: mohamadaldawamneh/http-echo:latest
18+
ports:
19+
- containerPort: 3333
20+
---
21+
apiVersion: v1
22+
kind: Service
23+
metadata:
24+
name: coffee-svc
25+
spec:
26+
ports:
27+
- port: 80
28+
targetPort: 3333
29+
protocol: TCP
30+
name: http
31+
selector:
32+
app: coffee
33+
---
347 KB
Loading
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Example
2+
3+
In this example we deploy the NGINX or NGINX Plus Ingress Controller, a simple web application and then configure load
4+
balancing for that application using the Ingress resource.
5+
6+
## Running the Example
7+
8+
## 1. Deploy the Ingress Controller
9+
10+
1. Follow the [installation](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/)
11+
instructions to deploy the Ingress Controller.
12+
13+
2. Save the public IP address of the Ingress Controller into a shell variable:
14+
15+
```console
16+
IC_IP=XXX.YYY.ZZZ.III
17+
```
18+
19+
3. Save the HTTPS port of the Ingress Controller into a shell variable:
20+
21+
```console
22+
IC_HTTPS_PORT=<port number>
23+
```
24+
25+
## 2. Deploy the Cafe Application
26+
27+
Create the coffee and the tea deployments and services:
28+
29+
```console
30+
kubectl create -f cafe.yaml
31+
```
32+
33+
## 3. Configure Load Balancing
34+
35+
1. Create a secret with an SSL certificate and a key:
36+
37+
```console
38+
kubectl create -f cafe-secret.yaml
39+
```
40+
41+
2. Create an Ingress resource:
42+
43+
```console
44+
kubectl create -f cafe-ingress.yaml
45+
```
46+
47+
## 4. Test the Application
48+
49+
1. To access the application, curl the coffee and the tea services. We'll use ```curl```'s --insecure option to turn off
50+
certificate verification of our self-signed certificate and the --resolve option to set the Host header of a request
51+
with ```cafe.example.com```
52+
53+
To get coffee:
54+
55+
```console
56+
curl --resolve cafe.example.com:$IC_HTTPS_PORT:$IC_IP https://cafe.example.com:$IC_HTTPS_PORT/coffee --insecure
57+
```
58+
59+
```text
60+
Server address: 10.12.0.18:80
61+
Server name: coffee-7586895968-r26zn
62+
...
63+
```
64+
65+
If your prefer tea:
66+
67+
```console
68+
$ curl --resolve cafe.example.com:$IC_HTTPS_PORT:$IC_IP https://cafe.example.com:$IC_HTTPS_PORT/tea --insecure
69+
70+
```text
71+
Server address: 10.12.0.19:80
72+
Server name: tea-7cd44fcb4d-xfw2x
73+
...
74+
```
75+
76+
1. You can view an NGINX status page, either stub_status for NGINX, or the Live Activity Monitoring Dashboard for NGINX
77+
Plus:
78+
1. Follow the [instructions](https://docs.nginx.com/nginx-ingress-controller/logging-and-monitoring/status-page/) to
79+
access the status page.
80+
1. For NGINX Plus, If you go to the Upstream tab, you'll see: ![dashboard](dashboard.png)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: mo-ingress
5+
spec:
6+
ingressClassName: nginx
7+
tls:
8+
- hosts:
9+
- mo.example.com
10+
secretName: mo-secret
11+
rules:
12+
- host: mo.example.com
13+
http:
14+
paths:
15+
- path: /
16+
pathType: Prefix
17+
backend:
18+
service:
19+
name: mo-webserver-svc
20+
port:
21+
number: 80
22+
- path: /about
23+
pathType: Prefix
24+
backend:
25+
service:
26+
name: mo-webserver-svc
27+
port:
28+
number: 80
29+
- path: /projects
30+
pathType: Prefix
31+
backend:
32+
service:
33+
name: mo-webserver-svc
34+
port:
35+
number: 80
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common-secrets/cafe-secret-cafe.example.com.yaml
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: mo-webserver
5+
spec:
6+
replicas: 2
7+
selector:
8+
matchLabels:
9+
app: mo-webserver
10+
template:
11+
metadata:
12+
labels:
13+
app: mo-webserver
14+
spec:
15+
containers:
16+
- name: mo-webserver
17+
image: mohamadaldawamneh/http-echo:latest
18+
ports:
19+
- containerPort: 3333
20+
env:
21+
- name: TEXT
22+
value: "Welcome to Mo's Website!"
23+
---
24+
apiVersion: v1
25+
kind: Service
26+
metadata:
27+
name: mo-webserver-svc
28+
spec:
29+
ports:
30+
- port: 80
31+
targetPort: 3333
32+
protocol: TCP
33+
name: http
34+
selector:
35+
app: mo-webserver
36+
---

0 commit comments

Comments
 (0)