Skip to content

Commit

Permalink
memory limits for services
Browse files Browse the repository at this point in the history
  • Loading branch information
puckpuck committed Oct 19, 2022
1 parent a29d7ff commit 2d816d8
Showing 8 changed files with 181 additions and 65 deletions.
45 changes: 45 additions & 0 deletions charts/opentelemetry-demo/examples/default/rendered/component.yaml
Original file line number Diff line number Diff line change
@@ -393,6 +393,9 @@ spec:
value: http://example-otelcol:4317
- name: AD_SERVICE_PORT
value: "8080"
resources:
limits:
memory: 300Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -459,6 +462,9 @@ spec:
value: http://example-otelcol:4317
- name: CART_SERVICE_PORT
value: "8080"
resources:
limits:
memory: 160Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -533,6 +539,9 @@ spec:
value: http://example-otelcol:4317
- name: CHECKOUT_SERVICE_PORT
value: "8080"
resources:
limits:
memory: 20Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -597,6 +606,9 @@ spec:
value: http://example-otelcol:4317
- name: CURRENCY_SERVICE_PORT
value: "8080"
resources:
limits:
memory: 20Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -665,6 +677,9 @@ spec:
value: http://example-otelcol:4318/v1/traces
- name: EMAIL_SERVICE_PORT
value: "8080"
resources:
limits:
memory: 100Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -735,6 +750,9 @@ spec:
value: ecto://ffs:ffs@example-ffs-postgres:5432/ffs
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://example-otelcol:4317
resources:
limits:
memory: 160Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -801,6 +819,9 @@ spec:
value: ffs
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://example-otelcol:4317
resources:
limits:
memory: 120Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -879,6 +900,9 @@ spec:
value: http://example-otelcol:4317
- name: FRONTEND_PORT
value: "8080"
resources:
limits:
memory: 200Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -955,6 +979,9 @@ spec:
value: http://example-otelcol:4317
- name: LOADGENERATOR_PORT
value: "8089"
resources:
limits:
memory: 120Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -1017,6 +1044,9 @@ spec:
value: http://example-otelcol:4317
- name: PAYMENT_SERVICE_PORT
value: "8080"
resources:
limits:
memory: 70Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -1081,6 +1111,9 @@ spec:
value: "8080"
- name: FEATURE_FLAG_GRPC_SERVICE_ADDR
value: 'example-featureflag-service:50053'
resources:
limits:
memory: 20Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -1151,6 +1184,9 @@ spec:
value: 'example-otelcol:4317'
- name: QUOTE_SERVICE_PORT
value: "8080"
resources:
limits:
memory: 30Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -1219,6 +1255,9 @@ spec:
value: "8080"
- name: PRODUCT_CATALOG_SERVICE_ADDR
value: 'example-product-catalog-service:8080'
resources:
limits:
memory: 500Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -1277,6 +1316,9 @@ spec:
fieldPath: metadata.name
- name: OTEL_RESOURCE_ATTRIBUTES
value: service.name=$(OTEL_SERVICE_NAME),k8s.namespace.name=$(OTEL_K8S_NAMESPACE),k8s.node.name=$(OTEL_K8S_NODE_NAME),k8s.pod.name=$(OTEL_K8S_POD_NAME)
resources:
limits:
memory: 20Mi
---
# Source: opentelemetry-demo/templates/component.yaml
apiVersion: apps/v1
@@ -1345,3 +1387,6 @@ spec:
value: "8080"
- name: QUOTE_SERVICE_ADDR
value: http://example-quote-service:8080
resources:
limits:
memory: 20Mi
47 changes: 25 additions & 22 deletions charts/opentelemetry-demo/examples/default/rendered/jaeger.yaml
Original file line number Diff line number Diff line change
@@ -53,25 +53,28 @@ spec:
app.kubernetes.io/component: jaeger
spec:
containers:
- env:
- name: COLLECTOR_ZIPKIN_HTTP_PORT
value: "9411"
image: "jaegertracing/all-in-one:latest"
name: jaeger
ports:
- containerPort: 5775
protocol: UDP
- containerPort: 6831
protocol: UDP
- containerPort: 6832
protocol: UDP
- containerPort: 5778
protocol: TCP
- containerPort: 16686
protocol: TCP
- containerPort: 14268
protocol: TCP
- containerPort: 9411
protocol: TCP
- containerPort: 14250
protocol: TCP
- env:
- name: COLLECTOR_ZIPKIN_HTTP_PORT
value: "9411"
image: "jaegertracing/all-in-one:latest"
name: jaeger
ports:
- containerPort: 5775
protocol: UDP
- containerPort: 6831
protocol: UDP
- containerPort: 6832
protocol: UDP
- containerPort: 5778
protocol: TCP
- containerPort: 16686
protocol: TCP
- containerPort: 14268
protocol: TCP
- containerPort: 9411
protocol: TCP
- containerPort: 14250
protocol: TCP
resources:
limits:
memory: 275Mi
Original file line number Diff line number Diff line change
@@ -25,8 +25,8 @@ data:
batch: {}
memory_limiter:
check_interval: 5s
limit_mib: 409
spike_limit_mib: 128
limit_mib: 80
spike_limit_mib: 25
receivers:
jaeger:
protocols:
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 59fbf04012114dd6c404237dc0e7ea8a88470269b81d65a975360203004fb1ef
checksum/config: 6e8725cdc6111ae34aa6463d7c824f607a81e5f88272e8f89864532036117c3c

