Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
revert deployment to amd64 architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
broadeditz committed Nov 23, 2023
1 parent 6d01ccc commit 912dd60
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ else
endif

build:
GOOS=linux GOARCH=arm64 go build -v -ldflags "-X 'main.Version=${VERSION}' -X 'main.Unix=$(shell date +%s)' -X 'main.User=${BUILDER}'" -o out/eventapi cmd/*.go
GOOS=linux GOARCH=amd64 go build -v -ldflags "-X 'main.Version=${VERSION}' -X 'main.Unix=$(shell date +%s)' -X 'main.User=${BUILDER}'" -o out/eventapi cmd/*.go

lint:
go vet ./...
Expand Down
2 changes: 1 addition & 1 deletion docker/partial.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE_IMG=ubuntu:22.04

FROM --platform=linux/arm64 $BASE_IMG
FROM $BASE_IMG
WORKDIR /app

RUN apt-get update && \
Expand Down
41 changes: 37 additions & 4 deletions terraform/deployment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,47 @@ resource "kubernetes_deployment" "app" {
}

spec {
node_selector = {
"7tv.io/node-pool" = "arm"
// set node affinity preference, prefer medium nodes, then small or traffic nodes as fallback
affinity {
node_affinity {
preferred_during_scheduling_ignored_during_execution {
weight = 50
preference {
match_expressions {
key = "7tv.io/node-pool"
operator = "In"
values = ["medium"]
}
}
},
preferred_during_scheduling_ignored_during_execution {
weight = 1
preference {
match_expressions {
key = "7tv.io/node-pool"
operator = "In"
values = ["small"]
}
}
},
preferred_during_scheduling_ignored_during_execution{
weight = 1
preference {
match_expressions {
key = "7tv.io/node-pool"
operator = "In"
values = ["traffic"]
}
}
}
}
}

// tolerate traffic nodes since, but don't prefer them
toleration {
key = "7tv.io/node-pool"
operator = "Equal"
value = "arm"
value = "traffic"
effect = "NoSchedule"
}

Expand Down Expand Up @@ -129,7 +162,7 @@ resource "kubernetes_deployment" "app" {
memory = local.infra.production ? "1.5Gi" : "500Mi"
}
limits = {
cpu = local.infra.production ? "500m" : "150m"
cpu = local.infra.production ? "1" : "150m"
memory = local.infra.production ? "3Gi" : "500Mi"
}
}
Expand Down

0 comments on commit 912dd60

Please sign in to comment.