1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Feature] Add ARM64 Image Support (#838)

This commit is contained in:
Adam Janikowski 2021-11-22 11:57:45 +01:00 committed by GitHub
parent 0d814a796e
commit b87b6419db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 38 additions and 22 deletions

2
.gitignore vendored
View file

@ -8,3 +8,5 @@ vendor/
deps/ deps/
.vscode/ .vscode/
**/*.enterprise.go **/*.enterprise.go
**/enterprise/**
enterprise.mk

View file

@ -8,6 +8,7 @@
- Add Watch to Lifecycle command - Add Watch to Lifecycle command
- Add Topology Discovery - Add Topology Discovery
- Add Support for StartupProbe - Add Support for StartupProbe
- Add ARM64 support for Operator Docker image
## [1.2.4](https://github.com/arangodb/kube-arangodb/tree/1.2.4) (2021-10-22) ## [1.2.4](https://github.com/arangodb/kube-arangodb/tree/1.2.4) (2021-10-22)
- Replace `beta.kubernetes.io/arch` Pod label with `kubernetes.io/arch` using Silent Rotation - Replace `beta.kubernetes.io/arch` Pod label with `kubernetes.io/arch` using Silent Rotation

View file

@ -12,6 +12,8 @@ LABEL name="kube-arangodb" \
ADD ./LICENSE /licenses/LICENSE ADD ./LICENSE /licenses/LICENSE
ADD bin/arangodb_operator /usr/bin/ ARG RELEASE_MODE=community
ARG TARGETARCH=amd64
ADD bin/${RELEASE_MODE}/linux/${TARGETARCH}/arangodb_operator /usr/bin/arangodb_operator
ENTRYPOINT [ "/usr/bin/arangodb_operator" ] ENTRYPOINT [ "/usr/bin/arangodb_operator" ]

View file

@ -12,6 +12,10 @@ COMMIT := $(shell git rev-parse --short HEAD)
DOCKERCLI := $(shell which docker) DOCKERCLI := $(shell which docker)
RELEASE_MODE ?= community RELEASE_MODE ?= community
include $(ROOT)/$(RELEASE_MODE).mk
MAIN_DIR := $(ROOT)/pkg/entry/$(RELEASE_MODE)
GOBUILDDIR := $(SCRIPTDIR)/.gobuild GOBUILDDIR := $(SCRIPTDIR)/.gobuild
SRCDIR := $(SCRIPTDIR) SRCDIR := $(SCRIPTDIR)
CACHEVOL := $(PROJECT)-gocache CACHEVOL := $(PROJECT)-gocache
@ -119,14 +123,15 @@ endif
BINNAME := $(PROJECT) BINNAME := $(PROJECT)
BIN := $(BINDIR)/$(BINNAME) BIN := $(BINDIR)/$(BINNAME)
VBIN := $(BINDIR)/$(RELEASE_MODE)/$(BINNAME) VBIN_LINUX_AMD64 := $(BINDIR)/$(RELEASE_MODE)/linux/amd64/$(BINNAME)
VBIN_LINUX_ARM64 := $(BINDIR)/$(RELEASE_MODE)/linux/arm64/$(BINNAME)
ifdef VERBOSE ifdef VERBOSE
TESTVERBOSEOPTIONS := -v TESTVERBOSEOPTIONS := -v
endif endif
EXCLUDE_DIRS := tests vendor .gobuild deps tools EXCLUDE_DIRS := tests vendor .gobuild deps tools
SOURCES_QUERY := find ./ -type f -name '*.go' $(foreach EXCLUDE_DIR,$(EXCLUDE_DIRS), ! -path "./$(EXCLUDE_DIR)/*") SOURCES_QUERY := find ./ -type f -name '*.go' $(foreach EXCLUDE_DIR,$(EXCLUDE_DIRS), ! -path "*/$(EXCLUDE_DIR)/*")
SOURCES := $(shell $(SOURCES_QUERY)) SOURCES := $(shell $(SOURCES_QUERY))
DASHBOARDSOURCES := $(shell find $(DASHBOARDDIR)/src -name '*.js') $(DASHBOARDDIR)/package.json DASHBOARDSOURCES := $(shell find $(DASHBOARDDIR)/src -name '*.js') $(DASHBOARDDIR)/package.json
LINT_EXCLUDES:= LINT_EXCLUDES:=
@ -193,7 +198,7 @@ endif
.PHONY: clean .PHONY: clean
clean: clean:
rm -Rf $(BIN) $(BINDIR) $(DASHBOARDDIR)/build $(DASHBOARDDIR)/node_modules rm -Rf $(BIN) $(BINDIR) $(DASHBOARDDIR)/build $(DASHBOARDDIR)/node_modules $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64)
.PHONY: check-vars .PHONY: check-vars
check-vars: check-vars:
@ -245,27 +250,33 @@ dashboard/assets.go:
$(DASHBOARDBUILDIMAGE) $(DASHBOARDBUILDIMAGE)
$(GOPATH)/bin/go-assets-builder -s /dashboard/build/ -o dashboard/assets.go -p dashboard dashboard/build $(GOPATH)/bin/go-assets-builder -s /dashboard/build/ -o dashboard/assets.go -p dashboard dashboard/build
.PHONY: bin .PHONY: bin bin-all
bin: $(BIN) bin: $(BIN)
bin-all: $(BIN) $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64)
$(VBIN): $(SOURCES) dashboard/assets.go VERSION $(VBIN_LINUX_AMD64): $(SOURCES) dashboard/assets.go VERSION
@mkdir -p $(VBINDIR) @mkdir -p $(BINDIR)/$(RELEASE_MODE)/linux/amd64
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build --tags "$(RELEASE_MODE)" -installsuffix netgo -ldflags "-X $(REPOPATH)/pkg/version.version=$(VERSION) -X $(REPOPATH)/pkg/version.buildDate=$(BUILDTIME) -X $(REPOPATH)/pkg/version.build=$(COMMIT)" -o $(VBIN) $(REPOPATH) CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build --tags "$(RELEASE_MODE)" -installsuffix netgo -ldflags "-X $(REPOPATH)/pkg/version.version=$(VERSION) -X $(REPOPATH)/pkg/version.buildDate=$(BUILDTIME) -X $(REPOPATH)/pkg/version.build=$(COMMIT)" -o $(VBIN_LINUX_AMD64) ./main.go
$(BIN): $(VBIN) $(VBIN_LINUX_ARM64): $(SOURCES) dashboard/assets.go VERSION
@cp "$(VBIN)" "$(BIN)" @mkdir -p $(BINDIR)/$(RELEASE_MODE)/linux/arm64
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build --tags "$(RELEASE_MODE)" -installsuffix netgo -ldflags "-X $(REPOPATH)/pkg/version.version=$(VERSION) -X $(REPOPATH)/pkg/version.buildDate=$(BUILDTIME) -X $(REPOPATH)/pkg/version.build=$(COMMIT)" -o $(VBIN_LINUX_ARM64) ./main.go
$(BIN): $(VBIN_LINUX_AMD64)
@cp "$(VBIN_LINUX_AMD64)" "$(BIN)"
.PHONY: docker .PHONY: docker
docker: check-vars $(BIN) docker: check-vars $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64)
docker build --no-cache -f $(DOCKERFILE) --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" -t $(OPERATORIMAGE) .
ifdef PUSHIMAGES ifdef PUSHIMAGES
docker push $(OPERATORIMAGE) docker buildx build --no-cache -f $(DOCKERFILE) --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --platform linux/amd64,linux/arm64 --push -t $(OPERATORIMAGE) .
else
docker buildx build --no-cache -f $(DOCKERFILE) --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --platform linux/amd64,linux/arm64 -t $(OPERATORIMAGE) .
endif endif
.PHONY: docker-ubi .PHONY: docker-ubi
docker-ubi: check-vars $(BIN) docker-ubi: check-vars $(VBIN_LINUX_AMD64)
docker build --no-cache -f "$(DOCKERFILE).ubi" --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "IMAGE=$(BASEUBIIMAGE)" -t $(OPERATORUBIIMAGE)-local-only-build . docker build --no-cache -f "$(DOCKERFILE).ubi" --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --build-arg "IMAGE=$(BASEUBIIMAGE)" -t $(OPERATORUBIIMAGE)-local-only-build .
docker build --no-cache -f $(DOCKERFILE) --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "IMAGE=$(OPERATORUBIIMAGE)-local-only-build" -t $(OPERATORUBIIMAGE) . docker build --no-cache -f $(DOCKERFILE) --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --build-arg "IMAGE=$(OPERATORUBIIMAGE)-local-only-build" -t $(OPERATORUBIIMAGE) .
ifdef PUSHIMAGES ifdef PUSHIMAGES
docker push $(OPERATORUBIIMAGE) docker push $(OPERATORUBIIMAGE)
endif endif
@ -402,7 +413,7 @@ tools: update-vendor
.PHONY: vendor .PHONY: vendor
vendor: vendor:
@echo ">> Updating vendor" @echo ">> Updating vendor"
@go mod vendor @ go mod vendor
set-deployment-api-version-v2alpha1: export API_VERSION=2alpha1 set-deployment-api-version-v2alpha1: export API_VERSION=2alpha1
set-deployment-api-version-v2alpha1: set-api-version/deployment set-api-version/replication set-deployment-api-version-v2alpha1: set-api-version/deployment set-api-version/replication

0
community.mk Normal file
View file

View file

@ -251,9 +251,9 @@ func (s DeploymentSpec) IsDisableIPv6() bool {
return util.BoolOrDefault(s.DisableIPv6) return util.BoolOrDefault(s.DisableIPv6)
} }
// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default true // IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default false
func (s DeploymentSpec) IsNetworkAttachedVolumes() bool { func (s DeploymentSpec) IsNetworkAttachedVolumes() bool {
return util.BoolOrDefault(s.NetworkAttachedVolumes, true) return util.BoolOrDefault(s.NetworkAttachedVolumes, false)
} }
// GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6 // GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6

View file

@ -251,9 +251,9 @@ func (s DeploymentSpec) IsDisableIPv6() bool {
return util.BoolOrDefault(s.DisableIPv6) return util.BoolOrDefault(s.DisableIPv6)
} }
// IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default true // IsNetworkAttachedVolumes returns the value of networkAttachedVolumes, default false
func (s DeploymentSpec) IsNetworkAttachedVolumes() bool { func (s DeploymentSpec) IsNetworkAttachedVolumes() bool {
return util.BoolOrDefault(s.NetworkAttachedVolumes, true) return util.BoolOrDefault(s.NetworkAttachedVolumes, false)
} }
// GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6 // GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6