Skip to content

Agent Mesh

helm: add resource requests/limits and missing probes

Antonio Ojea54de56ccb4be
diff --git a/charts/sam-mesh/templates/console-deployment.yaml b/charts/sam-mesh/templates/console-deployment.yaml
index 3f5c2011..2d9b2898 100644
--- a/charts/sam-mesh/templates/console-deployment.yaml
+++ b/charts/sam-mesh/templates/console-deployment.yaml
@@ -42,6 +42,18 @@ spec:
- containerPort: 8081
name: http
protocol: TCP
+ readinessProbe:
+ httpGet:
+ path: /info
+ port: http
+ periodSeconds: 5
+ livenessProbe:
+ httpGet:
+ path: /info
+ port: http
+ periodSeconds: 15
+ resources:
+ {{- toYaml .Values.console.resources | nindent 10 }}
args:
- "--hub=http://{{ include "sam-mesh.fullname" . }}-control-plane:{{ .Values.controlPlane.service.port }}"
- "--bind-addr=:8081"
diff --git a/charts/sam-mesh/templates/control-plane-deployment.yaml b/charts/sam-mesh/templates/control-plane-deployment.yaml
index a3d1e202..ed381c81 100644
--- a/charts/sam-mesh/templates/control-plane-deployment.yaml
+++ b/charts/sam-mesh/templates/control-plane-deployment.yaml
@@ -46,6 +46,8 @@ spec:
path: /info
port: http
periodSeconds: 15
+ resources:
+ {{- toYaml .Values.controlPlane.resources | nindent 10 }}
args:
- "--bind-address=0.0.0.0:8080"
{{- if eq .Values.database.type "postgres" }}
diff --git a/charts/sam-mesh/templates/db-statefulset.yaml b/charts/sam-mesh/templates/db-statefulset.yaml
index 0705d9b7..9a585a8e 100644
--- a/charts/sam-mesh/templates/db-statefulset.yaml
+++ b/charts/sam-mesh/templates/db-statefulset.yaml
@@ -34,6 +34,8 @@ spec:
- containerPort: 5432
name: postgres
protocol: TCP
+ resources:
+ {{- toYaml .Values.database.postgres.resources | nindent 10 }}
volumeMounts:
- name: db-data
mountPath: /var/lib/postgresql/data
diff --git a/charts/sam-mesh/templates/router-statefulset.yaml b/charts/sam-mesh/templates/router-statefulset.yaml
index 1176fb13..843afaf6 100644
--- a/charts/sam-mesh/templates/router-statefulset.yaml
+++ b/charts/sam-mesh/templates/router-statefulset.yaml
@@ -54,6 +54,16 @@ spec:
hostPort: {{ .Values.router.hostPort }}
{{- end }}
protocol: UDP
+ readinessProbe:
+ tcpSocket:
+ port: p2p-tcp
+ periodSeconds: 5
+ livenessProbe:
+ tcpSocket:
+ port: p2p-tcp
+ periodSeconds: 15
+ resources:
+ {{- toYaml .Values.router.resources | nindent 10 }}
env:
{{- if not .Values.router.useOidcToken }}
- name: BOOTSTRAP_TOKEN
diff --git a/charts/sam-mesh/values.yaml b/charts/sam-mesh/values.yaml
index 2a2baead..c7b88c4d 100644
--- a/charts/sam-mesh/values.yaml
+++ b/charts/sam-mesh/values.yaml
@@ -12,6 +12,13 @@ controlPlane:
insecureSkipTlsVerify: true
oidcIssuer: "http://sam-mesh-dex:5556/dex"
allowedAudiences: "sam-mesh-audience,sam-hub-audience"
+ resources:
+ requests:
+ cpu: 100m
+ memory: 128Mi
+ limits:
+ cpu: 500m
+ memory: 512Mi
service:
type: ClusterIP
port: 8080
@@ -30,6 +37,13 @@ database:
port: 5432
sslmode: disable
storageSize: 1Gi
+ resources:
+ requests:
+ cpu: 100m
+ memory: 256Mi
+ limits:
+ cpu: 1000m
+ memory: 1Gi
router:
enabled: true
@@ -38,6 +52,13 @@ router:
repository: sam-router
useOidcToken: false
logLevel: info
+ resources:
+ requests:
+ cpu: 100m
+ memory: 128Mi
+ limits:
+ cpu: 500m
+ memory: 512Mi
service:
type: ClusterIP
port: 4501
@@ -48,6 +69,13 @@ console:
replicaCount: 1
image:
repository: sam-console
+ resources:
+ requests:
+ cpu: 50m
+ memory: 64Mi
+ limits:
+ cpu: 250m
+ memory: 256Mi
service:
type: ClusterIP
port: 8081