diff --git a/image_sources_versions.jsonnet b/image_sources_versions.jsonnet index d758460..596fc30 100644 --- a/image_sources_versions.jsonnet +++ b/image_sources_versions.jsonnet @@ -13,7 +13,7 @@ configmapReloader: 'latest', prometheusConfigReloader: 'v0.39.0', armExporter: 'latest', - smtpServer: 'v1.0.1', + smtpRelay: 'v1.0.1', elasticExporter: '1.0.4rc1', }, @@ -30,7 +30,7 @@ configmapReloader: 'carlosedp/configmap-reload', prometheusConfigReloader: 'carlosedp/prometheus-config-reloader', armExporter: 'carlosedp/arm_exporter', - smtpServer: 'carlosedp/docker-smtp', + smtpRelay: 'carlosedp/docker-smtp', elasticExporter: 'carlosedp/elasticsearch-exporter', }, }, diff --git a/modules/smtp_relay.jsonnet b/modules/smtp_relay.jsonnet index 5d7e16b..cf248b6 100644 --- a/modules/smtp_relay.jsonnet +++ b/modules/smtp_relay.jsonnet @@ -5,15 +5,15 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; namespace: 'monitoring', versions+:: { - smtpServer: 'v1.0.1', + smtpRelay: 'v1.0.1', }, imageRepos+:: { - smtpServer: 'carlosedp/docker-smtp', + smtpRelay: 'carlosedp/docker-smtp', }, }, - smtpServer+:: { + smtpRelay+:: { deployment: local deployment = k.apps.v1.deployment; local container = k.apps.v1.deployment.mixin.spec.template.spec.containersType; @@ -21,8 +21,8 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; local podLabels = { run: 'smtp-server' }; - local smtpServer = - container.new('smtp-server', $._config.imageRepos.smtpServer + ':' + $._config.versions.smtpServer) + + local smtpRelay = + container.new('smtp-server', $._config.imageRepos.smtpRelay + ':' + $._config.versions.smtpRelay) + container.withPorts(containerPort.newNamed(25, 'smtp')) + container.withEnv([ { @@ -44,7 +44,7 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; { name: 'RELAY_DOMAINS', value: ':192.168.0.0/24:10.0.0.0/16' }, ]); - local c = [smtpServer]; + local c = [smtpRelay]; deployment.new('smtp-server', 1, c, podLabels) + deployment.mixin.metadata.withNamespace($._config.namespace) + @@ -54,9 +54,9 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; service: local service = k.core.v1.service; local servicePort = k.core.v1.service.mixin.spec.portsType; - local smtpServerPorts = servicePort.newNamed('smtp', 25, 'smtp'); + local smtpRelayPorts = servicePort.newNamed('smtp', 25, 'smtp'); - service.new('smtp-server', $.smtpServer.deployment.spec.selector.matchLabels, smtpServerPorts) + + service.new('smtp-server', $.smtpRelay.deployment.spec.selector.matchLabels, smtpRelayPorts) + service.mixin.metadata.withNamespace($._config.namespace) + service.mixin.metadata.withLabels({ run: 'smtp-server' }), },