Skip to content

Commit

Permalink
Update formatting for names and output in docs
Browse files Browse the repository at this point in the history
Ensure that Kubernetes names are properly capitalized. Also updated all console outputs to text formatting.
  • Loading branch information
sjberman committed Jul 17, 2023
1 parent acb377a commit cf02f86
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 75 deletions.
2 changes: 1 addition & 1 deletion conformance/provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ How to deploy:
```shell
kubectl get pods -n nginx-gateway
```
```console
```text
NAME READY STATUS RESTARTS AGE
nginx-gateway-provisioner-6c9d9fdcb8-b2pf8 1/1 Running 0 11m
```
6 changes: 3 additions & 3 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ These containers are deployed in a single Pod as a Kubernetes Deployment. The in

The `nginx-gateway`, or the control plane, is a [Kubernetes controller][controller], written with
the [controller-runtime][runtime] library. It watches Kubernetes objects (Services, Endpoints, Secrets, and Gateway API
CRDs), translates them to nginx configuration, and configures NGINX. This configuration happens in two stages. First,
CRDs), translates them to NGINX configuration, and configures NGINX. This configuration happens in two stages. First,
NGINX configuration files are written to the NGINX configuration volume shared by the `nginx-gateway` and `nginx`
containers. Next, the control plane reloads the NGINX process. This is possible because the two
containers [share a process namespace][share], which allows the NKG process to send signals to the NGINX master process.

The diagram below provides a visual representation of the interactions between processes within the nginx and
nginx-gateway containers, as well as external processes/entities. It showcases the connections and relationships between
The diagram below provides a visual representation of the interactions between processes within the `nginx` and
`nginx-gateway` containers, as well as external processes/entities. It showcases the connections and relationships between
these components. For the sake of simplicity, the `busybox` init container is not depicted in the diagram.

![NKG pod](/docs/images/nkg-pod.png)
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/design-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ improve performance.

## Resilience

We design with resilience in mind. This includes gracefully handling failures, such as pod restarts or network
We design with resilience in mind. This includes gracefully handling failures, such as Pod restarts or network
interruptions, as well as leveraging Kubernetes features like health checks, readiness probes, and container restart
policies.

Expand Down
4 changes: 1 addition & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ This guide walks you through how to install NGINX Kubernetes Gateway on a generi

```shell
git clone https://github.com/nginxinc/nginx-kubernetes-gateway.git
```
```shell
cd nginx-kubernetes-gateway
```

Expand Down Expand Up @@ -66,7 +64,7 @@ This guide walks you through how to install NGINX Kubernetes Gateway on a generi
```shell
kubectl get pods -n nginx-gateway
```
```console
```text
NAME READY STATUS RESTARTS AGE
nginx-gateway-5d4f4c7db7-xk2kq 2/2 Running 0 112s
```
Expand Down
8 changes: 4 additions & 4 deletions docs/resource-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ with the following error:
```shell
kubectl apply -f coffee-route.yaml
```
```
```text
The HTTPRoute "coffee" is invalid: spec.hostnames[0]: Invalid value: "cafe.!@#$%example.com": spec.hostnames[0] in body should match '^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$'
```

Expand All @@ -72,7 +72,7 @@ following error:
```shell
kubectl apply -f prod-gateway.yaml
```
```
```text
Error from server: error when creating "prod-gateway.yaml": admission webhook "validate.gateway.networking.k8s.io" denied the request: spec.listeners[1].hostname: Forbidden: should be empty for protocol TCP
```

Expand All @@ -91,7 +91,7 @@ hostname) with a Kubernetes event:
```shell
kubectl describe gateway prod-gateway
```
```
```text
. . .
Events:
Type Reason Age From Message
Expand Down Expand Up @@ -123,7 +123,7 @@ Below is an example of how NGK rejects an invalid resource. The validation error
```shell
kubectl describe httproutes.gateway.networking.k8s.io coffee
```
```
```text
. . .
Status:
Parents:
Expand Down
24 changes: 12 additions & 12 deletions examples/advanced-routing/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Advanced Routing

In this example we will deploy NGINX Kubernetes Gateway and configure advanced routing rules for a simple cafe application.
We will use `HTTPRoute` resources to route traffic to the cafe application based on a combination of the request method, headers, and query parameters.
We will use HTTPRoute resources to route traffic to the cafe application based on a combination of the request method, headers, and query parameters.

