From e53976d33c7611991c8a33344fd2f73211096c6e Mon Sep 17 00:00:00 2001 From: Max Audron Date: Sat, 5 Jun 2021 00:11:36 +0200 Subject: ready tanka deploy for CI --- deploy/environments/production/main.jsonnet | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 deploy/environments/production/main.jsonnet (limited to 'deploy/environments/production') diff --git a/deploy/environments/production/main.jsonnet b/deploy/environments/production/main.jsonnet new file mode 100644 index 0000000..175fbab --- /dev/null +++ b/deploy/environments/production/main.jsonnet @@ -0,0 +1,40 @@ +local k = import 'ksonnet-util/kausal.libsonnet'; +local util = import 'util/main.libsonnet'; + +function(tag, namespace, envSlug=null, projectPathSlug=null) + (util.inlineSpec('https://control.kube.cat:6443', namespace, envSlug, projectPathSlug)) + + { + _config:: self.data._config, + catinator:: self.data.catinator, + data: (import 'catinator.libsonnet') + { + _config+:: { + catinator+: { + image+: { + tag: tag, + }, + config: importstr '../../../config.toml', + }, + }, + catinator+: { + local egress = util.cilium.egressNatPolicy, + local statefulset = k.apps.v1.statefulSet, + local container = k.core.v1.container, + + statefulset+: + statefulset.spec.template.spec.withInitContainers([ + container.new('waitForEgress', 'docker.io/busybox:latest') + + container.withCommand(['/bin/sleep', '30']), + ]), + + egress: + egress.new('catinator') + + egress.withEgressSourceIP('178.63.224.13') + + egress.withDestinationCIDRs(['0.0.0.0/0']) + + egress.withPodSelector( + egress.podSelector.withMatchLabels({ + 'io.kubernetes.pod.namespace': namespace, + }) + ), + }, + }, + } -- cgit v1.2.3