Skip to content

Commit 412de9c

Browse files
🌱 Add soft mem limit to controller k8s spec (#2362)
* Bump golang docker to 1.19 Signed-off-by: Spencer Schrock <[email protected]> * Add soft memory limit for controller to address OOMKilled. Signed-off-by: Spencer Schrock <[email protected]> Signed-off-by: Spencer Schrock <[email protected]>
1 parent c408592 commit 412de9c

File tree

8 files changed

+17
-6
lines changed

8 files changed

+17
-6
lines changed

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/internal/bq/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/internal/cii/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/internal/controller/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/internal/webhook/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/internal/worker/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
15+
# golang:1.19
16+
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
1617
WORKDIR /src
1718
ENV CGO_ENABLED=0
1819
COPY go.* ./

cron/k8s/controller.release.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ spec:
5555
args: ["--config=/etc/scorecard/config.yaml", "cron/internal/data/projects.release.csv"]
5656
imagePullPolicy: Always
5757
env:
58+
- name: GOMEMLIMIT
59+
value: "950MiB"
5860
- name: SCORECARD_REQUEST_TOPIC_URL
5961
value: "gcppubsub://projects/openssf/topics/scorecard-batch-requests-releasetest"
6062
- name: SCORECARD_DATA_BUCKET_URL

cron/k8s/controller.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ spec:
5454
image: gcr.io/openssf/scorecard-batch-controller:stable
5555
args: ["--config=/etc/scorecard/config.yaml", "cron/internal/data/projects.csv"]
5656
imagePullPolicy: Always
57+
env:
58+
- name: GOMEMLIMIT
59+
value: "950MiB"
5760
resources:
5861
limits:
5962
memory: 1Gi

0 commit comments

Comments
 (0)