Fix SMTP relay manifest generation

Fixes #58
This commit is contained in:
Carlos de Paula 2020-06-15 19:46:19 -03:00
parent 33af4a53d1
commit cd17208e4f
2 changed files with 10 additions and 10 deletions

View File

@ -13,7 +13,7 @@
configmapReloader: 'latest', configmapReloader: 'latest',
prometheusConfigReloader: 'v0.39.0', prometheusConfigReloader: 'v0.39.0',
armExporter: 'latest', armExporter: 'latest',
smtpServer: 'v1.0.1', smtpRelay: 'v1.0.1',
elasticExporter: '1.0.4rc1', elasticExporter: '1.0.4rc1',
}, },
@ -30,7 +30,7 @@
configmapReloader: 'carlosedp/configmap-reload', configmapReloader: 'carlosedp/configmap-reload',
prometheusConfigReloader: 'carlosedp/prometheus-config-reloader', prometheusConfigReloader: 'carlosedp/prometheus-config-reloader',
armExporter: 'carlosedp/arm_exporter', armExporter: 'carlosedp/arm_exporter',
smtpServer: 'carlosedp/docker-smtp', smtpRelay: 'carlosedp/docker-smtp',
elasticExporter: 'carlosedp/elasticsearch-exporter', elasticExporter: 'carlosedp/elasticsearch-exporter',
}, },
}, },

View File

@ -5,15 +5,15 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
namespace: 'monitoring', namespace: 'monitoring',
versions+:: { versions+:: {
smtpServer: 'v1.0.1', smtpRelay: 'v1.0.1',
}, },
imageRepos+:: { imageRepos+:: {
smtpServer: 'carlosedp/docker-smtp', smtpRelay: 'carlosedp/docker-smtp',
}, },
}, },
smtpServer+:: { smtpRelay+:: {
deployment: deployment:
local deployment = k.apps.v1.deployment; local deployment = k.apps.v1.deployment;
local container = k.apps.v1.deployment.mixin.spec.template.spec.containersType; 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 podLabels = { run: 'smtp-server' };
local smtpServer = local smtpRelay =
container.new('smtp-server', $._config.imageRepos.smtpServer + ':' + $._config.versions.smtpServer) + container.new('smtp-server', $._config.imageRepos.smtpRelay + ':' + $._config.versions.smtpRelay) +
container.withPorts(containerPort.newNamed(25, 'smtp')) + container.withPorts(containerPort.newNamed(25, 'smtp')) +
container.withEnv([ 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' }, { 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.new('smtp-server', 1, c, podLabels) +
deployment.mixin.metadata.withNamespace($._config.namespace) + deployment.mixin.metadata.withNamespace($._config.namespace) +
@ -54,9 +54,9 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
service: service:
local service = k.core.v1.service; local service = k.core.v1.service;
local servicePort = k.core.v1.service.mixin.spec.portsType; 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.withNamespace($._config.namespace) +
service.mixin.metadata.withLabels({ run: 'smtp-server' }), service.mixin.metadata.withLabels({ run: 'smtp-server' }),
}, },