You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the publicly available nginx image with a custom nginx image.
Problem: Using the publicly available nginx image requires users to create
ConfigMaps for the nginx.conf file and the njs module and mount them to
the NKG Pod as volumes. This pattern is not extensible and adds extra
steps for developers and users. Additionally, an init container is required
in order to set up the nginx config environment.
Solution: Build and use a custom nginx container. The nginx.conf and njs module
are now baked into the nginx image. This eliminates the need for ConfigMaps.
The config directories /etc/nginx/conf.d and /etc/nginx/secrets are created as
volumes and mounted to the Pod with a group ID 1001. This allows the control
plane to write to the directories and nginx to read from them. Both the nginx
and nginx-gateway processes run under group ID 1001 but have different
user IDs (101 and 102). The nginx container runs as user 101 instead of root
and runs with the minimum set of capabilities.
PREFIX ?= nginx-kubernetes-gateway## The name of the image. For example, nginx-kubernetes-gateway
16
+
PREFIX ?= nginx-kubernetes-gateway## The name of the NKG image. For example, nginx-kubernetes-gateway
17
+
NGINX_PREFIX ?= $(PREFIX)/nginx## The name of the nginx image. For example: nginx-kubernetes-gateway/nginx
16
18
TAG ?= $(VERSION:v%=%)## The tag of the image. For example, 0.3.0
17
19
TARGET ?= local## The target of the build. Possible values: local and container
18
20
KIND_KUBE_CONFIG=$${HOME}/.kube/kind/config## The location of the kind kubeconfig
@@ -21,19 +23,29 @@ ARCH ?= amd64## The architecture of the image and/or binary. For example: amd64
21
23
override HELM_TEMPLATE_COMMON_ARGS += --set creator=template --set nameOverride=nginx-gateway## The common options for the Helm template command.
22
24
override HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE += --set service.create=false## The options to be passed to the full Helm templating command only.
23
25
override DOCKER_BUILD_OPTIONS += --build-arg VERSION=$(VERSION) --build-arg GIT_COMMIT=$(GIT_COMMIT) --build-arg DATE=$(DATE)## The options for the docker build command. For example, --pull
0 commit comments