From 7497a6c93d5d2268f79378d2fdc50fdb1dafc9a1 Mon Sep 17 00:00:00 2001 From: Jan Novak Date: Thu, 8 Jan 2026 19:50:32 +0100 Subject: [PATCH] k8s deployment: split into multiple files --- k8s/{deploy.yaml => deployment.yaml} | 29 ++++++++-------------------- k8s/namespace.yaml | 4 ++++ k8s/service.yaml | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 21 deletions(-) rename k8s/{deploy.yaml => deployment.yaml} (74%) create mode 100644 k8s/namespace.yaml create mode 100644 k8s/service.yaml diff --git a/k8s/deploy.yaml b/k8s/deployment.yaml similarity index 74% rename from k8s/deploy.yaml rename to k8s/deployment.yaml index 612a4dc..3378c67 100644 --- a/k8s/deploy.yaml +++ b/k8s/deployment.yaml @@ -1,26 +1,27 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: memconsumer + name: memory-stress-test + namespace: memory-stress-test labels: - app: memconsumer + app: memory-stress-test spec: replicas: 1 selector: matchLabels: - app: memconsumer + app: memory-stress-test template: metadata: labels: - app: memconsumer + app: memory-stress-test annotations: prometheus.io/scrape: "true" prometheus.io/port: "8080" prometheus.io/path: "/metrics" spec: containers: - - name: memconsumer - image: memconsumer:latest + - name: memory-stress-test + image: gitea.home.hrajfrisbee.cz/kacerr/memory-stress-test:latest env: - name: INITIAL_MB value: "50" @@ -29,7 +30,7 @@ spec: - name: INTERVAL value: "10s" - name: MAX_MB - value: "200" + value: "500" ports: - containerPort: 8080 name: metrics @@ -52,17 +53,3 @@ spec: port: 8080 initialDelaySeconds: 3 periodSeconds: 5 ---- -apiVersion: v1 -kind: Service -metadata: - name: memconsumer - labels: - app: memconsumer -spec: - selector: - app: memconsumer - ports: - - port: 8080 - targetPort: 8080 - name: metrics \ No newline at end of file diff --git a/k8s/namespace.yaml b/k8s/namespace.yaml new file mode 100644 index 0000000..a6fcc3a --- /dev/null +++ b/k8s/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: memory-stress-test diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..4909690 --- /dev/null +++ b/k8s/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: memory-stress-test + namespace: memory-stress-test + labels: + app: memory-stress-test +spec: + selector: + app: memory-stress-test + ports: + - port: 8080 + targetPort: 8080 + name: metrics \ No newline at end of file