From a03af4c6134d82c48cab8f04d45abe864feaf0e7 Mon Sep 17 00:00:00 2001 From: Leah Tacke genannt Unterberg <leah.tgu@pads.rwth-aachen.de> Date: Wed, 14 May 2025 16:49:51 +0200 Subject: [PATCH] scaled deployment to 0 and changed service nodeport to cluster ip --- justfile | 24 ++++++++++++++++++++++++ mdata_app_deployment.yaml | 6 +++--- mdata_app_service.yaml | 12 +++++++----- 3 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 justfile diff --git a/justfile b/justfile new file mode 100644 index 0000000..ddc49ea --- /dev/null +++ b/justfile @@ -0,0 +1,24 @@ +set windows-shell := ["pwsh", "-c"] + +ctxt := "c4c" +ctxt_flag := "--context " + ctxt + +default: + just --list + +[no-exit-message] +apply a: + kubectl apply {{ ctxt_flag }} -f {{ a }} + +with-label := "true" + +[no-exit-message] +do *args="describe deployments": + kubectl {{ ctxt_flag }} {{ if with-label == "true" { "-l app.kubernetes.io/name=maed-exporter-app" } else { "" } }} {{ args }} + +[no-exit-message] +minikube-start *args: + minikube start --apiserver-port=8888 --namespace mdata {{ args }} + +kube *arg: + kubectl --context=c4c -n mdata {{ arg }} \ No newline at end of file diff --git a/mdata_app_deployment.yaml b/mdata_app_deployment.yaml index 54fbcf6..d2e63ec 100644 --- a/mdata_app_deployment.yaml +++ b/mdata_app_deployment.yaml @@ -10,7 +10,7 @@ spec: selector: matchLabels: app.kubernetes.io/name: mdata-app - replicas: 1 + replicas: 0 revisionHistoryLimit: 5 strategy: type: Recreate @@ -38,8 +38,8 @@ spec: name: tmp resources: limits: - memory: "2Gi" - cpu: "1000m" + memory: "1Gi" + cpu: "500m" requests: memory: "512Mi" cpu: "500m" diff --git a/mdata_app_service.yaml b/mdata_app_service.yaml index 2982065..92f9c2b 100644 --- a/mdata_app_service.yaml +++ b/mdata_app_service.yaml @@ -7,11 +7,13 @@ metadata: app.kubernetes.io/name: mdata-app spec: externalTrafficPolicy: Cluster - ports: - - port: 80 - protocol: TCP - targetPort: 8501 selector: app.kubernetes.io/name: mdata-app - type: NodePort + ports: + - port: 8501 + protocol: TCP + # targetPort: 8501 + type: ClusterIP + # + # type: NodePort sessionAffinity: ClientIP \ No newline at end of file -- GitLab