Skip to content

Commit 2e205d9

Browse files
author
Kate Osborn
committed
Update architecture doc and diagram
1 parent eb08aba commit 2e205d9

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

docs/architecture.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,33 @@ parentheses. To enhance readability, the suffix "process" has been omitted from
9898

9999
1. (HTTPS) *NKG* reads the *Kubernetes API* to get the latest versions of the resources in the cluster and writes to the
100100
API to update the handled resources' statuses and emit events.
101-
2. (File I/O) *NKG* generates NGINX *configuration* based on the cluster resources and writes them as `.conf` files to
102-
the mounted `nginx` volume, located at `/etc/nginx`. It also writes *TLS certificates* and *keys*
103-
from [TLS Secrets][secrets] referenced in the accepted Gateway resource to the volume at the
104-
path `/etc/nginx/secrets`.
101+
2. (File I/O)
102+
- Write: *NKG* generates NGINX *configuration* based on the cluster resources and writes them as `.conf` files to the
103+
mounted `nginx-conf` volume, located at `/etc/nginx/conf.d`. It also writes *TLS certificates* and *keys*
104+
from [TLS Secrets][secrets] referenced in the accepted Gateway resource to the `nginx-secrets` volume at the
105+
path `/etc/nginx/secrets`.
106+
- Read: *NKG* reads the PID file `nginx.pid` from the `nginx-var-run` volume, located at `/var/run/nginx`. *NKG*
107+
extracts the PID of the nginx process from this file in order to send reload signals to *NGINX master*.
105108
3. (File I/O) *NKG* writes logs to its *stdout* and *stderr*, which are collected by the container runtime.
106109
4. (Signal) To reload NGINX, *NKG* sends the [reload signal][reload] to the **NGINX master**.
107-
5. (File I/O) The *NGINX master* reads *configuration files* and the *TLS cert and keys* referenced in the
108-
configuration when it starts or during a reload. These files, certificates, and keys are stored in the `nginx` volume
109-
that is mounted to both the `nginx-gateway` and `nginx` containers.
110-
6. (File I/O): The *NGINX master* writes to the auxiliary Unix sockets folder, which is mounted to the `nginx`
111-
container as the `var-lib-nginx` volume. The mounted path for this volume is `/var/lib/nginx`.
110+
5. (File I/O)
111+
- Write: The *NGINX master* writes its PID to the `nginx.pid` file stored in the `nginx-var-run` volume.
112+
- Read: The *NGINX master* reads *configuration files* and the *TLS cert and keys* referenced in the configuration when
113+
it starts or during a reload. These files, certificates, and keys are stored in the `nginx-conf` and `nginx-secrets`
114+
volumes that are mounted to both the `nginx-gateway` and `nginx` containers.
115+
6. (File I/O)
116+
- Write: The *NGINX master* writes to the auxiliary Unix sockets folder, which is located in the `/var/lib/nginx`
117+
directory.
118+
- Read: The *NGINX master* reads the `nginx.conf` file from the `/etc/nginx` directory. This [file][conf-file] contains
119+
the global and http configuration settings for NGINX. In addition, *NGINX master*
120+
reads the NJS modules referenced in the configuration when it starts or during a reload. NJS modules are stored in
121+
the `/usr/lib/nginx/modules` directory.
112122
7. (File I/O) The *NGINX master* sends logs to its *stdout* and *stderr*, which are collected by the container runtime.
113-
8. (File I/O): The *NGINX master* reads the NJS modules referenced in the configuration when it starts or during a
114-
reload. NJS modules are stored in the `njs-modules` volume that is mounted to the `nginx` container.
115-
9. (File I/O) An *NGINX worker* writes logs to its *stdout* and *stderr*, which are collected by the container runtime.
116-
10. (File I/O): The *NGINX master* reads the `nginx.conf` file from the mounted `nginx-conf` volume.
117-
This [file][conf-file] contains the global and http configuration settings for NGINX.
118-
11. (Signal) The *NGINX master* controls the [lifecycle of *NGINX workers*][lifecycle] it creates workers with the new
123+
8. (File I/O) An *NGINX worker* writes logs to its *stdout* and *stderr*, which are collected by the container runtime.
124+
9. (Signal) The *NGINX master* controls the [lifecycle of *NGINX workers*][lifecycle] it creates workers with the new
119125
configuration and shutdowns workers with the old configuration.
120-
12. (HTTP,HTTPS) A *client* sends traffic to and receives traffic from any of the *NGINX workers* on ports 80 and 443.
121-
13. (HTTP,HTTPS) An *NGINX worker* sends traffic to and receives traffic from the *backends*.
126+
10. (HTTP,HTTPS) A *client* sends traffic to and receives traffic from any of the *NGINX workers* on ports 80 and 443.
127+
11. (HTTP,HTTPS) An *NGINX worker* sends traffic to and receives traffic from the *backends*.
122128

123129
[controller]: https://kubernetes.io/docs/concepts/architecture/controller/
124130

@@ -130,6 +136,6 @@ configuration and shutdowns workers with the old configuration.
130136

131137
[lifecycle]: https://nginx.org/en/docs/control.html#reconfiguration
132138

133-
[conf-file]: https://github.com/nginxinc/nginx-kubernetes-gateway/blob/main/deploy/manifests/nginx-conf.yaml
139+
[conf-file]: https://github.com/nginxinc/nginx-kubernetes-gateway/blob/main/internal/mode/static/nginx/conf/nginx.conf
134140

135141
[share]: https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/

docs/images/nkg-pod.png

4.83 KB
Loading

0 commit comments

Comments
 (0)