The cafe application consists of four Services: `coffee-v1-svc`, `coffee-v2-svc`, `tea-svc`, and `tea-post-svc`. In the next section we will create the following routing rules for the cafe application:
- For the path `/coffee` route requests with the header `version` set to `v2` or with the query param `TEST` set to `v2` to `coffee-v2-svc`, and all other requests to `coffee-v1-svc`.
Expand All @@ -11,7 +11,7 @@ The cafe application consists of four Services: `coffee-v1-svc`, `coffee-v2-svc`

## 1. Deploy NGINX Kubernetes Gateway

1. Follow the [installation instructions](/docs/installation.md) to deploy NGINX Gateway.
1. Follow the [installation instructions](/docs/installation.md) to deploy NGINX Kubernetes Gateway.

1. Save the public IP address of NGINX Kubernetes Gateway into a shell variable:

Expand All @@ -33,12 +33,12 @@ The cafe application consists of four Services: `coffee-v1-svc`, `coffee-v2-svc`
kubectl apply -f cafe.yaml
```

1. Check that the Pods are running in the `default` namespace:
1. Check that the Pods are running in the `default` Namespace:

```shell
kubectl -n default get pods
```
```console
```text
NAME READY STATUS RESTARTS AGE
coffee-v1-75869cf7ff-vlfpq 1/1 Running 0 17m
coffee-v2-67499ff985-2k6cc 1/1 Running 0 17m
Expand All @@ -48,13 +48,13 @@ The cafe application consists of four Services: `coffee-v1-svc`, `coffee-v2-svc`

## 3. Configure Routing

1. Create the `Gateway`:
1. Create the Gateway:

```shell
kubectl apply -f gateway.yaml
```

1. Create the `HTTPRoute` resources:
1. Create the HTTPRoute resources:

```shell
kubectl apply -f cafe-routes.yaml
Expand All @@ -71,7 +71,7 @@ Send a request with the header `version:v2` and confirm that the response comes
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/coffee -H "version:v2"
```
```
```text
Server address: 10.116.2.67:8080
Server name: coffee-v2-67499ff985-gw6vt
...
Expand All @@ -82,7 +82,7 @@ Send a request with the query parameter `TEST=v2` and confirm that the response
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/coffee?TEST=v2
```
```
```text
Server address: 10.116.2.67:8080
Server name: coffee-v2-67499ff985-gw6vt
...
Expand All @@ -93,7 +93,7 @@ Send a request without the header or the query parameter and confirm the respons
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/coffee
```
```
```text
Server address: 10.116.2.70:8080
Server name: coffee-v1-75869cf7ff-vlfpq
...
Expand All @@ -106,7 +106,7 @@ Send a POST request and confirm that the response comes from `tea-post-svc`:
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/tea -X POST
```
```
```text
Server address: 10.116.2.72:8080
Server name: tea-post-648dfcdd6c-2rlqb
...
Expand All @@ -117,7 +117,7 @@ Send a GET request and confirm that the response comes from `tea-svc`:
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/tea
```
```
```text
Server address: 10.116.3.30:8080
Server name: tea-6fb46d899f-hjzwr
...
Expand All @@ -130,7 +130,7 @@ Send a PUT request and confirm the 404 Not Found response:
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/tea -X PUT
```
```
```text
<html>
<head><title>404 Not Found</title></head>
<body>
Expand Down
16 changes: 8 additions & 8 deletions examples/cafe-example/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Example

In this example we deploy NGINX Kubernetes Gateway, a simple web application, and then configure NGINX Gateway to route traffic to that application using `HTTPRoute` resources.
In this example we deploy NGINX Kubernetes Gateway, a simple web application, and then configure NGINX Kubernetes Gateway to route traffic to that application using HTTPRoute resources.

## Running the Example

## 1. Deploy NGINX Kubernetes Gateway

1. Follow the [installation instructions](/docs/installation.md) to deploy NGINX Gateway.
1. Follow the [installation instructions](/docs/installation.md) to deploy NGINX Kubernetes Gateway.

