|
26 | 26 |
|
27 | 27 | grafana_container::
|
28 | 28 | container.new('grafana', $._images.grafana) +
|
29 |
| - container.withPorts($.core.v1.containerPort.new('grafana-metrics', 80)) + |
| 29 | + container.withPorts($.core.v1.containerPort.new('grafana-metrics', 3000)) + |
30 | 30 | container.withEnvMap({
|
31 | 31 | GF_PATHS_CONFIG: '/etc/grafana-config/grafana.ini',
|
32 | 32 | GF_INSTALL_PLUGINS: std.join(',', $.grafana_plugins),
|
|
49 | 49 |
|
50 | 50 | grafana_deployment:
|
51 | 51 | deployment.new('grafana', 1, [$.grafana_container]) +
|
52 |
| - deployment.mixin.spec.template.spec.securityContext.withRunAsUser(0) + |
53 |
| - $.util.configVolumeMount('grafana-config', '/etc/grafana-config') + |
| 52 | + // Use configMapVolumeMount to automatically include the hash of the config |
| 53 | + // as an annotation. No need to use for others, Grafana will pick up |
| 54 | + // changes there. |
| 55 | + $.util.configMapVolumeMount($.grafana_config_map, '/etc/grafana-config') + |
54 | 56 | $.util.configVolumeMount('grafana-dashboard-provisioning', '%(grafana_provisioning_dir)s/dashboards' % $._config) +
|
55 | 57 | $.util.configVolumeMount('grafana-datasources', '%(grafana_provisioning_dir)s/datasources' % $._config) +
|
56 | 58 | $.util.configVolumeMount('grafana-notification-channels', '%(grafana_provisioning_dir)s/notifiers' % $._config) +
|
|
77 | 79 | ) +
|
78 | 80 | $.util.podPriority('critical'),
|
79 | 81 |
|
| 82 | + local service = $.core.v1.service, |
| 83 | + local servicePort = service.mixin.spec.portsType, |
| 84 | + |
80 | 85 | grafana_service:
|
81 |
| - $.util.serviceFor($.grafana_deployment), |
| 86 | + $.util.serviceFor($.grafana_deployment) + |
| 87 | + service.mixin.spec.withPortsMixin([ |
| 88 | + servicePort.newNamed( |
| 89 | + name='http', |
| 90 | + port=80, |
| 91 | + targetPort=3000, |
| 92 | + ), |
| 93 | + ]), |
82 | 94 | }
|
0 commit comments