From 7b983d1c6261becaaf6efc49bc80143d69426c57 Mon Sep 17 00:00:00 2001 From: Boris Shestov Date: Mon, 20 Jan 2025 18:34:00 +0300 Subject: [PATCH] [DO-1497] Add alpine podTemplate (#55) [DO-1497] Co-authored-by: Boris Shestov Reviewed-on: https://git.avroid.tech/DevOps/jenkins-shared-lib/pulls/55 Reviewed-by: Aleksandr Vodyanov --- src/tech/avroid/kube/PodTemplates.groovy | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/tech/avroid/kube/PodTemplates.groovy b/src/tech/avroid/kube/PodTemplates.groovy index 038e2aa..e22be82 100644 --- a/src/tech/avroid/kube/PodTemplates.groovy +++ b/src/tech/avroid/kube/PodTemplates.groovy @@ -272,6 +272,35 @@ class PodTemplates implements Serializable { } } + public void alpine(imageVersion='3.18.5', body) { + this.script.podTemplate( + cloud: this.cloud, + imagePullSecrets: this.dockerCreds, + containers: [ + this.script.containerTemplate( + alwaysPullImage: true, + name: 'alpine', + image: "${this.registry}/docker-hub-proxy/library/alpine:${imageVersion}", + ttyEnabled: true, + command: "cat", + resourceRequestCpu: '100m', + resourceRequestMemory: '64Mi', + resourceLimitCpu: '100m', + resourceLimitMemory: '64Mi', + ), + ], + showRawYaml: false, + volumes: [ + this.script.emptyDirVolume(memory: false, mountPath: '/tmp'), + ], + workspaceVolume: this.script.emptyDirWorkspaceVolume(false), + ) + + { + body.call() + } + } + public void containerAurora(imageVersion='5.1.0.100-2', body) { this.script.podTemplate( runAsUser: "1000", @@ -307,4 +336,5 @@ class PodTemplates implements Serializable { body.call() } } + }