Skip to content

Commit 5fc76f5

Browse files
committed
fix: CI and downgrade sigs.k8s.io/controller-runtime to mitigate memory
leak
1 parent b1c7142 commit 5fc76f5

File tree

11 files changed

+39
-28
lines changed

11 files changed

+39
-28
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
FROM nexxiot-registry-oci.jfrog.io/golang:1.24.2-alpine3.21
1+
FROM nexxiot-registry-oci.jfrog.io/golang:1.24.5-alpine3.22
22

3-
RUN apk --no-cache add git bash make zip
3+
RUN apk --no-cache add git bash make zip kubectl docker fuse-overlayfs helm curl # kind
4+
5+
# Kind from package manager is too old, so download it from upstream.
6+
RUN ([ $(uname -m) = x86_64 ] && curl -Lo /usr/bin/kind https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-amd64) || true
7+
8+
RUN ([ $(uname -m) = aarch64 ] && curl -Lo /usr/bin/kind https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-arm64) || true
9+
10+
RUN chmod +x /usr/bin/kind
411

512
RUN go install golang.org/x/tools/gopls@v0.19.1

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
"dockerfile": "./Dockerfile"
44
},
55
"mounts": [
6+
"source=${localEnv:HOME}/.kube,target=/root/.kube,type=bind,consistency=cached",
67
"source=${localEnv:HOME}/.aws,target=/root/.aws,type=bind,consistency=cached",
78
"source=${localEnv:HOME}/.gitconfig,target=/root/.gitconfig,type=bind,consistency=cached"
89
],
10+
"runArgs": ["--privileged", "--cgroupns=host"],
911
"customizations": {
1012
"vscode": {
1113
"extensions": [
@@ -19,4 +21,4 @@
1921
]
2022
}
2123
}
22-
}
24+
}

.github/install.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/bash
22

33
set -e
4+
set -x
45

56
make docker-build IMG=test/secrets-controller:latest
67

7-
kind load docker-image test/secrets-controller:latest --name "${KIND:-kind}"
8-
9-
echo $@ - $1
10-
if [[ "$1" == "helm" ]]; then
11-
helm upgrade k8s-gitops-secrets-controller charts/k8s-gitops-secrets-controller --install -n k8s-gitops-secrets-system --create-namespace --set fullnameOverride=k8s-gitops-secrets-controller-manager --set image.repository=test/secrets-controller --set image.tag=latest
12-
else
13-
make deploy IMG=test/secrets-controller:latest
8+
if ! kind load docker-image test/secrets-controller:latest --name "${KIND:-kind}" -v 10; then
9+
docker save -o /tmp/image-archive.tar test/secrets-controller:latest
10+
kind load image-archive /tmp/image-archive.tar --name "${KIND:-kind}";
1411
fi
12+
13+
14+
helm upgrade k8s-gitops-secrets-controller charts/k8s-gitops-secrets-controller --install -n k8s-gitops-secrets-system --create-namespace --set fullnameOverride=k8s-gitops-secrets-controller-manager --set image.repository=test/secrets-controller --set image.tag=latest

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup Go
2525
uses: actions/setup-go@v3
2626
with:
27-
go-version: 1.24.2
27+
go-version: 1.24.5
2828
- name: Setup Kubernetes
2929
uses: helm/kind-action@v1.5.0
3030
with:

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
- name: Setup Go
105105
uses: actions/setup-go@v3
106106
with:
107-
go-version: 1.24.2
107+
go-version: 1.24.5
108108
- name: Build seals CLI
109109
run: make cli
110110
- name: Extract TAG_NAME from GITHUB_REF

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.24.2 as builder
2+
FROM golang:1.24.5 AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Image URL to use all building/pushing image targets
33
IMG ?= controller:latest
44
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
5-
ENVTEST_K8S_VERSION = 1.33.1
5+
ENVTEST_K8S_VERSION = 1.33.0
66

77
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
88
ifeq (,$(shell go env GOBIN))

charts/k8s-gitops-secrets-controller/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ securityContext:
5252

5353
resources:
5454
limits:
55-
cpu: 100m
56-
memory: 32Mi
55+
cpu: 1000m
56+
memory: 128Mi
5757
requests:
5858
cpu: 10m
59-
memory: 16Mi
59+
memory: 64Mi
6060

6161
nodeSelector: {}
6262

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/rustrial/k8s-gitops-secrets
22

3-
go 1.24.2
3+
go 1.24.5
44

55
require (
66
github.com/aws/aws-sdk-go-v2/config v1.29.17
@@ -15,7 +15,9 @@ require (
1515
k8s.io/apimachinery v0.33.2
1616
k8s.io/client-go v0.33.2
1717
k8s.io/kubectl v0.33.2
18-
sigs.k8s.io/controller-runtime v0.21.0
18+
// sigs.k8s.io/controller-runtime v0.21.0 caused a memory leak, which resulted in
19+
// container beeing OOMKilled, so we stick with v0.20.4 for now.
20+
sigs.k8s.io/controller-runtime v0.20.4
1921
)
2022

2123
require (
@@ -35,7 +37,6 @@ require (
3537
require (
3638
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 // indirect
3739
github.com/beorn7/perks v1.0.1 // indirect
38-
github.com/blang/semver/v4 v4.0.0 // indirect
3940
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4041
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
4142
github.com/emicklei/go-restful/v3 v3.12.1 // indirect

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ github.com/aws/smithy-go v1.22.4 h1:uqXzVZNuNexwc/xrh6Tb56u89WDlJY6HS+KC0S4QSjw=
2828
github.com/aws/smithy-go v1.22.4/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=
2929
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
3030
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
31-
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
32-
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
3331
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
3432
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
3533
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
@@ -222,8 +220,8 @@ k8s.io/kubectl v0.33.2 h1:7XKZ6DYCklu5MZQzJe+CkCjoGZwD1wWl7t/FxzhMz7Y=
222220
k8s.io/kubectl v0.33.2/go.mod h1:8rC67FB8tVTYraovAGNi/idWIK90z2CHFNMmGJZJ3KI=
223221
k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0=
224222
k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
225-
sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8=
226-
sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM=
223+
sigs.k8s.io/controller-runtime v0.20.4 h1:X3c+Odnxz+iPTRobG4tp092+CvBU9UK0t/bRf+n0DGU=
224+
sigs.k8s.io/controller-runtime v0.20.4/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
227225
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
228226
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
229227
sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=

0 commit comments

Comments
 (0)