From d42859c03a1063a22afe836cd110d6cdeadca69c Mon Sep 17 00:00:00 2001 From: sh0rez Date: Thu, 27 Feb 2020 21:26:13 +0100 Subject: [PATCH] fix(ksonnet): named parameters for containerPort Because ksonnet-lib switched the order of the `containerPort.new()` parameters from `ksonnet.beta.3` to `ksonnet.beta.4`, we have to use named parameters to avoid invalid resources when using one of these versions. --- production/ksonnet/loki-canary/loki-canary.libsonnet | 2 +- production/ksonnet/loki/common.libsonnet | 4 ++-- production/ksonnet/loki/gateway.libsonnet | 2 +- production/ksonnet/promtail/promtail.libsonnet | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/production/ksonnet/loki-canary/loki-canary.libsonnet b/production/ksonnet/loki-canary/loki-canary.libsonnet index 6fbf71cc74765..72e20766f219b 100644 --- a/production/ksonnet/loki-canary/loki-canary.libsonnet +++ b/production/ksonnet/loki-canary/loki-canary.libsonnet @@ -13,7 +13,7 @@ k + config { loki_canary_container:: container.new('loki-canary', $._images.loki_canary) + $.util.resourcesRequests('10m', '20Mi') + - container.withPorts($.core.v1.containerPort.new('http-metrics', 80)) + + container.withPorts($.core.v1.containerPort.new(name='http-metrics', port=80)) + container.withArgsMixin($.util.mapToFlags($.loki_canary_args)) + container.withEnv([ container.envType.fromFieldPath('HOSTNAME', 'spec.nodeName'), diff --git a/production/ksonnet/loki/common.libsonnet b/production/ksonnet/loki/common.libsonnet index 2da29bacde629..aac7809b1fc0c 100644 --- a/production/ksonnet/loki/common.libsonnet +++ b/production/ksonnet/loki/common.libsonnet @@ -7,8 +7,8 @@ defaultPorts:: [ - containerPort.newNamed(name='http-metrics', containerPort=80), - containerPort.newNamed(name='grpc', containerPort=9095), + containerPort.new(name='http-metrics', port=containerPort=80), + containerPort.new(name='grpc', port=containerPort=9095), ], }, } diff --git a/production/ksonnet/loki/gateway.libsonnet b/production/ksonnet/loki/gateway.libsonnet index 5a969d2f123d7..ccdcc8a544db7 100644 --- a/production/ksonnet/loki/gateway.libsonnet +++ b/production/ksonnet/loki/gateway.libsonnet @@ -82,7 +82,7 @@ gateway_container:: container.new('nginx', $._images.nginx) + - container.withPorts($.core.v1.containerPort.new('http', 80)) + + container.withPorts($.core.v1.containerPort.new(name='http', port=80)) + $.util.resourcesRequests('50m', '100Mi'), local deployment = $.apps.v1.deployment, diff --git a/production/ksonnet/promtail/promtail.libsonnet b/production/ksonnet/promtail/promtail.libsonnet index 93bd505c0bf73..e1180251f25fe 100644 --- a/production/ksonnet/promtail/promtail.libsonnet +++ b/production/ksonnet/promtail/promtail.libsonnet @@ -46,7 +46,7 @@ k + config + scrape_config { promtail_container:: container.new('promtail', $._images.promtail) + - container.withPorts($.core.v1.containerPort.new('http-metrics', 80)) + + container.withPorts($.core.v1.containerPort.new(name='http-metrics', port=80)) + container.withArgsMixin($.util.mapToFlags($.promtail_args)) + container.withEnv([ container.envType.fromFieldPath('HOSTNAME', 'spec.nodeName'),