1. Save the public IP address of NGINX Kubernetes Gateway into a shell variable:

Expand All @@ -28,26 +28,26 @@ In this example we deploy NGINX Kubernetes Gateway, a simple web application, an
kubectl apply -f cafe.yaml
```

1. Check that the Pods are running in the `default` namespace:
1. Check that the Pods are running in the `default` Namespace:

```shell
kubectl -n default get pods
```
```console
```text
NAME READY STATUS RESTARTS AGE
coffee-6f4b79b975-2sb28 1/1 Running 0 12s
tea-6fb46d899f-fm7zr 1/1 Running 0 12s
```

## 3. Configure Routing

1. Create the `Gateway`:
1. Create the Gateway:

```shell
kubectl apply -f gateway.yaml
```

1. Create the `HTTPRoute` resources:
1. Create the HTTPRoute resources:

```shell
kubectl apply -f cafe-routes.yaml
Expand All @@ -62,7 +62,7 @@ To get coffee:
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/coffee
```
```
```text
Server address: 10.12.0.18:80
Server name: coffee-7586895968-r26zn
```
Expand All @@ -72,7 +72,7 @@ To get tea:
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/tea
```
```
```text
Server address: 10.12.0.19:80
Server name: tea-7cd44fcb4d-xfw2x
```
Expand Down
26 changes: 13 additions & 13 deletions examples/cross-namespace-routing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in a different namespace from our HTTPRoutes.

## 1. Deploy NGINX Kubernetes Gateway

1. Follow the [installation instructions](/docs/installation.md) to deploy NGINX Gateway.
1. Follow the [installation instructions](/docs/installation.md) to deploy NGINX Kubernetes Gateway.

1. Save the public IP address of NGINX Kubernetes Gateway into a shell variable:

Expand All @@ -29,37 +29,37 @@ in a different namespace from our HTTPRoutes.
kubectl apply -f cafe-ns-and-app.yaml
```

1. Check that the Pods are running in the `cafe` namespace:
1. Check that the Pods are running in the `cafe` Namespace:

```shell
kubectl -n cafe get pods
```
```console
```text
NAME READY STATUS RESTARTS AGE
coffee-6f4b79b975-2sb28 1/1 Running 0 12s
tea-6fb46d899f-fm7zr 1/1 Running 0 12s
```

## 3. Configure Routing

1. Create the `Gateway`:
1. Create the Gateway:

```shell
kubectl apply -f gateway.yaml
```

1. Create the `HTTPRoute` resources:
1. Create the HTTPRoute resources:

```shell
kubectl apply -f cafe-routes.yaml
```
1. Create the `ReferenceGrant`:
1. Create the ReferenceGrant:

```shell
kubectl apply -f reference-grant.yaml
```
This ReferenceGrant allows all HTTPRoutes in the `default` namespace to reference all Services in the `cafe`
namespace.
This ReferenceGrant allows all HTTPRoutes in the `default` Namespace to reference all Services in the `cafe`
Namespace.

## 4. Test the Application

Expand All @@ -70,7 +70,7 @@ To get coffee:
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/coffee
```
```
```text
Server address: 10.12.0.18:80
Server name: coffee-7586895968-r26zn
```
Expand All @@ -80,7 +80,7 @@ To get tea:
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/tea
```
```
```text
Server address: 10.12.0.19:80
Server name: tea-7cd44fcb4d-xfw2x
```
Expand All @@ -98,7 +98,7 @@ Now, if we try to access the application over HTTP, we will get an internal serv
```shell
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/tea
```
```
```text
<html>
<head><title>500 Internal Server Error</title></head>
<body>
Expand All @@ -113,7 +113,7 @@ You can also check the conditions of the HTTPRoutes `coffee` and `tea` to verify
```shell
kubectl describe httproute coffee
```
```console
```text
Condtions:
Message: Backend ref to Service cafe/coffee not permitted by any ReferenceGrant
Observed Generation: 1
Expand All @@ -126,7 +126,7 @@ Condtions:
```shell
kubectl describe httproute tea
```
```console
```text
Condtions:
Message: Backend ref to Service cafe/tea not permitted by any ReferenceGrant
Observed Generation: 1
Expand Down
Loading

0 comments on commit cf02f86

Please sign in to comment.