-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55a1ffb
commit 1681fc7
Showing
26 changed files
with
574 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
defaultPlatforms: | ||
- linux/arm64 | ||
- linux/amd64 | ||
builds: | ||
- id: svc-ingress-propagator | ||
main: cmd/main.go | ||
ldflags: | ||
- '{{ if index .Env "LD_FLAGS" }}{{ .Env.LD_FLAGS }}{{ end }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Version | ||
GIT_HEAD_COMMIT ?= $(shell git rev-parse --short HEAD) | ||
VERSION ?= $(or $(shell git describe --abbrev=0 --tags --match "v*" 2>/dev/null),$(GIT_HEAD_COMMIT)) | ||
|
||
# Defaults | ||
REGISTRY ?= ghcr.io | ||
REPOSITORY ?= buttahtoast/svc-ingress-propagator | ||
GIT_TAG_COMMIT ?= $(shell git rev-parse --short $(VERSION)) | ||
GIT_MODIFIED_1 ?= $(shell git diff $(GIT_HEAD_COMMIT) $(GIT_TAG_COMMIT) --quiet && echo "" || echo ".dev") | ||
GIT_MODIFIED_2 ?= $(shell git diff --quiet && echo "" || echo ".dirty") | ||
GIT_MODIFIED ?= $(shell echo "$(GIT_MODIFIED_1)$(GIT_MODIFIED_2)") | ||
GIT_REPO ?= $(shell git config --get remote.origin.url) | ||
BUILD_DATE ?= $(shell git log -1 --format="%at" | xargs -I{} sh -c 'if [ "$(shell uname)" = "Darwin" ]; then date -r {} +%Y-%m-%dT%H:%M:%S; else date -d @{} +%Y-%m-%dT%H:%M:%S; fi') | ||
IMG_BASE ?= $(REPOSITORY) | ||
IMG ?= $(IMG_BASE):$(VERSION) | ||
FULL_IMG ?= $(REGISTRY)/$(IMG_BASE) | ||
|
||
|
||
# Docker Image Build | ||
# ------------------ | ||
|
||
.PHONY: ko-build-controller | ||
ko-build-controller: ko | ||
@echo Building Controller $(FULL_IMG) - $(KO_TAGS) >&2 | ||
@LD_FLAGS=$(LD_FLAGS) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=$(FULL_IMG) \ | ||
$(KO) build ./cmd/ --bare --tags=$(KO_TAGS) --push=false --local | ||
|
||
.PHONY: ko-build-all | ||
ko-build-all: ko-build-controller | ||
|
||
# Docker Image Publish | ||
# ------------------ | ||
|
||
REGISTRY_PASSWORD ?= dummy | ||
REGISTRY_USERNAME ?= dummy | ||
|
||
.PHONY: ko-login | ||
ko-login: ko | ||
@$(KO) login $(REGISTRY) --username $(REGISTRY_USERNAME) --password $(REGISTRY_PASSWORD) | ||
|
||
.PHONY: ko-publish-controller | ||
ko-publish-controller: ko-login | ||
@LD_FLAGS=$(LD_FLAGS) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=$(FULL_IMG) \ | ||
$(KO) build . --bare --tags=$(KO_TAGS) | ||
|
||
.PHONY: ko-publish-all | ||
ko-publish-all: ko-publish-controller | ||
|
||
|
||
KO = $(shell pwd)/bin/ko | ||
KO_VERSION = v0.14.1 | ||
ko: | ||
$(call go-install-tool,$(KO),github.com/google/ko@v0.14.1) | ||
|
||
# go-install-tool will 'go install' any package $2 and install it to $1. | ||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
define go-install-tool | ||
@[ -f $(1) ] || { \ | ||
set -e ;\ | ||
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\ | ||
} | ||
endef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,22 @@ | ||
# svc-ingress-propagator | ||
Propagtes Loadbalancer Services as Ingress to Loadbalancer cluster | ||
|
||
|
||
|
||
# Target Cluster | ||
|
||
Ensure the following is applied on the target cluster: | ||
|
||
``` | ||
``` | ||
|
||
|
||
## KubeConfig | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.