From 61da8e2fe8aff1fda725bd1e69431275ea149479 Mon Sep 17 00:00:00 2001 From: serverhorror <36151+serverhorror@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:28:03 +0200 Subject: [PATCH] BUGFIX: ods-deployments file repeats image in mono repository setup (#1023) Co-authored-by: Martin Marcher --- CHANGELOG.md | 4 + build.gradle | 3 +- .../AbstractDeploymentStrategy.groovy | 1 + src/org/ods/component/CopyImageOptions.groovy | 1 + src/org/ods/component/CopyImageStage.groovy | 1 + .../component/HelmDeploymentStrategy.groovy | 2 +- src/org/ods/component/IContext.groovy | 1 + .../ods/component/IDeploymentStrategy.groovy | 2 + .../RolloutOpenShiftDeploymentStage.groovy | 7 +- .../ods/component/ScanWithAquaOptions.groovy | 1 + .../ods/component/ScanWithAquaStage.groovy | 2 +- .../ods/component/ScanWithSonarOptions.groovy | 1 + .../ods/component/ScanWithTrivyOptions.groovy | 1 + .../ods/component/ScanWithTrivyStage.groovy | 4 +- .../component/TailorDeploymentStrategy.groovy | 2 +- src/org/ods/services/OpenShiftService.groovy | 23 +- .../HelmDeploymentStrategySpec.groovy | 2 +- .../ods/services/OpenShiftServiceSpec.groovy | 176 + ...StageRolloutOpenShiftDeploymentSpec.groovy | 2 +- test/resources/pods.json | 3624 +++++++++++++++++ vars/odsComponentStageCopyImage.groovy | 1 - 21 files changed, 3840 insertions(+), 21 deletions(-) create mode 100644 test/resources/pods.json diff --git a/CHANGELOG.md b/CHANGELOG.md index c3b5afe7b..fd7296101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Unreleased +* Fix ods-deployments file repeats image in mono repository setup ([#1011](https://github.com/opendevstack/ods-jenkins-shared-library/issues/1011)) * Preload images into the cluster before initiating the rollout process using Helm ([#1026](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1026)). * Given that Helm performs an atomic rollout, it's necessary to import all images into the mono repository prior to initiating the rollout process with Helm. @@ -29,6 +30,9 @@ ## [4.3.4] - 2024-02-20 * Fix documentation refers to qs with prefix infra- however there are only inf- quickstarters ([#1060](https://github.com/opendevstack/ods-jenkins-shared-library/issues/1060)) +* Fix ods-deployments file repeats image in mono repository setup ([#1011](https://github.com/opendevstack/ods-jenkins-shared-library/issues/1011)) +* Fix parameter count warning in ([86e1d](https://github.com/opendevstack/ods-jenkins-shared-library/commit/86e1d583b271446ef1489339da0912f78406e40d)) +* Remove `jvmArgs "-XX:MaxPermSize=256m"` from build.gradle as it is no longer supported (See https://docs.oracle.com/javase/9/migrate/#GUID-1F270BDA-50B0-49C8-807E-0B727CCC5169) * Aqua scanner and Helm deployment conflict fix for jenkins shared library ([#1067](https://github.com/opendevstack/ods-jenkins-shared-library/issues/1067)) * Fix ods-infra components require OpenShift projects in Deploy stage ([#1047](https://github.com/opendevstack/ods-jenkins-shared-library/issues/1047)) diff --git a/build.gradle b/build.gradle index c70e7fc72..43b3b763a 100644 --- a/build.gradle +++ b/build.gradle @@ -121,7 +121,6 @@ test { systemProperty 'com.athaydes.spockframework.report.projectName', 'ods-jenkins-shared-library' systemProperty 'com.athaydes.spockframework.report.projectVersion', version maxHeapSize = "2048m" - jvmArgs "-XX:MaxPermSize=256m" systemProperty "testRecordMode", project.findProperty('testRecordMode')?: false systemProperty "generateExpectedPdfFiles", project.findProperty('generateExpectedPdfFiles')?: false systemProperty "nexusURL", project.findProperty('nexusURL')?: "http://nexus.odsbox.lan:7990" @@ -137,7 +136,7 @@ test { } codenarc { - toolVersion = '1.5' + toolVersion = '1.6' configFile = file('codenarc.groovy') maxPriority1Violations = 0 maxPriority2Violations = 1 diff --git a/src/org/ods/component/AbstractDeploymentStrategy.groovy b/src/org/ods/component/AbstractDeploymentStrategy.groovy index 80bd48a93..359541c9a 100644 --- a/src/org/ods/component/AbstractDeploymentStrategy.groovy +++ b/src/org/ods/component/AbstractDeploymentStrategy.groovy @@ -52,4 +52,5 @@ abstract class AbstractDeploymentStrategy implements IDeploymentStrategy { !it.startsWith("imported-") } } + } diff --git a/src/org/ods/component/CopyImageOptions.groovy b/src/org/ods/component/CopyImageOptions.groovy index 61f72c1dc..3000f54a2 100644 --- a/src/org/ods/component/CopyImageOptions.groovy +++ b/src/org/ods/component/CopyImageOptions.groovy @@ -37,4 +37,5 @@ class CopyImageOptions extends Options { private String image @SuppressWarnings('UnusedPrivateField') private String imageTag + } diff --git a/src/org/ods/component/CopyImageStage.groovy b/src/org/ods/component/CopyImageStage.groovy index 0f3b59623..f220647d1 100644 --- a/src/org/ods/component/CopyImageStage.groovy +++ b/src/org/ods/component/CopyImageStage.groovy @@ -103,4 +103,5 @@ class CopyImageStage extends Stage { "(${context.componentId}) " + "${this.options.registry}/${this.options.repo}/${this.options.image}'" } + } diff --git a/src/org/ods/component/HelmDeploymentStrategy.groovy b/src/org/ods/component/HelmDeploymentStrategy.groovy index eb43c80aa..15780f8ab 100644 --- a/src/org/ods/component/HelmDeploymentStrategy.groovy +++ b/src/org/ods/component/HelmDeploymentStrategy.groovy @@ -165,7 +165,7 @@ class HelmDeploymentStrategy extends AbstractDeploymentStrategy { resourceNames.each { resourceName -> def podData = [] for (def i = 0; i < options.deployTimeoutRetries; i++) { - podData = openShift.checkForPodData(context.targetProject, options.selector) + podData = openShift.checkForPodData(context.targetProject, options.selector, resourceName) if (!podData.isEmpty()) { break } diff --git a/src/org/ods/component/IContext.groovy b/src/org/ods/component/IContext.groovy index 37cb6642d..ebe35105a 100644 --- a/src/org/ods/component/IContext.groovy +++ b/src/org/ods/component/IContext.groovy @@ -206,4 +206,5 @@ interface IContext { // get the internal cluster registry address String getClusterRegistryAddress () + } diff --git a/src/org/ods/component/IDeploymentStrategy.groovy b/src/org/ods/component/IDeploymentStrategy.groovy index 958b56787..835ef47f2 100644 --- a/src/org/ods/component/IDeploymentStrategy.groovy +++ b/src/org/ods/component/IDeploymentStrategy.groovy @@ -4,5 +4,7 @@ import org.ods.util.PodData @SuppressWarnings('MethodCount') interface IDeploymentStrategy { + Map> deploy() + } diff --git a/src/org/ods/component/RolloutOpenShiftDeploymentStage.groovy b/src/org/ods/component/RolloutOpenShiftDeploymentStage.groovy index cdf4fe97f..e5c424ef5 100644 --- a/src/org/ods/component/RolloutOpenShiftDeploymentStage.groovy +++ b/src/org/ods/component/RolloutOpenShiftDeploymentStage.groovy @@ -5,8 +5,6 @@ import groovy.transform.TypeCheckingMode import org.ods.services.OpenShiftService import org.ods.services.JenkinsService import org.ods.util.ILogger -//import org.ods.openshift.OpenShiftResourceMetadata -//import org.ods.util.PodData @SuppressWarnings('ParameterCount') @TypeChecked @@ -19,7 +17,6 @@ class RolloutOpenShiftDeploymentStage extends Stage { private IDeploymentStrategy deploymentStrategy private Map config - @SuppressWarnings(['AbcMetric', 'CyclomaticComplexity']) @TypeChecked(TypeCheckingMode.SKIP) RolloutOpenShiftDeploymentStage( @@ -101,7 +98,6 @@ class RolloutOpenShiftDeploymentStage extends Stage { this.options = new RolloutOpenShiftDeploymentOptions(config) this.openShift = openShift this.jenkins = jenkins - } // This is called from Stage#execute if the branch being built is eligible. @@ -119,7 +115,7 @@ class RolloutOpenShiftDeploymentStage extends Stage { def isTailorDeployment = steps.fileExists(options.openshiftDir) logger.info("isTailorDeployment: ${isTailorDeployment}") - if (isTailorDeployment && isHelmDeployment){ + if (isTailorDeployment && isHelmDeployment) { steps.error("Must be either a Tailor based deployment or a Helm based deployment") throw new IllegalStateException("Must be either a Tailor based deployment or a Helm based deployment") } @@ -143,4 +139,5 @@ class RolloutOpenShiftDeploymentStage extends Stage { } STAGE_NAME } + } diff --git a/src/org/ods/component/ScanWithAquaOptions.groovy b/src/org/ods/component/ScanWithAquaOptions.groovy index 81db2d318..8dfc81022 100644 --- a/src/org/ods/component/ScanWithAquaOptions.groovy +++ b/src/org/ods/component/ScanWithAquaOptions.groovy @@ -15,4 +15,5 @@ class ScanWithAquaOptions extends Options { /** * Timeout of scan (defaults to 5 minutes - 300 seconds). */ Integer scanTimeoutSeconds + } diff --git a/src/org/ods/component/ScanWithAquaStage.groovy b/src/org/ods/component/ScanWithAquaStage.groovy index 78ac8881b..83a1fe41b 100644 --- a/src/org/ods/component/ScanWithAquaStage.groovy +++ b/src/org/ods/component/ScanWithAquaStage.groovy @@ -195,7 +195,7 @@ class ScanWithAquaStage extends Stage { ]) } if (messages) { - data.put("messages",[ + data.put("messages", [ [ title: "Messages", value: prepareMessageToBitbucket(messages), ] ]) } diff --git a/src/org/ods/component/ScanWithSonarOptions.groovy b/src/org/ods/component/ScanWithSonarOptions.groovy index e8b05f253..7f5c27e61 100644 --- a/src/org/ods/component/ScanWithSonarOptions.groovy +++ b/src/org/ods/component/ScanWithSonarOptions.groovy @@ -42,4 +42,5 @@ class ScanWithSonarOptions extends Options { * In order to be able to receive the imageRef for scanning, the `resourceName` needs * to be the same as in BuildOpenShiftImageStage. */ String resourceName + } diff --git a/src/org/ods/component/ScanWithTrivyOptions.groovy b/src/org/ods/component/ScanWithTrivyOptions.groovy index e224fa6c7..c858674cb 100644 --- a/src/org/ods/component/ScanWithTrivyOptions.groovy +++ b/src/org/ods/component/ScanWithTrivyOptions.groovy @@ -43,4 +43,5 @@ class ScanWithTrivyOptions extends Options { * possible value. * Example: `['--debug', '--timeout=10m']` */ List additionalFlags + } diff --git a/src/org/ods/component/ScanWithTrivyStage.groovy b/src/org/ods/component/ScanWithTrivyStage.groovy index 6e819ed09..08b1be4a9 100644 --- a/src/org/ods/component/ScanWithTrivyStage.groovy +++ b/src/org/ods/component/ScanWithTrivyStage.groovy @@ -98,7 +98,7 @@ class ScanWithTrivyStage extends Stage { default: logger.info "An unknown return code was returned: ${returnCode}" } - logger.infoClocked(options.resourceName,"Trivy scan (via CLI)") + logger.infoClocked(options.resourceName, "Trivy scan (via CLI)") return returnCode } @@ -123,7 +123,7 @@ class ScanWithTrivyStage extends Stage { ] if (messages) { - data.put("messages",[ + data.put("messages", [ [ title: "Messages", value: prepareMessageToBitbucket(messages), ] ]) } diff --git a/src/org/ods/component/TailorDeploymentStrategy.groovy b/src/org/ods/component/TailorDeploymentStrategy.groovy index aa8a33ec9..bb0d18175 100644 --- a/src/org/ods/component/TailorDeploymentStrategy.groovy +++ b/src/org/ods/component/TailorDeploymentStrategy.groovy @@ -160,7 +160,7 @@ class TailorDeploymentStrategy extends AbstractDeploymentStrategy { 'tailorParamFile': options.tailorParamFile, 'tailorParams': options.tailorParams, 'tailorPreserve': options.tailorPreserve, - 'tailorVerify': options.tailorVerify + 'tailorVerify': options.tailorVerify, ]) rolloutData["${resourceKind}/${resourceName}"] = podData // TODO: Once the orchestration pipeline can deal with multiple replicas, diff --git a/src/org/ods/services/OpenShiftService.groovy b/src/org/ods/services/OpenShiftService.groovy index 9e5b76932..cf0cf7f39 100644 --- a/src/org/ods/services/OpenShiftService.groovy +++ b/src/org/ods/services/OpenShiftService.groovy @@ -1016,21 +1016,32 @@ class OpenShiftService { } @TypeChecked(TypeCheckingMode.SKIP) - // checkForPodData returns a subset of information from every pod, once - // all pods matching the label are "running". If this is not the case, - // it returns an empty list. - List checkForPodData(String project, String label) { - List pods = [] + // checkForPodData returns a subset of information from every pod. + // It only considers the pods matching a label and are in a state of "running". + // If this is not the case, it returns an empty list. + List checkForPodData(String project, String label, String resourceName = null) { def stdout = steps.sh( script: "oc -n ${project} get pod -l ${label} -o json", returnStdout: true, label: "Getting OpenShift pod data for pods labelled with ${label}" ).toString().trim() def podJson = new JsonSlurperClassic().parseText(stdout) + return parsePodJson(podJson, resourceName) + } + + @TypeChecked(TypeCheckingMode.SKIP) + List parsePodJson(podJson, String resourceName = null) { + List pods = [] if (podJson && podJson.items.collect { it.status?.phase?.toLowerCase() }.every { it == 'running' }) { + // If we got passed a resourceName we need to collect all the pod data from each pod pods = extractPodData(podJson) } - pods + // if we have a resourceName only return the items matching that + if (resourceName != null) { + def filteredPods= pods.findAll { it.podName.startsWith(resourceName) } + return filteredPods + } + return pods } private String getPodManagerName(String project, String kind, String name, int revision) { diff --git a/test/groovy/org/ods/component/HelmDeploymentStrategySpec.groovy b/test/groovy/org/ods/component/HelmDeploymentStrategySpec.groovy index ad3f29f99..81edfd3b5 100644 --- a/test/groovy/org/ods/component/HelmDeploymentStrategySpec.groovy +++ b/test/groovy/org/ods/component/HelmDeploymentStrategySpec.groovy @@ -62,7 +62,7 @@ class HelmDeploymentStrategySpec extends PipelineSpockTestBase { def ctxData = contextData + [environment: 'dev', targetProject: 'foo-dev', openshiftRolloutTimeoutRetries: 5, chartDir: 'chart'] IContext context = new Context(null, ctxData, logger) OpenShiftService openShiftService = Mock(OpenShiftService.class) - openShiftService.checkForPodData('foo-dev', 'app=foo-bar') >> [new PodData([deploymentId: "${contextData.componentId}-124"])] + openShiftService.checkForPodData(*_) >> [new PodData([deploymentId: "${contextData.componentId}-124"])] ServiceRegistry.instance.add(OpenShiftService, openShiftService) JenkinsService jenkinsService = Stub(JenkinsService.class) diff --git a/test/groovy/org/ods/services/OpenShiftServiceSpec.groovy b/test/groovy/org/ods/services/OpenShiftServiceSpec.groovy index 88754f6df..efbabf285 100644 --- a/test/groovy/org/ods/services/OpenShiftServiceSpec.groovy +++ b/test/groovy/org/ods/services/OpenShiftServiceSpec.groovy @@ -1,9 +1,11 @@ + package org.ods.services import groovy.json.JsonSlurperClassic import org.ods.util.ILogger import org.ods.util.IPipelineSteps import org.ods.util.Logger +import org.ods.util.PodData import spock.lang.Unroll import util.FixtureHelper import util.OpenShiftHelper @@ -58,6 +60,180 @@ class OpenShiftServiceSpec extends SpecHelper { 'baz/qux@sha256:abc' | 'n/a' || '' | 'baz' | 'qux' | 'sha256:abc' | 'abc' } + def "multiple pods data extraction"() { + given: + def steps = Spy(util.PipelineSteps) + def service = new OpenShiftService(steps, new Logger(steps, false)) + def file = new FixtureHelper().getResource("pods.json") + List expected = [ + [ + podName : 'example-be-adapter-5dc8d77dbd-cns9z', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-24T11:58:29Z', + deploymentId : 'example-be-adapter-5dc8d77dbd', + podNode : 'ip-10-32-10-150.eu-west-1.compute.internal', + podIp : '192.0.2.100', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-24T11:58:29Z', + containers : ['be-adapter': 'image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-adapter@sha256:d043df9c66af57297f7ff2157f9c2f801e16122649830e4fbf8e09237a8ccc82'] + ], + [ + podName : 'example-be-adapter-db-5cdd4dddd9-4v4wn', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-08T00:16:00Z', + deploymentId : 'example-be-adapter-db-5cdd4dddd9', + podNode : 'ip-10-32-8-151.eu-west-1.compute.internal', + podIp : '192.0.2.42', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-08T00:16:00Z', + containers : ['be-adapter-db': 'registry.redhat.io/rhscl/postgresql-13-rhel7@sha256:c6fde1a8653a597c18b0326bc71ce4a614273be74b9aef3ced83a1b11472687a'] + ], + [ + podName : 'example-be-cache-58d6d45c57-99tvn', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-08T04:24:57Z', + deploymentId : 'example-be-cache-58d6d45c57', + podNode : 'ip-10-32-9-116.eu-west-1.compute.internal', + podIp : '192.0.2.34', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-08T04:24:57Z', + containers : ['be-cache': 'registry.redhat.io/rhscl/redis-5-rhel7@sha256:52ffb5bf944593c290c2de52db5117044e58633385dcbe70679ea69ff0c5ff01'] + ], + [ + podName : 'example-be-datafeed-576bc779f8-9tftp', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-24T11:58:29Z', + deploymentId : 'example-be-datafeed-576bc779f8', + podNode : 'ip-10-32-9-69.eu-west-1.compute.internal', + podIp : '192.0.2.173', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-24T11:58:29Z', + containers : ['be-datafeed': 'image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-datafeed@sha256:4cb8d88d1ba4e71e20cc6b9a7e8563f5a3bdd9c3fd802c33420b58139d2a2170'] + ], + [ + podName : 'example-be-datafeed-576bc779f8-m6vxf', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-24T11:58:29Z', + deploymentId : 'example-be-datafeed-576bc779f8', + podNode : 'ip-10-32-8-176.eu-west-1.compute.internal', + podIp : '192.0.2.158', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-24T11:58:29Z', + containers : ['be-datafeed': 'image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-datafeed@sha256:4cb8d88d1ba4e71e20cc6b9a7e8563f5a3bdd9c3fd802c33420b58139d2a2170'] + ], + [ + podName : 'example-be-gateway-7c7d8cc68b-p9skv', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-24T11:58:29Z', + deploymentId : 'example-be-gateway-7c7d8cc68b', + podNode : 'ip-10-32-10-154.eu-west-1.compute.internal', + podIp : '192.0.2.171', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-24T11:58:29Z', + containers : ['be-gateway': 'image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-gateway@sha256:94dd09c933f2b202dd629c8048e534c6b84b3cfc38cd1ef8553ac51de91fb11f'] + ], + [ + podName : 'example-be-main-5ffddb5dc9-hn24m', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-24T11:58:29Z', + deploymentId : 'example-be-main-5ffddb5dc9', + podNode : 'ip-10-32-9-69.eu-west-1.compute.internal', + podIp : '192.0.2.172', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-24T11:58:29Z', + containers : [ + 'be-main' : 'image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-main@sha256:45dcb5214ff20b6374a502e9bd1bba0657073210e38eba0cbd1d9f5ddfa27c67', + 'fluent-bit-be-main': 'public.ecr.aws/aws-observability/aws-for-fluent-bit@sha256:741c65dc7fa8383c5517886e73b2740e52d2e69bf62f26fac17059144c9a6a54'] + ], + [ + podName : 'example-be-main-5ffddb5dc9-xjb2n', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-24T11:58:29Z', + deploymentId : 'example-be-main-5ffddb5dc9', + podNode : 'ip-10-32-10-154.eu-west-1.compute.internal', + podIp : '192.0.2.173', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-24T11:58:29Z', + containers : [ + 'be-main' : 'image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-main@sha256:45dcb5214ff20b6374a502e9bd1bba0657073210e38eba0cbd1d9f5ddfa27c67', + 'fluent-bit-be-main': 'public.ecr.aws/aws-observability/aws-for-fluent-bit@sha256:741c65dc7fa8383c5517886e73b2740e52d2e69bf62f26fac17059144c9a6a54'] + ], + [ + podName : 'example-be-token-6fcb4d85d6-7jr2r', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-24T11:58:29Z', + deploymentId : 'example-be-token-6fcb4d85d6', + podNode : 'ip-10-32-10-30.eu-west-1.compute.internal', + podIp : '192.0.2.172', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-24T11:58:29Z', + containers : ['be-token': 'image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-token@sha256:cc5e57f98ee789429384e8df2832a89fbf1092b724aa8f3faff2708e227cb39e'] + ], + [ + podName : 'example-be-token-6fcb4d85d6-ndp8x', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-24T11:58:29Z', + deploymentId : 'example-be-token-6fcb4d85d6', + podNode : 'ip-10-32-9-69.eu-west-1.compute.internal', + podIp : '192.0.2.171', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-24T11:58:29Z', + containers : ['be-token': 'image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-token@sha256:cc5e57f98ee789429384e8df2832a89fbf1092b724aa8f3faff2708e227cb39e'] + ] + ] + + when: + def podJson = new JsonSlurperClassic().parseText(file.text) + def results = service.parsePodJson(podJson, null) + + then: + results.size() == expected.size() + for (int i = 0; i < results.size(); i++) { + results[i].toMap() == expected[i] + } + } + + def "multiple pods data extraction with resourceName"() { + given: + def steps = Spy(util.PipelineSteps) + def service = new OpenShiftService(steps, new Logger(steps, false)) + def file = new FixtureHelper().getResource("pods.json") + List expected = [ + [ + podName : 'example-be-token-6fcb4d85d6-7jr2r', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-24T11:58:29Z', + deploymentId : 'example-be-token-6fcb4d85d6', + podNode : 'ip-10-32-10-30.eu-west-1.compute.internal', + podIp : '192.0.2.172', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-24T11:58:29Z', + containers : ['be-token': 'image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-token@sha256:cc5e57f98ee789429384e8df2832a89fbf1092b724aa8f3faff2708e227cb39e'] + ], + [ + podName : 'example-be-token-6fcb4d85d6-ndp8x', + podNamespace : 'proj-dev', + podMetaDataCreationTimestamp: '2023-07-24T11:58:29Z', + deploymentId : 'example-be-token-6fcb4d85d6', + podNode : 'ip-10-32-9-69.eu-west-1.compute.internal', + podIp : '192.0.2.171', + podStatus : 'Running', + podStartupTimeStamp : '2023-07-24T11:58:29Z', + containers : ['be-token': 'image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-token@sha256:cc5e57f98ee789429384e8df2832a89fbf1092b724aa8f3faff2708e227cb39e'] + ] + ] + + when: + def podJson = new JsonSlurperClassic().parseText(file.text) + def results = service.parsePodJson(podJson, 'example-be-token') + + then: + results.size() == expected.size() + for (int i = 0; i < results.size(); i++) { + results[i].toMap() == expected[i] + } + } + def "pod data extraction"() { given: def steps = Spy(util.PipelineSteps) diff --git a/test/groovy/vars/OdsComponentStageRolloutOpenShiftDeploymentSpec.groovy b/test/groovy/vars/OdsComponentStageRolloutOpenShiftDeploymentSpec.groovy index a1aa0ca99..b444b9170 100644 --- a/test/groovy/vars/OdsComponentStageRolloutOpenShiftDeploymentSpec.groovy +++ b/test/groovy/vars/OdsComponentStageRolloutOpenShiftDeploymentSpec.groovy @@ -157,7 +157,7 @@ class OdsComponentStageRolloutOpenShiftDeploymentSpec extends PipelineSpockTestB openShiftService.rollout(*_) >> "${config.componentId}-124" openShiftService.getPodDataForDeployment(*_) >> [new PodData([ deploymentId: "${config.componentId}-124" ])] openShiftService.getImagesOfDeployment(*_) >> [[ repository: 'foo', name: 'bar' ]] - openShiftService.checkForPodData('foo-dev', 'app=foo-bar') >> [new PodData([deploymentId: "${config.componentId}-124"])] + openShiftService.checkForPodData(*_) >> [new PodData([deploymentId: "${config.componentId}-124"])] ServiceRegistry.instance.add(OpenShiftService, openShiftService) JenkinsService jenkinsService = Stub(JenkinsService.class) jenkinsService.maybeWithPrivateKeyCredentials(*_) >> { args -> args[1]('/tmp/file') } diff --git a/test/resources/pods.json b/test/resources/pods.json new file mode 100644 index 000000000..3b06e8f34 --- /dev/null +++ b/test/resources/pods.json @@ -0,0 +1,3624 @@ +{ + "apiVersion": "v1", + "items": [ + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "annotations": { + "openshift.io/scc": "restricted-v2", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "creationTimestamp": "2023-07-24T11:58:29Z", + "generateName": "example-be-adapter-5dc8d77dbd-", + "labels": { + "app.kubernetes.io/instance": "example", + "app.kubernetes.io/name": "proj-example", + "example.service": "be-adapter", + "pod-template-hash": "5dc8d77dbd" + }, + "name": "example-be-adapter-5dc8d77dbd-cns9z", + "namespace": "proj-dev", + "ownerReferences": [ + { + "apiVersion": "apps/v1", + "blockOwnerDeletion": true, + "controller": true, + "kind": "ReplicaSet", + "name": "example-be-adapter-5dc8d77dbd", + "uid": "4688aab6-4625-4880-8c68-7952ce02e488" + } + ], + "resourceVersion": "2974931132", + "uid": "4dd9db29-10ae-44f7-b88d-783212cbfda9" + }, + "spec": { + "containers": [ + { + "env": [ + { + "name": "ENVIRONMENT", + "value": "dev" + }, + { + "name": "IN_HOSPITAL", + "value": "False" + }, + { + "name": "LOG_LEVEL", + "value": "DEBUG" + }, + { + "name": "LOAD_TEST_DATA", + "value": "True" + }, + { + "name": "REDIS_HOST", + "value": "example-be-cache" + }, + { + "name": "REDIS_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "password", + "name": "be-cache" + } + } + }, + { + "name": "DYNATRACE_TOKEN", + "valueFrom": { + "secretKeyRef": { + "key": "token", + "name": "dynatrace" + } + } + }, + { + "name": "DYNATRACE_URL", + "valueFrom": { + "secretKeyRef": { + "key": "url", + "name": "dynatrace" + } + } + }, + { + "name": "POSTGRES_HOST", + "value": "example-be-adapter-db" + }, + { + "name": "POSTGRES_DB", + "valueFrom": { + "secretKeyRef": { + "key": "db", + "name": "be-adapter-db" + } + } + }, + { + "name": "POSTGRES_USER", + "valueFrom": { + "secretKeyRef": { + "key": "user", + "name": "be-adapter-db" + } + } + }, + { + "name": "POSTGRES_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "password", + "name": "be-adapter-db" + } + } + }, + { + "name": "JWK_DOMAIN", + "value": "id.dev.example.com" + }, + { + "name": "JWK_AUDIENCE", + "value": "https://adapter-dev.tools.example.com" + }, + { + "name": "AUDIT_LOG_PATH", + "value": "/var/log/proj/audit" + } + ], + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-adapter:cd1efdaf", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": { + "failureThreshold": 3, + "initialDelaySeconds": 30, + "periodSeconds": 10, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "name": "be-adapter", + "ports": [ + { + "containerPort": 8080, + "name": "http", + "protocol": "TCP" + } + ], + "readinessProbe": { + "failureThreshold": 2, + "initialDelaySeconds": 10, + "periodSeconds": 5, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "resources": { + "limits": { + "cpu": "200m", + "memory": "256Mi" + }, + "requests": { + "cpu": "100m", + "memory": "128Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/var/log/proj/audit", + "name": "audit-logs" + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-qmg7v", + "readOnly": true + } + ] + } + ], + "dnsPolicy": "ClusterFirst", + "enableServiceLinks": true, + "imagePullSecrets": [ + { + "name": "default-dockercfg-5ggw9" + } + ], + "nodeName": "ip-10-32-10-150.eu-west-1.compute.internal", + "preemptionPolicy": "PreemptLowerPriority", + "priority": 0, + "restartPolicy": "Always", + "schedulerName": "default-scheduler", + "securityContext": { + "fsGroup": 1002380000, + "seLinuxOptions": { + "level": "s0:c49,c14" + }, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "serviceAccount": "default", + "serviceAccountName": "default", + "terminationGracePeriodSeconds": 30, + "tolerations": [ + { + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoSchedule", + "key": "node.kubernetes.io/memory-pressure", + "operator": "Exists" + } + ], + "volumes": [ + { + "emptyDir": {}, + "name": "audit-logs" + }, + { + "name": "kube-api-access-qmg7v", + "projected": { + "defaultMode": 420, + "sources": [ + { + "serviceAccountToken": { + "expirationSeconds": 3607, + "path": "token" + } + }, + { + "configMap": { + "items": [ + { + "key": "ca.crt", + "path": "ca.crt" + } + ], + "name": "kube-root-ca.crt" + } + }, + { + "downwardAPI": { + "items": [ + { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + }, + "path": "namespace" + } + ] + } + }, + { + "configMap": { + "items": [ + { + "key": "service-ca.crt", + "path": "service-ca.crt" + } + ], + "name": "openshift-service-ca.crt" + } + } + ] + } + } + ] + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "Initialized" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:44Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:44Z", + "status": "True", + "type": "ContainersReady" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "PodScheduled" + } + ], + "containerStatuses": [ + { + "containerID": "cri-o://1d871617b8908332ec103daa5e438cb130f110cd4b6debe008d86858ccdd1c69", + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-adapter:cd1efdaf", + "imageID": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-adapter@sha256:d043df9c66af57297f7ff2157f9c2f801e16122649830e4fbf8e09237a8ccc82", + "lastState": {}, + "name": "be-adapter", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-24T11:58:34Z" + } + } + } + ], + "hostIP": "192.0.2.150", + "phase": "Running", + "podIP": "192.0.2.100", + "podIPs": [ + { + "ip": "192.0.2.100" + } + ], + "qosClass": "Burstable", + "startTime": "2023-07-24T11:58:29Z" + } + }, + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "annotations": { + "openshift.io/scc": "restricted-v2", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "creationTimestamp": "2023-07-08T00:16:00Z", + "generateName": "example-be-adapter-db-5cdd4dddd9-", + "labels": { + "app.kubernetes.io/instance": "example", + "app.kubernetes.io/name": "proj-example", + "example.service": "be-adapter-db", + "pod-template-hash": "5cdd4dddd9" + }, + "name": "example-be-adapter-db-5cdd4dddd9-4v4wn", + "namespace": "proj-dev", + "ownerReferences": [ + { + "apiVersion": "apps/v1", + "blockOwnerDeletion": true, + "controller": true, + "kind": "ReplicaSet", + "name": "example-be-adapter-db-5cdd4dddd9", + "uid": "7a3b5fd4-3857-4739-ace6-767a4a72a2cf" + } + ], + "resourceVersion": "2992434762", + "uid": "e7b23a00-dd94-4b58-84fd-23153c13d454" + }, + "spec": { + "containers": [ + { + "env": [ + { + "name": "POSTGRESQL_DATABASE", + "valueFrom": { + "secretKeyRef": { + "key": "db", + "name": "be-adapter-db" + } + } + }, + { + "name": "POSTGRESQL_USER", + "valueFrom": { + "secretKeyRef": { + "key": "user", + "name": "be-adapter-db" + } + } + }, + { + "name": "POSTGRESQL_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "password", + "name": "be-adapter-db" + } + } + } + ], + "image": "registry.redhat.io/rhscl/postgresql-13-rhel7", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": { + "exec": { + "command": [ + "/usr/libexec/check-container", + "--live" + ] + }, + "failureThreshold": 3, + "initialDelaySeconds": 120, + "periodSeconds": 10, + "successThreshold": 1, + "timeoutSeconds": 10 + }, + "name": "be-adapter-db", + "ports": [ + { + "containerPort": 5432, + "protocol": "TCP" + } + ], + "readinessProbe": { + "exec": { + "command": [ + "/usr/libexec/check-container" + ] + }, + "failureThreshold": 3, + "initialDelaySeconds": 5, + "periodSeconds": 10, + "successThreshold": 1, + "timeoutSeconds": 1 + }, + "resources": { + "limits": { + "cpu": "400m", + "memory": "256Mi" + }, + "requests": { + "cpu": "200m", + "memory": "128Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/var/lib/pgsql/data", + "name": "db-data" + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-9nrsm", + "readOnly": true + } + ] + } + ], + "dnsPolicy": "ClusterFirst", + "enableServiceLinks": true, + "imagePullSecrets": [ + { + "name": "default-dockercfg-5ggw9" + } + ], + "nodeName": "ip-10-32-8-151.eu-west-1.compute.internal", + "preemptionPolicy": "PreemptLowerPriority", + "priority": 0, + "restartPolicy": "Always", + "schedulerName": "default-scheduler", + "securityContext": { + "fsGroup": 1002380000, + "seLinuxOptions": { + "level": "s0:c49,c14" + }, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "serviceAccount": "default", + "serviceAccountName": "default", + "terminationGracePeriodSeconds": 30, + "tolerations": [ + { + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoSchedule", + "key": "node.kubernetes.io/memory-pressure", + "operator": "Exists" + } + ], + "volumes": [ + { + "name": "db-data", + "persistentVolumeClaim": { + "claimName": "be-adapter-db" + } + }, + { + "name": "kube-api-access-9nrsm", + "projected": { + "defaultMode": 420, + "sources": [ + { + "serviceAccountToken": { + "expirationSeconds": 3607, + "path": "token" + } + }, + { + "configMap": { + "items": [ + { + "key": "ca.crt", + "path": "ca.crt" + } + ], + "name": "kube-root-ca.crt" + } + }, + { + "downwardAPI": { + "items": [ + { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + }, + "path": "namespace" + } + ] + } + }, + { + "configMap": { + "items": [ + { + "key": "service-ca.crt", + "path": "service-ca.crt" + } + ], + "name": "openshift-service-ca.crt" + } + } + ] + } + } + ] + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-08T00:16:00Z", + "status": "True", + "type": "Initialized" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-26T00:15:28Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-26T00:15:28Z", + "status": "True", + "type": "ContainersReady" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-08T00:16:00Z", + "status": "True", + "type": "PodScheduled" + } + ], + "containerStatuses": [ + { + "containerID": "cri-o://7d5a9e964043054ea340f38c4e801a257d06a5cf1fbe2c05179e5121e21bfe32", + "image": "registry.redhat.io/rhscl/postgresql-13-rhel7:latest", + "imageID": "registry.redhat.io/rhscl/postgresql-13-rhel7@sha256:c6fde1a8653a597c18b0326bc71ce4a614273be74b9aef3ced83a1b11472687a", + "lastState": {}, + "name": "be-adapter-db", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-08T00:18:30Z" + } + } + } + ], + "hostIP": "192.0.2.151", + "phase": "Running", + "podIP": "192.0.2.42", + "podIPs": [ + { + "ip": "192.0.2.42" + } + ], + "qosClass": "Burstable", + "startTime": "2023-07-08T00:16:00Z" + } + }, + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "annotations": { + "openshift.io/scc": "restricted-v2", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "creationTimestamp": "2023-07-08T04:24:57Z", + "generateName": "example-be-cache-58d6d45c57-", + "labels": { + "app.kubernetes.io/instance": "example", + "app.kubernetes.io/name": "proj-example", + "example.service": "be-cache", + "pod-template-hash": "58d6d45c57" + }, + "name": "example-be-cache-58d6d45c57-99tvn", + "namespace": "proj-dev", + "ownerReferences": [ + { + "apiVersion": "apps/v1", + "blockOwnerDeletion": true, + "controller": true, + "kind": "ReplicaSet", + "name": "example-be-cache-58d6d45c57", + "uid": "6de3561a-83b9-4369-84d4-a6a877da95d0" + } + ], + "resourceVersion": "2793249305", + "uid": "17f7edb1-6570-44cb-b65b-6b3bc2e5e160" + }, + "spec": { + "containers": [ + { + "env": [ + { + "name": "REDIS_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "password", + "name": "be-cache" + } + } + } + ], + "image": "registry.redhat.io/rhscl/redis-5-rhel7", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": { + "failureThreshold": 3, + "initialDelaySeconds": 30, + "periodSeconds": 10, + "successThreshold": 1, + "tcpSocket": { + "port": 6379 + }, + "timeoutSeconds": 1 + }, + "name": "be-cache", + "ports": [ + { + "containerPort": 6379, + "protocol": "TCP" + } + ], + "readinessProbe": { + "exec": { + "command": [ + "/bin/sh", + "-i", + "-c", + "test \"$(redis-cli -h 127.0.0.1 -a $REDIS_PASSWORD ping)\" == \"PONG\"" + ] + }, + "failureThreshold": 3, + "initialDelaySeconds": 5, + "periodSeconds": 10, + "successThreshold": 1, + "timeoutSeconds": 1 + }, + "resources": { + "limits": { + "cpu": "300m", + "memory": "256Mi" + }, + "requests": { + "cpu": "150m", + "memory": "128Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/var/lib/redis/data", + "name": "redis-data" + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-6zmtb", + "readOnly": true + } + ] + } + ], + "dnsPolicy": "ClusterFirst", + "enableServiceLinks": true, + "imagePullSecrets": [ + { + "name": "default-dockercfg-5ggw9" + } + ], + "nodeName": "ip-10-32-9-116.eu-west-1.compute.internal", + "preemptionPolicy": "PreemptLowerPriority", + "priority": 0, + "restartPolicy": "Always", + "schedulerName": "default-scheduler", + "securityContext": { + "fsGroup": 1002380000, + "seLinuxOptions": { + "level": "s0:c49,c14" + }, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "serviceAccount": "default", + "serviceAccountName": "default", + "terminationGracePeriodSeconds": 30, + "tolerations": [ + { + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoSchedule", + "key": "node.kubernetes.io/memory-pressure", + "operator": "Exists" + } + ], + "volumes": [ + { + "name": "redis-data", + "persistentVolumeClaim": { + "claimName": "be-cache" + } + }, + { + "name": "kube-api-access-6zmtb", + "projected": { + "defaultMode": 420, + "sources": [ + { + "serviceAccountToken": { + "expirationSeconds": 3607, + "path": "token" + } + }, + { + "configMap": { + "items": [ + { + "key": "ca.crt", + "path": "ca.crt" + } + ], + "name": "kube-root-ca.crt" + } + }, + { + "downwardAPI": { + "items": [ + { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + }, + "path": "namespace" + } + ] + } + }, + { + "configMap": { + "items": [ + { + "key": "service-ca.crt", + "path": "service-ca.crt" + } + ], + "name": "openshift-service-ca.crt" + } + } + ] + } + } + ] + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-08T04:24:57Z", + "status": "True", + "type": "Initialized" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-08T04:27:12Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-08T04:27:12Z", + "status": "True", + "type": "ContainersReady" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-08T04:24:57Z", + "status": "True", + "type": "PodScheduled" + } + ], + "containerStatuses": [ + { + "containerID": "cri-o://ddd3dc07dc7a3c03ba90721d812c57caf4947438b59e179837f9a99be966bcda", + "image": "registry.redhat.io/rhscl/redis-5-rhel7:latest", + "imageID": "registry.redhat.io/rhscl/redis-5-rhel7@sha256:52ffb5bf944593c290c2de52db5117044e58633385dcbe70679ea69ff0c5ff01", + "lastState": {}, + "name": "be-cache", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-08T04:27:04Z" + } + } + } + ], + "hostIP": "192.0.2.116", + "phase": "Running", + "podIP": "192.0.2.34", + "podIPs": [ + { + "ip": "192.0.2.34" + } + ], + "qosClass": "Burstable", + "startTime": "2023-07-08T04:24:57Z" + } + }, + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "annotations": { + "openshift.io/scc": "restricted-v2", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "creationTimestamp": "2023-07-24T11:58:29Z", + "generateName": "example-be-datafeed-576bc779f8-", + "labels": { + "app.kubernetes.io/instance": "example", + "app.kubernetes.io/name": "proj-example", + "example.service": "be-datafeed", + "pod-template-hash": "576bc779f8" + }, + "name": "example-be-datafeed-576bc779f8-9tftp", + "namespace": "proj-dev", + "ownerReferences": [ + { + "apiVersion": "apps/v1", + "blockOwnerDeletion": true, + "controller": true, + "kind": "ReplicaSet", + "name": "example-be-datafeed-576bc779f8", + "uid": "53a10d2d-d8f4-4bdc-a309-d7a2355528ee" + } + ], + "resourceVersion": "2974932563", + "uid": "9341f96c-99a0-4526-b8d1-71a8f8f2b217" + }, + "spec": { + "containers": [ + { + "env": [ + { + "name": "ENVIRONMENT", + "value": "dev" + }, + { + "name": "LOG_LEVEL", + "value": "DEBUG" + }, + { + "name": "LOAD_TEST_DATA", + "value": "True" + }, + { + "name": "BE_TOKEN_HOST", + "value": "example-be-token" + }, + { + "name": "BE_TOKEN_PORT", + "value": "8080" + }, + { + "name": "DYNATRACE_TOKEN", + "valueFrom": { + "secretKeyRef": { + "key": "token", + "name": "dynatrace" + } + } + }, + { + "name": "DYNATRACE_URL", + "valueFrom": { + "secretKeyRef": { + "key": "url", + "name": "dynatrace" + } + } + }, + { + "name": "POSTGRES_HOST", + "value": "be-datafeed-da66e7be.cpn9bbolsmod.eu-west-1.rds.amazonaws.com" + }, + { + "name": "POSTGRES_DB", + "valueFrom": { + "secretKeyRef": { + "key": "database-name", + "name": "be-datafeed-db" + } + } + }, + { + "name": "POSTGRES_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "be-datafeed-db" + } + } + }, + { + "name": "POSTGRES_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "be-datafeed-db" + } + } + } + ], + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-datafeed:cd1efdaf", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": { + "failureThreshold": 3, + "initialDelaySeconds": 30, + "periodSeconds": 10, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "name": "be-datafeed", + "ports": [ + { + "containerPort": 8080, + "name": "http", + "protocol": "TCP" + } + ], + "readinessProbe": { + "failureThreshold": 2, + "initialDelaySeconds": 10, + "periodSeconds": 5, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "resources": { + "limits": { + "cpu": "200m", + "memory": "256Mi" + }, + "requests": { + "cpu": "100m", + "memory": "128Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/etc/pem/private", + "name": "pem-keys", + "readOnly": true + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-lnc7g", + "readOnly": true + } + ] + } + ], + "dnsPolicy": "ClusterFirst", + "enableServiceLinks": true, + "imagePullSecrets": [ + { + "name": "default-dockercfg-5ggw9" + } + ], + "nodeName": "ip-10-32-9-69.eu-west-1.compute.internal", + "preemptionPolicy": "PreemptLowerPriority", + "priority": 0, + "restartPolicy": "Always", + "schedulerName": "default-scheduler", + "securityContext": { + "fsGroup": 1002380000, + "seLinuxOptions": { + "level": "s0:c49,c14" + }, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "serviceAccount": "default", + "serviceAccountName": "default", + "terminationGracePeriodSeconds": 30, + "tolerations": [ + { + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoSchedule", + "key": "node.kubernetes.io/memory-pressure", + "operator": "Exists" + } + ], + "volumes": [ + { + "name": "pem-keys", + "projected": { + "defaultMode": 440, + "sources": [ + { + "secret": { + "items": [ + { + "key": "pem1", + "path": "rsa.key" + }, + { + "key": "pem2", + "path": "rsa-previous.key" + } + ], + "name": "pem-secret" + } + } + ] + } + }, + { + "name": "kube-api-access-lnc7g", + "projected": { + "defaultMode": 420, + "sources": [ + { + "serviceAccountToken": { + "expirationSeconds": 3607, + "path": "token" + } + }, + { + "configMap": { + "items": [ + { + "key": "ca.crt", + "path": "ca.crt" + } + ], + "name": "kube-root-ca.crt" + } + }, + { + "downwardAPI": { + "items": [ + { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + }, + "path": "namespace" + } + ] + } + }, + { + "configMap": { + "items": [ + { + "key": "service-ca.crt", + "path": "service-ca.crt" + } + ], + "name": "openshift-service-ca.crt" + } + } + ] + } + } + ] + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "Initialized" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:54Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:54Z", + "status": "True", + "type": "ContainersReady" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "PodScheduled" + } + ], + "containerStatuses": [ + { + "containerID": "cri-o://161070664dc57801717679f2a20225ae0537931c4ba9c3f810ba62b17edc6ed0", + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-datafeed:cd1efdaf", + "imageID": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-datafeed@sha256:4cb8d88d1ba4e71e20cc6b9a7e8563f5a3bdd9c3fd802c33420b58139d2a2170", + "lastState": {}, + "name": "be-datafeed", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-24T11:58:39Z" + } + } + } + ], + "hostIP": "192.0.2.69", + "phase": "Running", + "podIP": "192.0.2.173", + "podIPs": [ + { + "ip": "192.0.2.173" + } + ], + "qosClass": "Burstable", + "startTime": "2023-07-24T11:58:29Z" + } + }, + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "annotations": { + "openshift.io/scc": "restricted-v2", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "creationTimestamp": "2023-07-24T11:58:29Z", + "generateName": "example-be-datafeed-576bc779f8-", + "labels": { + "app.kubernetes.io/instance": "example", + "app.kubernetes.io/name": "proj-example", + "example.service": "be-datafeed", + "pod-template-hash": "576bc779f8" + }, + "name": "example-be-datafeed-576bc779f8-m6vxf", + "namespace": "proj-dev", + "ownerReferences": [ + { + "apiVersion": "apps/v1", + "blockOwnerDeletion": true, + "controller": true, + "kind": "ReplicaSet", + "name": "example-be-datafeed-576bc779f8", + "uid": "53a10d2d-d8f4-4bdc-a309-d7a2355528ee" + } + ], + "resourceVersion": "2974932607", + "uid": "abc6ba6a-95ef-4aa6-b35c-af5e819e8460" + }, + "spec": { + "containers": [ + { + "env": [ + { + "name": "ENVIRONMENT", + "value": "dev" + }, + { + "name": "LOG_LEVEL", + "value": "DEBUG" + }, + { + "name": "LOAD_TEST_DATA", + "value": "True" + }, + { + "name": "BE_TOKEN_HOST", + "value": "example-be-token" + }, + { + "name": "BE_TOKEN_PORT", + "value": "8080" + }, + { + "name": "DYNATRACE_TOKEN", + "valueFrom": { + "secretKeyRef": { + "key": "token", + "name": "dynatrace" + } + } + }, + { + "name": "DYNATRACE_URL", + "valueFrom": { + "secretKeyRef": { + "key": "url", + "name": "dynatrace" + } + } + }, + { + "name": "POSTGRES_HOST", + "value": "be-datafeed-da66e7be.cpn9bbolsmod.eu-west-1.rds.amazonaws.com" + }, + { + "name": "POSTGRES_DB", + "valueFrom": { + "secretKeyRef": { + "key": "database-name", + "name": "be-datafeed-db" + } + } + }, + { + "name": "POSTGRES_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "be-datafeed-db" + } + } + }, + { + "name": "POSTGRES_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "be-datafeed-db" + } + } + } + ], + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-datafeed:cd1efdaf", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": { + "failureThreshold": 3, + "initialDelaySeconds": 30, + "periodSeconds": 10, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "name": "be-datafeed", + "ports": [ + { + "containerPort": 8080, + "name": "http", + "protocol": "TCP" + } + ], + "readinessProbe": { + "failureThreshold": 2, + "initialDelaySeconds": 10, + "periodSeconds": 5, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "resources": { + "limits": { + "cpu": "200m", + "memory": "256Mi" + }, + "requests": { + "cpu": "100m", + "memory": "128Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/etc/pem/private", + "name": "pem-keys", + "readOnly": true + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-wm8s8", + "readOnly": true + } + ] + } + ], + "dnsPolicy": "ClusterFirst", + "enableServiceLinks": true, + "imagePullSecrets": [ + { + "name": "default-dockercfg-5ggw9" + } + ], + "nodeName": "ip-10-32-8-176.eu-west-1.compute.internal", + "preemptionPolicy": "PreemptLowerPriority", + "priority": 0, + "restartPolicy": "Always", + "schedulerName": "default-scheduler", + "securityContext": { + "fsGroup": 1002380000, + "seLinuxOptions": { + "level": "s0:c49,c14" + }, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "serviceAccount": "default", + "serviceAccountName": "default", + "terminationGracePeriodSeconds": 30, + "tolerations": [ + { + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoSchedule", + "key": "node.kubernetes.io/memory-pressure", + "operator": "Exists" + } + ], + "volumes": [ + { + "name": "pem-keys", + "projected": { + "defaultMode": 440, + "sources": [ + { + "secret": { + "items": [ + { + "key": "pem1", + "path": "rsa.key" + }, + { + "key": "pem2", + "path": "rsa-previous.key" + } + ], + "name": "pem-secret" + } + } + ] + } + }, + { + "name": "kube-api-access-wm8s8", + "projected": { + "defaultMode": 420, + "sources": [ + { + "serviceAccountToken": { + "expirationSeconds": 3607, + "path": "token" + } + }, + { + "configMap": { + "items": [ + { + "key": "ca.crt", + "path": "ca.crt" + } + ], + "name": "kube-root-ca.crt" + } + }, + { + "downwardAPI": { + "items": [ + { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + }, + "path": "namespace" + } + ] + } + }, + { + "configMap": { + "items": [ + { + "key": "service-ca.crt", + "path": "service-ca.crt" + } + ], + "name": "openshift-service-ca.crt" + } + } + ] + } + } + ] + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "Initialized" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:54Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:54Z", + "status": "True", + "type": "ContainersReady" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "PodScheduled" + } + ], + "containerStatuses": [ + { + "containerID": "cri-o://e3c9220831c7b5476e47b3c32f436f2c97ccd9860a44339137ca24d65322e188", + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-datafeed:cd1efdaf", + "imageID": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-datafeed@sha256:4cb8d88d1ba4e71e20cc6b9a7e8563f5a3bdd9c3fd802c33420b58139d2a2170", + "lastState": {}, + "name": "be-datafeed", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-24T11:58:37Z" + } + } + } + ], + "hostIP": "192.0.2.176", + "phase": "Running", + "podIP": "192.0.2.158", + "podIPs": [ + { + "ip": "192.0.2.158" + } + ], + "qosClass": "Burstable", + "startTime": "2023-07-24T11:58:29Z" + } + }, + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "annotations": { + "openshift.io/scc": "restricted-v2", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "creationTimestamp": "2023-07-24T11:58:29Z", + "generateName": "example-be-gateway-7c7d8cc68b-", + "labels": { + "app.kubernetes.io/instance": "example", + "app.kubernetes.io/name": "proj-example", + "example.service": "be-gateway", + "pod-template-hash": "7c7d8cc68b" + }, + "name": "example-be-gateway-7c7d8cc68b-p9skv", + "namespace": "proj-dev", + "ownerReferences": [ + { + "apiVersion": "apps/v1", + "blockOwnerDeletion": true, + "controller": true, + "kind": "ReplicaSet", + "name": "example-be-gateway-7c7d8cc68b", + "uid": "2e543097-6651-4697-bca3-33d70378e497" + } + ], + "resourceVersion": "2974931853", + "uid": "390bfda4-7d7e-4b7c-86dd-4e8ff1561ac6" + }, + "spec": { + "containers": [ + { + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-gateway:cd1efdaf", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": { + "failureThreshold": 3, + "httpGet": { + "path": "/health", + "port": 8080, + "scheme": "HTTP" + }, + "initialDelaySeconds": 30, + "periodSeconds": 10, + "successThreshold": 1, + "timeoutSeconds": 3 + }, + "name": "be-gateway", + "ports": [ + { + "containerPort": 8080, + "name": "http", + "protocol": "TCP" + } + ], + "readinessProbe": { + "failureThreshold": 1, + "httpGet": { + "path": "/health", + "port": 8080, + "scheme": "HTTP" + }, + "initialDelaySeconds": 10, + "periodSeconds": 5, + "successThreshold": 1, + "timeoutSeconds": 3 + }, + "resources": { + "limits": { + "cpu": "200m", + "memory": "512Mi" + }, + "requests": { + "cpu": "100m", + "memory": "256Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-g2z8c", + "readOnly": true + } + ] + } + ], + "dnsPolicy": "ClusterFirst", + "enableServiceLinks": true, + "imagePullSecrets": [ + { + "name": "default-dockercfg-5ggw9" + } + ], + "nodeName": "ip-10-32-10-154.eu-west-1.compute.internal", + "preemptionPolicy": "PreemptLowerPriority", + "priority": 0, + "restartPolicy": "Always", + "schedulerName": "default-scheduler", + "securityContext": { + "fsGroup": 1002380000, + "seLinuxOptions": { + "level": "s0:c49,c14" + }, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "serviceAccount": "default", + "serviceAccountName": "default", + "terminationGracePeriodSeconds": 30, + "tolerations": [ + { + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoSchedule", + "key": "node.kubernetes.io/memory-pressure", + "operator": "Exists" + } + ], + "volumes": [ + { + "name": "kube-api-access-g2z8c", + "projected": { + "defaultMode": 420, + "sources": [ + { + "serviceAccountToken": { + "expirationSeconds": 3607, + "path": "token" + } + }, + { + "configMap": { + "items": [ + { + "key": "ca.crt", + "path": "ca.crt" + } + ], + "name": "kube-root-ca.crt" + } + }, + { + "downwardAPI": { + "items": [ + { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + }, + "path": "namespace" + } + ] + } + }, + { + "configMap": { + "items": [ + { + "key": "service-ca.crt", + "path": "service-ca.crt" + } + ], + "name": "openshift-service-ca.crt" + } + } + ] + } + } + ] + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "Initialized" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:49Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:49Z", + "status": "True", + "type": "ContainersReady" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "PodScheduled" + } + ], + "containerStatuses": [ + { + "containerID": "cri-o://0107046a70727ef3ab156a3494e1a5c82edcb15814ab9cd69e5f06f6b469d7a2", + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-gateway:cd1efdaf", + "imageID": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-gateway@sha256:94dd09c933f2b202dd629c8048e534c6b84b3cfc38cd1ef8553ac51de91fb11f", + "lastState": {}, + "name": "be-gateway", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-24T11:58:37Z" + } + } + } + ], + "hostIP": "192.0.2.154", + "phase": "Running", + "podIP": "192.0.2.171", + "podIPs": [ + { + "ip": "192.0.2.171" + } + ], + "qosClass": "Burstable", + "startTime": "2023-07-24T11:58:29Z" + } + }, + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "annotations": { + "openshift.io/scc": "restricted-v2", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "creationTimestamp": "2023-07-24T11:58:29Z", + "generateName": "example-be-main-5ffddb5dc9-", + "labels": { + "app.kubernetes.io/instance": "example", + "app.kubernetes.io/name": "proj-example", + "example.service": "be-main", + "pod-template-hash": "5ffddb5dc9" + }, + "name": "example-be-main-5ffddb5dc9-hn24m", + "namespace": "proj-dev", + "ownerReferences": [ + { + "apiVersion": "apps/v1", + "blockOwnerDeletion": true, + "controller": true, + "kind": "ReplicaSet", + "name": "example-be-main-5ffddb5dc9", + "uid": "acbed48a-39d1-403d-ad5a-4905d4d10088" + } + ], + "resourceVersion": "2974931408", + "uid": "2e4de421-e96b-4ff2-a8eb-1af7aca7df9f" + }, + "spec": { + "containers": [ + { + "env": [ + { + "name": "ENVIRONMENT", + "value": "dev" + }, + { + "name": "LOG_LEVEL", + "value": "DEBUG" + }, + { + "name": "AUTH0_JWT_ISS", + "value": "https://id.dev.example.com/" + }, + { + "name": "LOAD_TEST_DATA", + "value": "True" + }, + { + "name": "BE_TOKEN_HOST", + "value": "example-be-token" + }, + { + "name": "BE_TOKEN_PORT", + "value": "8080" + }, + { + "name": "BE_DATAFEED_HOST", + "value": "example-be-datafeed" + }, + { + "name": "BE_DATAFEED_PORT", + "value": "8080" + }, + { + "name": "REDIS_HOST", + "value": "example-be-cache" + }, + { + "name": "REDIS_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "password", + "name": "be-cache" + } + } + }, + { + "name": "DYNATRACE_TOKEN", + "valueFrom": { + "secretKeyRef": { + "key": "token", + "name": "dynatrace" + } + } + }, + { + "name": "DYNATRACE_URL", + "valueFrom": { + "secretKeyRef": { + "key": "url", + "name": "dynatrace" + } + } + }, + { + "name": "POSTGRES_HOST", + "value": "be-main-da66e7be.cpn9bbolsmod.eu-west-1.rds.amazonaws.com" + }, + { + "name": "POSTGRES_DB", + "valueFrom": { + "secretKeyRef": { + "key": "database-name", + "name": "be-main-db" + } + } + }, + { + "name": "POSTGRES_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "be-main-db" + } + } + }, + { + "name": "POSTGRES_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "be-main-db" + } + } + }, + { + "name": "AWS_SERVER_PUBLIC_KEY", + "valueFrom": { + "secretKeyRef": { + "key": "AWS_SERVER_PUBLIC_KEY", + "name": "aws-s3-profile-photo" + } + } + }, + { + "name": "AWS_SERVER_SECRET_KEY", + "valueFrom": { + "secretKeyRef": { + "key": "AWS_SERVER_SECRET_KEY", + "name": "aws-s3-profile-photo" + } + } + }, + { + "name": "REGION_NAME", + "valueFrom": { + "secretKeyRef": { + "key": "REGION_NAME", + "name": "aws-s3-profile-photo" + } + } + }, + { + "name": "AWS_S3_BUCKET", + "valueFrom": { + "secretKeyRef": { + "key": "AWS_S3_BUCKET", + "name": "aws-s3-profile-photo" + } + } + }, + { + "name": "AUDIT_LOG_PATH", + "value": "/var/log/proj/audit" + } + ], + "envFrom": [ + { + "secretRef": { + "name": "auth0-m2m" + } + } + ], + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-main:cd1efdaf", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": { + "failureThreshold": 3, + "initialDelaySeconds": 30, + "periodSeconds": 10, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "name": "be-main", + "ports": [ + { + "containerPort": 8080, + "name": "http", + "protocol": "TCP" + } + ], + "readinessProbe": { + "failureThreshold": 2, + "initialDelaySeconds": 10, + "periodSeconds": 5, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "resources": { + "limits": { + "cpu": "200m", + "memory": "256Mi" + }, + "requests": { + "cpu": "100m", + "memory": "128Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/etc/pem/private", + "name": "pem-keys", + "readOnly": true + }, + { + "mountPath": "/var/log/proj/audit", + "name": "audit-logs" + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-g5kkh", + "readOnly": true + } + ] + }, + { + "args": [ + "/fluent-bit/bin/fluent-bit", + "-c", + "/fluentbit/fluentbit.toml" + ], + "env": [ + { + "name": "AWS_ACCESS_KEY_ID", + "valueFrom": { + "secretKeyRef": { + "key": "key", + "name": "cloudwatch-audit-logs" + } + } + }, + { + "name": "AWS_SECRET_ACCESS_KEY", + "valueFrom": { + "secretKeyRef": { + "key": "secret", + "name": "cloudwatch-audit-logs" + } + } + } + ], + "image": "public.ecr.aws/aws-observability/aws-for-fluent-bit:latest", + "imagePullPolicy": "Always", + "name": "fluent-bit-be-main", + "resources": { + "limits": { + "cpu": "100m", + "memory": "128Mi" + }, + "requests": { + "cpu": "50m", + "memory": "64Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/fluentbit", + "name": "fluentbit", + "readOnly": true + }, + { + "mountPath": "/var/log/proj/audit", + "name": "audit-logs" + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-g5kkh", + "readOnly": true + } + ] + } + ], + "dnsPolicy": "ClusterFirst", + "enableServiceLinks": true, + "imagePullSecrets": [ + { + "name": "default-dockercfg-5ggw9" + } + ], + "nodeName": "ip-10-32-9-69.eu-west-1.compute.internal", + "preemptionPolicy": "PreemptLowerPriority", + "priority": 0, + "restartPolicy": "Always", + "schedulerName": "default-scheduler", + "securityContext": { + "fsGroup": 1002380000, + "seLinuxOptions": { + "level": "s0:c49,c14" + }, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "serviceAccount": "default", + "serviceAccountName": "default", + "terminationGracePeriodSeconds": 30, + "tolerations": [ + { + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoSchedule", + "key": "node.kubernetes.io/memory-pressure", + "operator": "Exists" + } + ], + "volumes": [ + { + "name": "pem-keys", + "projected": { + "defaultMode": 440, + "sources": [ + { + "secret": { + "items": [ + { + "key": "pem1", + "path": "rsa.key" + }, + { + "key": "pem2", + "path": "rsa-previous.key" + } + ], + "name": "pem-secret" + } + } + ] + } + }, + { + "name": "fluentbit", + "projected": { + "defaultMode": 440, + "sources": [ + { + "configMap": { + "items": [ + { + "key": "fluentbit.toml", + "path": "fluentbit.toml" + } + ], + "name": "example-be-main-fluentbit" + } + } + ] + } + }, + { + "emptyDir": {}, + "name": "audit-logs" + }, + { + "name": "kube-api-access-g5kkh", + "projected": { + "defaultMode": 420, + "sources": [ + { + "serviceAccountToken": { + "expirationSeconds": 3607, + "path": "token" + } + }, + { + "configMap": { + "items": [ + { + "key": "ca.crt", + "path": "ca.crt" + } + ], + "name": "kube-root-ca.crt" + } + }, + { + "downwardAPI": { + "items": [ + { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + }, + "path": "namespace" + } + ] + } + }, + { + "configMap": { + "items": [ + { + "key": "service-ca.crt", + "path": "service-ca.crt" + } + ], + "name": "openshift-service-ca.crt" + } + } + ] + } + } + ] + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "Initialized" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:46Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:46Z", + "status": "True", + "type": "ContainersReady" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "PodScheduled" + } + ], + "containerStatuses": [ + { + "containerID": "cri-o://f6ccc5e4b878cb00c2097723d25575747a501d5a6fc91c1b997477d53e226006", + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-main:cd1efdaf", + "imageID": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-main@sha256:45dcb5214ff20b6374a502e9bd1bba0657073210e38eba0cbd1d9f5ddfa27c67", + "lastState": {}, + "name": "be-main", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-24T11:58:36Z" + } + } + }, + { + "containerID": "cri-o://e1aac82330d6a119da83270b80dda2ea2ff3661e52e5ac9ab8155ac0daaff859", + "image": "public.ecr.aws/aws-observability/aws-for-fluent-bit:latest", + "imageID": "public.ecr.aws/aws-observability/aws-for-fluent-bit@sha256:741c65dc7fa8383c5517886e73b2740e52d2e69bf62f26fac17059144c9a6a54", + "lastState": {}, + "name": "fluent-bit-be-main", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-24T11:58:45Z" + } + } + } + ], + "hostIP": "192.0.2.69", + "phase": "Running", + "podIP": "192.0.2.172", + "podIPs": [ + { + "ip": "192.0.2.172" + } + ], + "qosClass": "Burstable", + "startTime": "2023-07-24T11:58:29Z" + } + }, + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "annotations": { + "openshift.io/scc": "restricted-v2", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "creationTimestamp": "2023-07-24T11:58:29Z", + "generateName": "example-be-main-5ffddb5dc9-", + "labels": { + "app.kubernetes.io/instance": "example", + "app.kubernetes.io/name": "proj-example", + "example.service": "be-main", + "pod-template-hash": "5ffddb5dc9" + }, + "name": "example-be-main-5ffddb5dc9-xjb2n", + "namespace": "proj-dev", + "ownerReferences": [ + { + "apiVersion": "apps/v1", + "blockOwnerDeletion": true, + "controller": true, + "kind": "ReplicaSet", + "name": "example-be-main-5ffddb5dc9", + "uid": "acbed48a-39d1-403d-ad5a-4905d4d10088" + } + ], + "resourceVersion": "2974932551", + "uid": "1ffc3565-2b30-41f4-a719-93e776940a2e" + }, + "spec": { + "containers": [ + { + "env": [ + { + "name": "ENVIRONMENT", + "value": "dev" + }, + { + "name": "LOG_LEVEL", + "value": "DEBUG" + }, + { + "name": "AUTH0_JWT_ISS", + "value": "https://id.dev.example.com/" + }, + { + "name": "LOAD_TEST_DATA", + "value": "True" + }, + { + "name": "BE_TOKEN_HOST", + "value": "example-be-token" + }, + { + "name": "BE_TOKEN_PORT", + "value": "8080" + }, + { + "name": "BE_DATAFEED_HOST", + "value": "example-be-datafeed" + }, + { + "name": "BE_DATAFEED_PORT", + "value": "8080" + }, + { + "name": "REDIS_HOST", + "value": "example-be-cache" + }, + { + "name": "REDIS_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "password", + "name": "be-cache" + } + } + }, + { + "name": "DYNATRACE_TOKEN", + "valueFrom": { + "secretKeyRef": { + "key": "token", + "name": "dynatrace" + } + } + }, + { + "name": "DYNATRACE_URL", + "valueFrom": { + "secretKeyRef": { + "key": "url", + "name": "dynatrace" + } + } + }, + { + "name": "POSTGRES_HOST", + "value": "be-main-da66e7be.cpn9bbolsmod.eu-west-1.rds.amazonaws.com" + }, + { + "name": "POSTGRES_DB", + "valueFrom": { + "secretKeyRef": { + "key": "database-name", + "name": "be-main-db" + } + } + }, + { + "name": "POSTGRES_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "be-main-db" + } + } + }, + { + "name": "POSTGRES_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "be-main-db" + } + } + }, + { + "name": "AWS_SERVER_PUBLIC_KEY", + "valueFrom": { + "secretKeyRef": { + "key": "AWS_SERVER_PUBLIC_KEY", + "name": "aws-s3-profile-photo" + } + } + }, + { + "name": "AWS_SERVER_SECRET_KEY", + "valueFrom": { + "secretKeyRef": { + "key": "AWS_SERVER_SECRET_KEY", + "name": "aws-s3-profile-photo" + } + } + }, + { + "name": "REGION_NAME", + "valueFrom": { + "secretKeyRef": { + "key": "REGION_NAME", + "name": "aws-s3-profile-photo" + } + } + }, + { + "name": "AWS_S3_BUCKET", + "valueFrom": { + "secretKeyRef": { + "key": "AWS_S3_BUCKET", + "name": "aws-s3-profile-photo" + } + } + }, + { + "name": "AUDIT_LOG_PATH", + "value": "/var/log/proj/audit" + } + ], + "envFrom": [ + { + "secretRef": { + "name": "auth0-m2m" + } + } + ], + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-main:cd1efdaf", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": { + "failureThreshold": 3, + "initialDelaySeconds": 30, + "periodSeconds": 10, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "name": "be-main", + "ports": [ + { + "containerPort": 8080, + "name": "http", + "protocol": "TCP" + } + ], + "readinessProbe": { + "failureThreshold": 2, + "initialDelaySeconds": 10, + "periodSeconds": 5, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "resources": { + "limits": { + "cpu": "200m", + "memory": "256Mi" + }, + "requests": { + "cpu": "100m", + "memory": "128Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/etc/pem/private", + "name": "pem-keys", + "readOnly": true + }, + { + "mountPath": "/var/log/proj/audit", + "name": "audit-logs" + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-2w544", + "readOnly": true + } + ] + }, + { + "args": [ + "/fluent-bit/bin/fluent-bit", + "-c", + "/fluentbit/fluentbit.toml" + ], + "env": [ + { + "name": "AWS_ACCESS_KEY_ID", + "valueFrom": { + "secretKeyRef": { + "key": "key", + "name": "cloudwatch-audit-logs" + } + } + }, + { + "name": "AWS_SECRET_ACCESS_KEY", + "valueFrom": { + "secretKeyRef": { + "key": "secret", + "name": "cloudwatch-audit-logs" + } + } + } + ], + "image": "public.ecr.aws/aws-observability/aws-for-fluent-bit:latest", + "imagePullPolicy": "Always", + "name": "fluent-bit-be-main", + "resources": { + "limits": { + "cpu": "100m", + "memory": "128Mi" + }, + "requests": { + "cpu": "50m", + "memory": "64Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/fluentbit", + "name": "fluentbit", + "readOnly": true + }, + { + "mountPath": "/var/log/proj/audit", + "name": "audit-logs" + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-2w544", + "readOnly": true + } + ] + } + ], + "dnsPolicy": "ClusterFirst", + "enableServiceLinks": true, + "imagePullSecrets": [ + { + "name": "default-dockercfg-5ggw9" + } + ], + "nodeName": "ip-10-32-10-154.eu-west-1.compute.internal", + "preemptionPolicy": "PreemptLowerPriority", + "priority": 0, + "restartPolicy": "Always", + "schedulerName": "default-scheduler", + "securityContext": { + "fsGroup": 1002380000, + "seLinuxOptions": { + "level": "s0:c49,c14" + }, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "serviceAccount": "default", + "serviceAccountName": "default", + "terminationGracePeriodSeconds": 30, + "tolerations": [ + { + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoSchedule", + "key": "node.kubernetes.io/memory-pressure", + "operator": "Exists" + } + ], + "volumes": [ + { + "name": "pem-keys", + "projected": { + "defaultMode": 440, + "sources": [ + { + "secret": { + "items": [ + { + "key": "pem1", + "path": "rsa.key" + }, + { + "key": "pem2", + "path": "rsa-previous.key" + } + ], + "name": "pem-secret" + } + } + ] + } + }, + { + "name": "fluentbit", + "projected": { + "defaultMode": 440, + "sources": [ + { + "configMap": { + "items": [ + { + "key": "fluentbit.toml", + "path": "fluentbit.toml" + } + ], + "name": "example-be-main-fluentbit" + } + } + ] + } + }, + { + "emptyDir": {}, + "name": "audit-logs" + }, + { + "name": "kube-api-access-2w544", + "projected": { + "defaultMode": 420, + "sources": [ + { + "serviceAccountToken": { + "expirationSeconds": 3607, + "path": "token" + } + }, + { + "configMap": { + "items": [ + { + "key": "ca.crt", + "path": "ca.crt" + } + ], + "name": "kube-root-ca.crt" + } + }, + { + "downwardAPI": { + "items": [ + { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + }, + "path": "namespace" + } + ] + } + }, + { + "configMap": { + "items": [ + { + "key": "service-ca.crt", + "path": "service-ca.crt" + } + ], + "name": "openshift-service-ca.crt" + } + } + ] + } + } + ] + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "Initialized" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:54Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:54Z", + "status": "True", + "type": "ContainersReady" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "PodScheduled" + } + ], + "containerStatuses": [ + { + "containerID": "cri-o://a7c58695e81ff7453a492ccd467faa5f3c1550060a87b343be798528ab7ee14c", + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-main:cd1efdaf", + "imageID": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-main@sha256:45dcb5214ff20b6374a502e9bd1bba0657073210e38eba0cbd1d9f5ddfa27c67", + "lastState": {}, + "name": "be-main", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-24T11:58:37Z" + } + } + }, + { + "containerID": "cri-o://e7a01d883566ffbe05c311c329a74b9d750bfc4385e33a04360b6ccde80c566c", + "image": "public.ecr.aws/aws-observability/aws-for-fluent-bit:latest", + "imageID": "public.ecr.aws/aws-observability/aws-for-fluent-bit@sha256:741c65dc7fa8383c5517886e73b2740e52d2e69bf62f26fac17059144c9a6a54", + "lastState": {}, + "name": "fluent-bit-be-main", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-24T11:58:51Z" + } + } + } + ], + "hostIP": "192.0.2.154", + "phase": "Running", + "podIP": "192.0.2.173", + "podIPs": [ + { + "ip": "192.0.2.173" + } + ], + "qosClass": "Burstable", + "startTime": "2023-07-24T11:58:29Z" + } + }, + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "annotations": { + "openshift.io/scc": "restricted-v2", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "creationTimestamp": "2023-07-24T11:58:29Z", + "generateName": "example-be-token-6fcb4d85d6-", + "labels": { + "app.kubernetes.io/instance": "example", + "app.kubernetes.io/name": "proj-example", + "example.service": "be-token", + "pod-template-hash": "6fcb4d85d6" + }, + "name": "example-be-token-6fcb4d85d6-7jr2r", + "namespace": "proj-dev", + "ownerReferences": [ + { + "apiVersion": "apps/v1", + "blockOwnerDeletion": true, + "controller": true, + "kind": "ReplicaSet", + "name": "example-be-token-6fcb4d85d6", + "uid": "46c997f5-cdd0-4aea-8379-52287670e564" + } + ], + "resourceVersion": "2974931101", + "uid": "e3e48fb8-3957-4571-9691-e764cca0227e" + }, + "spec": { + "containers": [ + { + "env": [ + { + "name": "ENVIRONMENT", + "value": "dev" + }, + { + "name": "LOG_LEVEL", + "value": "DEBUG" + }, + { + "name": "LOAD_TEST_DATA", + "value": "True" + }, + { + "name": "REDIS_HOST", + "value": "example-be-cache" + }, + { + "name": "REDIS_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "password", + "name": "be-cache" + } + } + }, + { + "name": "DYNATRACE_TOKEN", + "valueFrom": { + "secretKeyRef": { + "key": "token", + "name": "dynatrace" + } + } + }, + { + "name": "DYNATRACE_URL", + "valueFrom": { + "secretKeyRef": { + "key": "url", + "name": "dynatrace" + } + } + }, + { + "name": "POSTGRES_HOST", + "value": "be-token-da66e7be.cpn9bbolsmod.eu-west-1.rds.amazonaws.com" + }, + { + "name": "POSTGRES_DB", + "valueFrom": { + "secretKeyRef": { + "key": "database-name", + "name": "be-token-db" + } + } + }, + { + "name": "POSTGRES_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "be-token-db" + } + } + }, + { + "name": "POSTGRES_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "be-token-db" + } + } + } + ], + "envFrom": [ + { + "secretRef": { + "name": "auth0-config" + } + } + ], + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-token:cd1efdaf", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": { + "failureThreshold": 3, + "initialDelaySeconds": 30, + "periodSeconds": 10, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "name": "be-token", + "ports": [ + { + "containerPort": 8080, + "name": "http", + "protocol": "TCP" + } + ], + "readinessProbe": { + "failureThreshold": 2, + "initialDelaySeconds": 10, + "periodSeconds": 5, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "resources": { + "limits": { + "cpu": "200m", + "memory": "256Mi" + }, + "requests": { + "cpu": "100m", + "memory": "128Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/etc/pem/private", + "name": "pem-keys", + "readOnly": true + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-q6vlb", + "readOnly": true + } + ] + } + ], + "dnsPolicy": "ClusterFirst", + "enableServiceLinks": true, + "imagePullSecrets": [ + { + "name": "default-dockercfg-5ggw9" + } + ], + "nodeName": "ip-10-32-10-30.eu-west-1.compute.internal", + "preemptionPolicy": "PreemptLowerPriority", + "priority": 0, + "restartPolicy": "Always", + "schedulerName": "default-scheduler", + "securityContext": { + "fsGroup": 1002380000, + "seLinuxOptions": { + "level": "s0:c49,c14" + }, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "serviceAccount": "default", + "serviceAccountName": "default", + "terminationGracePeriodSeconds": 30, + "tolerations": [ + { + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoSchedule", + "key": "node.kubernetes.io/memory-pressure", + "operator": "Exists" + } + ], + "volumes": [ + { + "name": "pem-keys", + "projected": { + "defaultMode": 440, + "sources": [ + { + "secret": { + "items": [ + { + "key": "pem1", + "path": "rsa.key" + }, + { + "key": "pem2", + "path": "rsa-previous.key" + } + ], + "name": "pem-secret" + } + } + ] + } + }, + { + "name": "kube-api-access-q6vlb", + "projected": { + "defaultMode": 420, + "sources": [ + { + "serviceAccountToken": { + "expirationSeconds": 3607, + "path": "token" + } + }, + { + "configMap": { + "items": [ + { + "key": "ca.crt", + "path": "ca.crt" + } + ], + "name": "kube-root-ca.crt" + } + }, + { + "downwardAPI": { + "items": [ + { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + }, + "path": "namespace" + } + ] + } + }, + { + "configMap": { + "items": [ + { + "key": "service-ca.crt", + "path": "service-ca.crt" + } + ], + "name": "openshift-service-ca.crt" + } + } + ] + } + } + ] + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "Initialized" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:44Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:44Z", + "status": "True", + "type": "ContainersReady" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "PodScheduled" + } + ], + "containerStatuses": [ + { + "containerID": "cri-o://517accf70fd9bd559cff5ad0c9541a3e7386abd49912a414612a56318e1fcddd", + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-token:cd1efdaf", + "imageID": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-token@sha256:cc5e57f98ee789429384e8df2832a89fbf1092b724aa8f3faff2708e227cb39e", + "lastState": {}, + "name": "be-token", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-24T11:58:33Z" + } + } + } + ], + "hostIP": "192.0.2.30", + "phase": "Running", + "podIP": "192.0.2.172", + "podIPs": [ + { + "ip": "192.0.2.172" + } + ], + "qosClass": "Burstable", + "startTime": "2023-07-24T11:58:29Z" + } + }, + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "annotations": { + "openshift.io/scc": "restricted-v2", + "seccomp.security.alpha.kubernetes.io/pod": "runtime/default" + }, + "creationTimestamp": "2023-07-24T11:58:29Z", + "generateName": "example-be-token-6fcb4d85d6-", + "labels": { + "app.kubernetes.io/instance": "example", + "app.kubernetes.io/name": "proj-example", + "example.service": "be-token", + "pod-template-hash": "6fcb4d85d6" + }, + "name": "example-be-token-6fcb4d85d6-ndp8x", + "namespace": "proj-dev", + "ownerReferences": [ + { + "apiVersion": "apps/v1", + "blockOwnerDeletion": true, + "controller": true, + "kind": "ReplicaSet", + "name": "example-be-token-6fcb4d85d6", + "uid": "46c997f5-cdd0-4aea-8379-52287670e564" + } + ], + "resourceVersion": "2974931066", + "uid": "c599d0e3-b525-469e-b30e-46d8c2de7cda" + }, + "spec": { + "containers": [ + { + "env": [ + { + "name": "ENVIRONMENT", + "value": "dev" + }, + { + "name": "LOG_LEVEL", + "value": "DEBUG" + }, + { + "name": "LOAD_TEST_DATA", + "value": "True" + }, + { + "name": "REDIS_HOST", + "value": "example-be-cache" + }, + { + "name": "REDIS_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "password", + "name": "be-cache" + } + } + }, + { + "name": "DYNATRACE_TOKEN", + "valueFrom": { + "secretKeyRef": { + "key": "token", + "name": "dynatrace" + } + } + }, + { + "name": "DYNATRACE_URL", + "valueFrom": { + "secretKeyRef": { + "key": "url", + "name": "dynatrace" + } + } + }, + { + "name": "POSTGRES_HOST", + "value": "be-token-da66e7be.cpn9bbolsmod.eu-west-1.rds.amazonaws.com" + }, + { + "name": "POSTGRES_DB", + "valueFrom": { + "secretKeyRef": { + "key": "database-name", + "name": "be-token-db" + } + } + }, + { + "name": "POSTGRES_USER", + "valueFrom": { + "secretKeyRef": { + "key": "database-user", + "name": "be-token-db" + } + } + }, + { + "name": "POSTGRES_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "key": "database-password", + "name": "be-token-db" + } + } + } + ], + "envFrom": [ + { + "secretRef": { + "name": "auth0-config" + } + } + ], + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-token:cd1efdaf", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": { + "failureThreshold": 3, + "initialDelaySeconds": 30, + "periodSeconds": 10, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "name": "be-token", + "ports": [ + { + "containerPort": 8080, + "name": "http", + "protocol": "TCP" + } + ], + "readinessProbe": { + "failureThreshold": 2, + "initialDelaySeconds": 10, + "periodSeconds": 5, + "successThreshold": 1, + "tcpSocket": { + "port": 8080 + }, + "timeoutSeconds": 3 + }, + "resources": { + "limits": { + "cpu": "200m", + "memory": "256Mi" + }, + "requests": { + "cpu": "100m", + "memory": "128Mi" + } + }, + "securityContext": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "runAsNonRoot": true, + "runAsUser": 1002380000 + }, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "volumeMounts": [ + { + "mountPath": "/etc/pem/private", + "name": "pem-keys", + "readOnly": true + }, + { + "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount", + "name": "kube-api-access-jgxhm", + "readOnly": true + } + ] + } + ], + "dnsPolicy": "ClusterFirst", + "enableServiceLinks": true, + "imagePullSecrets": [ + { + "name": "default-dockercfg-5ggw9" + } + ], + "nodeName": "ip-10-32-9-69.eu-west-1.compute.internal", + "preemptionPolicy": "PreemptLowerPriority", + "priority": 0, + "restartPolicy": "Always", + "schedulerName": "default-scheduler", + "securityContext": { + "fsGroup": 1002380000, + "seLinuxOptions": { + "level": "s0:c49,c14" + }, + "seccompProfile": { + "type": "RuntimeDefault" + } + }, + "serviceAccount": "default", + "serviceAccountName": "default", + "terminationGracePeriodSeconds": 30, + "tolerations": [ + { + "effect": "NoExecute", + "key": "node.kubernetes.io/not-ready", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoExecute", + "key": "node.kubernetes.io/unreachable", + "operator": "Exists", + "tolerationSeconds": 300 + }, + { + "effect": "NoSchedule", + "key": "node.kubernetes.io/memory-pressure", + "operator": "Exists" + } + ], + "volumes": [ + { + "name": "pem-keys", + "projected": { + "defaultMode": 440, + "sources": [ + { + "secret": { + "items": [ + { + "key": "pem1", + "path": "rsa.key" + }, + { + "key": "pem2", + "path": "rsa-previous.key" + } + ], + "name": "pem-secret" + } + } + ] + } + }, + { + "name": "kube-api-access-jgxhm", + "projected": { + "defaultMode": 420, + "sources": [ + { + "serviceAccountToken": { + "expirationSeconds": 3607, + "path": "token" + } + }, + { + "configMap": { + "items": [ + { + "key": "ca.crt", + "path": "ca.crt" + } + ], + "name": "kube-root-ca.crt" + } + }, + { + "downwardAPI": { + "items": [ + { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + }, + "path": "namespace" + } + ] + } + }, + { + "configMap": { + "items": [ + { + "key": "service-ca.crt", + "path": "service-ca.crt" + } + ], + "name": "openshift-service-ca.crt" + } + } + ] + } + } + ] + }, + "status": { + "conditions": [ + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "Initialized" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:44Z", + "status": "True", + "type": "Ready" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:44Z", + "status": "True", + "type": "ContainersReady" + }, + { + "lastProbeTime": null, + "lastTransitionTime": "2023-07-24T11:58:29Z", + "status": "True", + "type": "PodScheduled" + } + ], + "containerStatuses": [ + { + "containerID": "cri-o://66cb6dd771d0e72b13074969b1e06f185e8dcb13e3920b447f2740a303d45880", + "image": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-token:cd1efdaf", + "imageID": "image-registry.openshift-image-registry.svc:5000/proj-dev/example-be-token@sha256:cc5e57f98ee789429384e8df2832a89fbf1092b724aa8f3faff2708e227cb39e", + "lastState": {}, + "name": "be-token", + "ready": true, + "restartCount": 0, + "started": true, + "state": { + "running": { + "startedAt": "2023-07-24T11:58:34Z" + } + } + } + ], + "hostIP": "192.0.2.69", + "phase": "Running", + "podIP": "192.0.2.171", + "podIPs": [ + { + "ip": "192.0.2.171" + } + ], + "qosClass": "Burstable", + "startTime": "2023-07-24T11:58:29Z" + } + } + ], + "kind": "List", + "metadata": { + "resourceVersion": "", + "selfLink": "" + } +} diff --git a/vars/odsComponentStageCopyImage.groovy b/vars/odsComponentStageCopyImage.groovy index aa86a9c47..57f3a6b08 100644 --- a/vars/odsComponentStageCopyImage.groovy +++ b/vars/odsComponentStageCopyImage.groovy @@ -54,6 +54,5 @@ def call(IContext context, Map config = [:]) { def buildResourceName = "imported-${imageName}" odsComponentStageScanWithAqua(context, [resourceName: "${buildResourceName}", imageLabels: context.extensionImageLabels]) - } return this