Skip to content

Commit

Permalink
馃尡 Add soft mem limit to controller k8s spec (ossf#2362)
Browse files Browse the repository at this point in the history
* Bump golang docker to 1.19

Signed-off-by: Spencer Schrock <sschrock@google.com>

* Add soft memory limit for controller to address OOMKilled.

Signed-off-by: Spencer Schrock <sschrock@google.com>

Signed-off-by: Spencer Schrock <sschrock@google.com>
Signed-off-by: nathaniel.wert <nathaniel.wert@kudelskisecurity.com>
  • Loading branch information
spencerschrock authored and nathaniel.wert committed Nov 28, 2022
1 parent 36e6936 commit 6fafbbb
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
# golang:1.19
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
WORKDIR /src
ENV CGO_ENABLED=0
COPY go.* ./
Expand Down
3 changes: 2 additions & 1 deletion cron/internal/bq/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
# golang:1.19
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
WORKDIR /src
ENV CGO_ENABLED=0
COPY go.* ./
Expand Down
3 changes: 2 additions & 1 deletion cron/internal/cii/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
# golang:1.19
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
WORKDIR /src
ENV CGO_ENABLED=0
COPY go.* ./
Expand Down
3 changes: 2 additions & 1 deletion cron/internal/controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
# golang:1.19
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
WORKDIR /src
ENV CGO_ENABLED=0
COPY go.* ./
Expand Down
3 changes: 2 additions & 1 deletion cron/internal/webhook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
# golang:1.19
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
WORKDIR /src
ENV CGO_ENABLED=0
COPY go.* ./
Expand Down
3 changes: 2 additions & 1 deletion cron/internal/worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang@sha256:ea3d912d500b1ae0a691b2e53eb8a6345b579d42d7e6a64acca83d274b949740 AS base
# golang:1.19
FROM golang@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS base
WORKDIR /src
ENV CGO_ENABLED=0
COPY go.* ./
Expand Down
2 changes: 2 additions & 0 deletions cron/k8s/controller.release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ spec:
args: ["--config=/etc/scorecard/config.yaml", "cron/internal/data/projects.release.csv"]
imagePullPolicy: Always
env:
- name: GOMEMLIMIT
value: "950MiB"
- name: SCORECARD_REQUEST_TOPIC_URL
value: "gcppubsub://projects/openssf/topics/scorecard-batch-requests-releasetest"
- name: SCORECARD_DATA_BUCKET_URL
Expand Down
3 changes: 3 additions & 0 deletions cron/k8s/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ spec:
image: gcr.io/openssf/scorecard-batch-controller:stable
args: ["--config=/etc/scorecard/config.yaml", "cron/internal/data/projects.csv"]
imagePullPolicy: Always
env:
- name: GOMEMLIMIT
value: "950MiB"
resources:
limits:
memory: 1Gi
Expand Down

0 comments on commit 6fafbbb

Please sign in to comment.