Skip to content

Commit

Permalink
Merge pull request #35 from metalmatze/resources
Browse files Browse the repository at this point in the history
Add resource requests and limits to receive-controller container
  • Loading branch information
metalmatze authored Nov 12, 2019
2 parents 117290c + 20861be commit 47c08cc
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 52 deletions.
7 changes: 7 additions & 0 deletions examples/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,11 @@ spec:
ports:
- containerPort: 8080
name: http
resources:
limits:
cpu: 64m
memory: 128Mi
requests:
cpu: 10m
memory: 24Mi
serviceAccount: thanos-receive-controller
100 changes: 50 additions & 50 deletions jsonnet/jsonnetfile.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
{
"dependencies": [
{
"name": "ksonnet",
"source": {
"git": {
"remote": "https://github.com/ksonnet/ksonnet-lib",
"subdir": ""
}
},
"version": "0d2f82676817bbf9e4acf6495b2090205f323b9f"
},
{
"name": "thanos-receive-controller-mixin",
"source": {
"local": {
"directory": "thanos-receive-controller-mixin"
}
},
"version": "."
},
{
"name": "thanos-mixin",
"source": {
"git": {
"remote": "https://github.com/metalmatze/kube-thanos",
"subdir": "jsonnet/thanos-mixin"
}
},
"version": "master"
},
{
"name": "grafonnet",
"source": {
"git": {
"remote": "https://github.com/grafana/grafonnet-lib",
"subdir": "grafonnet"
}
},
"version": "master"
},
{
"name": "grafana-builder",
"source": {
"git": {
"remote": "https://github.com/grafana/jsonnet-libs",
"subdir": "grafana-builder"
}
},
"version": "master"
"dependencies": [
{
"name": "grafana-builder",
"source": {
"git": {
"remote": "https://github.com/grafana/jsonnet-libs",
"subdir": "grafana-builder"
}
]
},
"version": "master"
},
{
"name": "grafonnet",
"source": {
"git": {
"remote": "https://github.com/grafana/grafonnet-lib",
"subdir": "grafonnet"
}
},
"version": "master"
},
{
"name": "ksonnet",
"source": {
"git": {
"remote": "https://github.com/ksonnet/ksonnet-lib",
"subdir": ""
}
},
"version": "0d2f82676817bbf9e4acf6495b2090205f323b9f"
},
{
"name": "thanos-mixin",
"source": {
"git": {
"remote": "https://github.com/metalmatze/kube-thanos",
"subdir": "jsonnet/thanos-mixin"
}
},
"version": "master"
},
{
"name": "thanos-receive-controller-mixin",
"source": {
"local": {
"directory": "thanos-receive-controller-mixin"
}
},
"version": "."
}
]
}
8 changes: 6 additions & 2 deletions jsonnet/lib/thanos-receive-controller.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,13 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
'--configmap-generated-name=%s-generated' % $.thanos.receiveController.configmap.metadata.name,
'--file-name=hashrings.json',
'--namespace=$(NAMESPACE)',
]) + container.withEnv([
]) +
container.withEnv([
env.fromFieldPath('NAMESPACE', 'metadata.namespace'),
]) + container.withPorts(
]) +
container.mixin.resources.withRequests({ cpu: '10m', memory: '24Mi' }) +
container.mixin.resources.withLimits({ cpu: '64m', memory: '128Mi' }) +
container.withPorts(
containerPort.newNamed(8080, 'http')
);

Expand Down

0 comments on commit 47c08cc

Please sign in to comment.