Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexFenlon committed Sep 5, 2024
1 parent 5b514b6 commit f7a6372
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ The `listeners:` key defines a listener (a combination of a protocol and a port)
| *port* | The port of the listener. The port must fall into the range ``1..65535`` with the following exceptions: ``80``, ``443``, the [status port](/nginx-ingress-controller/logging-and-monitoring/status-page), the [Prometheus metrics port](/nginx-ingress-controller/logging-and-monitoring/prometheus). Among all listeners, only a single combination of a port-protocol is allowed. | *int* | Yes |
| *protocol* | The protocol of the listener. Supported values: ``TCP``, ``UDP`` and ``HTTP``. | *string* | Yes |
| *ssl* | Configures the listener with SSL. This is currently only supported for ``HTTP`` listeners. Default value is ``false`` | *bool* | No |
| *ipv4ip* | Specifies the IPv4 address to listen on. This is currently only supported for ``HTTP`` or ``HTTPS`` listeners. | *string* | No |
| *ipv6ip* | Specifies the IPv6 address to listen on. This is currently only supported for ``HTTP`` or ``HTTPS`` listeners. | *string* | No |
| *ipv4* | Specifies the IPv4 address to listen on. This is currently only supported for ``HTTP`` or ``HTTPS`` listeners. | *string* | No |
| *ipv6* | Specifies the IPv6 address to listen on. This is currently only supported for ``HTTP`` or ``HTTPS`` listeners. | *string* | No |

{{</bootstrap-table>}}

Expand Down Expand Up @@ -178,6 +178,6 @@ Events:
The events section includes a Warning event with the AddedOrUpdatedWithError reason.


## Using IPV4 and IPV6 IP Addresses with GlobalConfiguration
## Using IPV4 and IPV6 Addresses with GlobalConfiguration

You can customize the IP listeners with IPv4 and IPv6 in the global configuration and apply them to your VirtualServer resources. See the corresponding example [here](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/custom-resources/custom-ip-listeners/virtualserver/)
You can customize the IPv4 and IPv6 Address listeners in the global configuration and apply them to your VirtualServer resources. See the corresponding example [here](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/custom-resources/custom-ip-listeners/virtualserver/)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Custom IPv4 and IPv6 IP Listeners
# Custom IPv4 and IPv6 Address Listeners

In this example, we will configure a VirtualServer resource with a custom IPv4 or IPv6 IP using HTTP/HTTPS listeners.
This will allow IPv4 and/or IPv6 IPs using HTTP and/or HTTPS based requests to be made on non-default ports using separate IPs.
In this example, we will configure a VirtualServer resource with custom IPv4 and IPv6 Address using HTTP/HTTPS listeners.
This will allow IPv4 and/or IPv6 address using HTTP and/or HTTPS based requests to be made on non-default ports using separate IPs.

## Prerequisites

Expand Down Expand Up @@ -59,12 +59,12 @@ spec:
- name: ip-listener-1-http
port: 8083
protocol: HTTP
ipv4ip: 127.0.0.1
ipv4: 127.0.0.1
- name: ip-listener-2-https
port: 8443
protocol: HTTP
ipv4ip: 127.0.0.2
ipv6ip: ::1
ipv4: 127.0.0.2
ipv6: ::1
ssl: true
```
Expand Down Expand Up @@ -159,12 +159,12 @@ that was deployed in Step 1. Below is the yaml of this example VirtualServer:
. . .
Spec:
Listeners:
ipv4ip: 127.0.0.1
ipv4: 127.0.0.1
Name: ip-listener-1-http
Port: 8083
Protocol: HTTP
ipv4ip: 127.0.0.2
ipv6ip: ::1
ipv4: 127.0.0.2
ipv6: ::1
Name: ip-listener-2-https
Port: 8443
Protocol: HTTP
Expand Down
4 changes: 2 additions & 2 deletions internal/configs/version2/template_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ func buildListenDirective(ip string, port string, proxyProtocol bool, ipType ipT
return directive
}

func buildTransportListenDirective(listenType ipType, port string, ssl *StreamSSL, udp bool) string {
func buildTransportListenDirective(ipType ipType, port string, ssl *StreamSSL, udp bool) string {
base := "listen"
var directive string

if listenType == ipv6 {
if ipType == ipv6 {
directive = base + " [::]:" + port
} else {
directive = base + " " + port
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ spec:
- name: http-8085
port: 8085
protocol: HTTP
ipv4ip: 127.0.0.1
ipv6ip: ::1
ipv4: 127.0.0.1
ipv6: ::1
- name: https-8445
port: 8445
protocol: HTTP
ipv4ip: 127.0.0.2
ipv6ip: ::1
ipv4: 127.0.0.2
ipv6: ::1
ssl: true
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ spec:
- name: http-8085
port: 8085
protocol: HTTP
ipv4ip: 127.0.0.1
ipv4: 127.0.0.1
- name: https-8445
port: 8445
protocol: HTTP
ipv6ip: ::1
ipv6: ::1
ssl: true
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
- name: http-8085
port: 8085
protocol: HTTP
ipv4ip: 127.0.0.1
ipv4: 127.0.0.1
- name: https-8445
port: 8445
protocol: HTTP
Expand Down

0 comments on commit f7a6372

Please sign in to comment.