Skip to content

Commit

Permalink
fix: adjust memory limit to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
joshiste committed Dec 2, 2024
1 parent 51a15fb commit c77418f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 27 deletions.
2 changes: 1 addition & 1 deletion charts/steadybit-extension-host/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: steadybit-extension-host
description: Steadybit host extension Helm chart for Kubernetes.
version: 1.1.26
version: 1.1.27
appVersion: v1.2.24
home: https://www.steadybit.com/
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ manifest should match snapshot with TLS:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down Expand Up @@ -311,7 +311,7 @@ manifest should match snapshot with appArmorProfile for k8s >= 1.30:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down Expand Up @@ -430,7 +430,7 @@ manifest should match snapshot with different containerPorts:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down Expand Up @@ -554,7 +554,7 @@ manifest should match snapshot with extra env vars:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down Expand Up @@ -673,7 +673,7 @@ manifest should match snapshot with extra labels:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down Expand Up @@ -796,7 +796,7 @@ manifest should match snapshot with mutual TLS:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down Expand Up @@ -933,7 +933,7 @@ manifest should match snapshot with mutual TLS using containerPaths:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down Expand Up @@ -1050,7 +1050,7 @@ manifest should match snapshot with podSecurityContext:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down Expand Up @@ -1169,7 +1169,7 @@ manifest should match snapshot with priority class:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down Expand Up @@ -1287,7 +1287,7 @@ manifest should match snapshot with update strategy:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down Expand Up @@ -1404,7 +1404,7 @@ manifest should match snapshot without TLS:
resources:
limits:
cpu: 200m
memory: 32Mi
memory: 64Mi
requests:
cpu: 50m
memory: 16Mi
Expand Down
2 changes: 1 addition & 1 deletion charts/steadybit-extension-host/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ resources:
cpu: "50m"
limits:
# resources.limits.memory -- The limit of memory to be used
memory: "32Mi"
memory: "64Mi"
# resources.limits.cpu -- The limit of cpu share to be used during its interval
cpu: "200m"

Expand Down
24 changes: 10 additions & 14 deletions e2e/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ func TestWithMinikube(t *testing.T) {
}

func testStressCpu(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
log.Info().Msg("Starting testStressCpu")
config := struct {
Duration int `json:"duration"`
CpuLoad int `json:"cpuLoad"`
Expand Down Expand Up @@ -372,7 +371,6 @@ func testShutdownHost(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
}

func testNetworkBlackhole(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
log.Info().Msg("Starting testNetworkBlackhole")
nginx := e2e.Nginx{Minikube: m}
err := nginx.Deploy("nginx-network-blackhole")
require.NoError(t, err, "failed to create pod")
Expand Down Expand Up @@ -450,7 +448,6 @@ func testNetworkBlackhole(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
}

func testNetworkDelay(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
log.Info().Msg("Starting testNetworkDelay")
netperf := e2e.Netperf{Minikube: m}
err := netperf.Deploy("delay")
defer func() { _ = netperf.Delete() }()
Expand Down Expand Up @@ -541,7 +538,6 @@ func testNetworkDelay(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
}

func testNetworkPackageLoss(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
log.Info().Msg("Starting testNetworkPackageLoss")
iperf := e2e.Iperf{Minikube: m}
err := iperf.Deploy("loss")
defer func() { _ = iperf.Delete() }()
Expand Down Expand Up @@ -611,7 +607,6 @@ func testNetworkPackageLoss(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
}

func testNetworkPackageCorruption(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
log.Info().Msg("Starting testNetworkPackageCorruption")
iperf := e2e.Iperf{Minikube: m}
err := iperf.Deploy("corruption")
defer func() { _ = iperf.Delete() }()
Expand Down Expand Up @@ -696,7 +691,7 @@ func testNetworkPackageCorruption(t *testing.T, m *e2e.Minikube, e *e2e.Extensio

func testNetworkLimitBandwidth(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
t.Skip("Skipping testNetworkLimitBandwidth because it does not work on minikube, but was tested manually on a real cluster")
log.Info().Msg("Starting testNetworkLimitBandwidth")

iperf := e2e.Iperf{Minikube: m}
err := iperf.Deploy("bandwidth")
defer func() { _ = iperf.Delete() }()
Expand Down Expand Up @@ -770,7 +765,6 @@ func testNetworkLimitBandwidth(t *testing.T, m *e2e.Minikube, e *e2e.Extension)
}

func testNetworkBlockDns(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
log.Info().Msg("Starting testNetworkBlockDns")
nginx := e2e.Nginx{Minikube: m}
err := nginx.Deploy("nginx-network-block-dns")
require.NoError(t, err, "failed to create pod")
Expand Down Expand Up @@ -1154,13 +1148,15 @@ func runInMinikube(m *e2e.Minikube, arg ...string) ([]byte, error) {
}

func requireAllSidecarsCleanedUp(t *testing.T, m *e2e.Minikube, e *e2e.Extension) {
out, err := m.PodExec(e.Pod, "steadybit-extension-host", "ls", "/run/steadybit/runc")
if strings.Contains(out, "No such file or directory") {
return
}
require.NoError(t, err)
space := strings.TrimSpace(out)
require.Empty(t, space, "no sidecar directories must be present")
require.EventuallyWithT(t, func(t *assert.CollectT) {
out, err := m.PodExec(e.Pod, "steadybit-extension-host", "ls", "/run/steadybit/runc")
if strings.Contains(out, "No such file or directory") {
return
}
require.NoError(t, err)
space := strings.TrimSpace(out)
require.Empty(t, space, "no sidecar directories must be present")
}, 30*time.Second, 1*time.Second)
}

func getMinikubeOptions() e2e.MinikubeOpts {
Expand Down
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
"github.com/steadybit/extension-kit/extsignals"
_ "go.uber.org/automaxprocs" // Importing automaxprocs automatically adjusts GOMAXPROCS.
_ "net/http/pprof" //allow pprof
"runtime"
"time"
)

func main() {
Expand Down Expand Up @@ -60,6 +62,15 @@ func main() {
r := runc.NewRunc(runc.ConfigFromEnvironment())
log.Info().Interface("cfg", runc.ConfigFromEnvironment())

go func() {
for {
s := &runtime.MemStats{}
runtime.ReadMemStats(s)
log.Info().Interface("memstats", s)
time.Sleep(5 * time.Second)
}
}()

// This is a section you will most likely want to change: The registration of HTTP handlers
// for your extension. You might want to change these because the names do not fit, or because
// you do not have a need for all of them.
Expand Down

0 comments on commit c77418f

Please sign in to comment.