labels:
app.kubernetes.io/name: otelcol
@@ -80,7 +80,7 @@ spec:
resources:
limits:
cpu: 256m
memory: 512Mi
memory: 100Mi
volumeMounts:
- mountPath: /conf
name: opentelemetry-collector-configmap
2 changes: 2 additions & 0 deletions charts/opentelemetry-demo/templates/_objects.tpl
Original file line number Diff line number Diff line change
@@ -36,6 +36,8 @@ spec:
{{- end }}
env:
{{- include "otel-demo.pod.env" . | nindent 10 }}
resources:
{{- .resources | toYaml | nindent 12 }}
{{- end }}
{{- define "otel.demo.service" }}
{{- if or .ports .servicePort}}
47 changes: 25 additions & 22 deletions charts/opentelemetry-demo/templates/jaeger.yaml
Original file line number Diff line number Diff line change
@@ -18,28 +18,31 @@ spec:
{{- include "otel-demo.selectorLabels" . | nindent 8 }}
spec:
containers:
- env:
- name: COLLECTOR_ZIPKIN_HTTP_PORT
value: "9411"
image: "{{ .Values.observability.jaeger.image.repository }}:{{ .Values.observability.jaeger.image.tag }}"
name: jaeger
ports:
- containerPort: 5775
protocol: UDP
- containerPort: 6831
protocol: UDP
- containerPort: 6832
protocol: UDP
- containerPort: 5778
protocol: TCP
- containerPort: 16686
protocol: TCP
- containerPort: 14268
protocol: TCP
- containerPort: 9411
protocol: TCP
- containerPort: 14250
protocol: TCP
- env:
- name: COLLECTOR_ZIPKIN_HTTP_PORT
value: "9411"
image: "{{ .Values.observability.jaeger.image.repository }}:{{ .Values.observability.jaeger.image.tag }}"
name: jaeger
ports:
- containerPort: 5775
protocol: UDP
- containerPort: 6831
protocol: UDP
- containerPort: 6832
protocol: UDP
- containerPort: 5778
protocol: TCP
- containerPort: 16686
protocol: TCP
- containerPort: 14268
protocol: TCP
- containerPort: 9411
protocol: TCP
- containerPort: 14250
protocol: TCP
resources:
{{- .Values.observability.jaeger.resources | toYaml | nindent 12 }}

---
apiVersion: v1
kind: Service
30 changes: 29 additions & 1 deletion charts/opentelemetry-demo/values.schema.json
Original file line number Diff line number Diff line change
@@ -125,6 +125,9 @@
},
"podAnnotations": {
"type": "object"
},
"resources": {
"$ref": "#/definitions/ContainerResources"
}
},
"required": [
@@ -300,9 +303,12 @@
},
"image": {
"$ref": "#/definitions/Image"
},
"resources": {
"$ref": "#/definitions/ContainerResources"
}
}

}
},
"required": [
@@ -330,6 +336,28 @@
}
},
"title": "Image"
},
"ContainerResources": {
"type": "object",
"properties": {
"limits": {
"$ref": "#/definitions/ContainerResourceDef"
},
"requests": {
"$ref": "#/definitions/ContainerResourceDef"
}
}
},
"ContainerResourceDef": {
"type": "object",
"properties": {
"cpu": {
"type": "string"
},
"memory": {
"type": "string"
}
}
}
}
}
Loading

0 comments on commit 2d816d8

Please sign in to comment.