Skip to content

Commit

Permalink
Merge pull request #63 from rajatvig/master
Browse files Browse the repository at this point in the history
Add options to allow override of resources and replicas for grafana container pods
  • Loading branch information
metalmatze authored Mar 18, 2019
2 parents 9ddf5a1 + bbe6468 commit 22d6896
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions grafana/grafana.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
namespace: 'default',

versions+:: {
grafana: '5.2.4',
grafana: '6.0.1',
},

imageRepos+:: {
Expand All @@ -26,6 +26,11 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
config: {},
ldap: null,
plugins: [],
container: {
replicas: 1,
requests: { cpu: '100m', memory: '100Mi' },
limits: { cpu: '200m', memory: '200Mi' },
},
},
},
grafanaDashboards: {},
Expand Down Expand Up @@ -137,10 +142,10 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
container.withPorts(containerPort.newNamed(portName, targetPort)) +
container.mixin.readinessProbe.httpGet.withPath('/api/health') +
container.mixin.readinessProbe.httpGet.withPort(portName) +
container.mixin.resources.withRequests({ cpu: '100m', memory: '100Mi' }) +
container.mixin.resources.withLimits({ cpu: '200m', memory: '200Mi' });
container.mixin.resources.withRequests($._config.grafana.container.requests) +
container.mixin.resources.withLimits($._config.grafana.container.limits);

deployment.new('grafana', 1, c, podLabels) +
deployment.new('grafana', $._config.grafana.container.replicas, c, podLabels) +
deployment.mixin.metadata.withNamespace($._config.namespace) +
deployment.mixin.metadata.withLabels(podLabels) +
deployment.mixin.spec.selector.withMatchLabels(podLabels) +
Expand Down

0 comments on commit 22d6896

Please sign in to comment.