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
Problem: NKG cannot be scaled horizontally because all replicas will write statuses to
the Gateway API resources.
Solution: Add leader election to the status updater so that only one replica of NKG
will write statuses to the Gateway API resources. Leader election is enabled by
default but can be disabled via a cli arg --leader-election-disable. The lock name
used for leader election can be configured via the cli arg --leader-election-lock-name.
Copy file name to clipboardExpand all lines: Makefile
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,8 @@ TAG ?= $(VERSION:v%=%)## The tag of the image. For example, 0.3.0
19
19
TARGET ?= local## The target of the build. Possible values: local and container
20
20
KIND_KUBE_CONFIG=$${HOME}/.kube/kind/config## The location of the kind kubeconfig
21
21
OUT_DIR ?= $(shell pwd)/build/out## The folder where the binary will be stored
22
-
ARCH ?= amd64## The architecture of the image and/or binary. For example: amd64 or arm64
22
+
GOARCH ?= amd64## The architecture of the image and/or binary. For example: amd64 or arm64
23
+
GOOS ?= linux## The OS of the image and/or binary. For example: linux or darwin
23
24
override HELM_TEMPLATE_COMMON_ARGS += --set creator=template --set nameOverride=nginx-gateway## The common options for the Helm template command.
24
25
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.
@@ -49,13 +50,13 @@ check-for-docker: ## Check if Docker is installed
49
50
build: ## Build the binary
50
51
ifeq (${TARGET},local)
51
52
@go version || (code=$$?; printf "\033[0;31mError\033[0m: unable to build locally\n"; exit $$code)
52
-
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -trimpath -a -ldflags "$(GO_LINKER_FLAGS)" $(ADDITIONAL_GO_BUILD_FLAGS) -o $(OUT_DIR)/gateway github.com/nginxinc/nginx-kubernetes-gateway/cmd/gateway
53
+
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -trimpath -a -ldflags "$(GO_LINKER_FLAGS)" $(ADDITIONAL_GO_BUILD_FLAGS) -o $(OUT_DIR)/gateway github.com/nginxinc/nginx-kubernetes-gateway/cmd/gateway
53
54
endif
54
55
55
56
.PHONY: build-goreleaser
56
57
build-goreleaser: ## Build the binary using GoReleaser
57
58
@goreleaser -v || (code=$$?;printf"\033[0;31mError\033[0m: there was a problem with GoReleaser. Follow the docs to install it https://goreleaser.com/install\n";exit$$code)
0 commit comments