From 27607c793a52d83a6698d795c9c7975964d50223 Mon Sep 17 00:00:00 2001 From: andyjk15 Date: Sat, 15 Feb 2020 21:21:47 +0000 Subject: [PATCH] [15.02.20] Finalised yamls --- configuration/kubernetes/deploy-config.yaml | 17 ++++++++--------- configuration/kubernetes/service.yaml | 17 +++++++++++++++++ configuration/pipelines/build.groovy | 16 +++------------- configuration/pipelines/deploy.groovy | 2 -- src/main/resources/application.properties | 10 ---------- 5 files changed, 28 insertions(+), 34 deletions(-) create mode 100644 configuration/kubernetes/service.yaml delete mode 100644 configuration/pipelines/deploy.groovy delete mode 100644 src/main/resources/application.properties diff --git a/configuration/kubernetes/deploy-config.yaml b/configuration/kubernetes/deploy-config.yaml index d603075..0e053b5 100644 --- a/configuration/kubernetes/deploy-config.yaml +++ b/configuration/kubernetes/deploy-config.yaml @@ -53,13 +53,12 @@ spec: secretKeyRef: name: jdbc key: jdbc.password - - imagePullPolicy: Always - resources: - requests: - cpu: 0.25 - memory: 128Mi - limits: - cpu: 0.5 - memory: 256Mi + imagePullPolicy: Always + resources: + requests: + cpu: 0.25 + memory: 128Mi + limits: + cpu: 0.5 + memory: 256Mi restartPolicy: Always \ No newline at end of file diff --git a/configuration/kubernetes/service.yaml b/configuration/kubernetes/service.yaml new file mode 100644 index 0000000..da89c61 --- /dev/null +++ b/configuration/kubernetes/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +objects: + - kind: Service + apiVersion: v1 + metadata: + labels: + name: LABEL + name: db-RESOURCE_NAME + spec: + selector: + app: db-RESOURCE_NAME + ports: + - port: 9090 + protocol: TCP + targetPort: 9090 + sessionAffinity: None + type: ClusterIP diff --git a/configuration/pipelines/build.groovy b/configuration/pipelines/build.groovy index cc31e0b..fdfbb35 100644 --- a/configuration/pipelines/build.groovy +++ b/configuration/pipelines/build.groovy @@ -37,17 +37,6 @@ def applyResource(String environment, String resourcePath, Map p sh "${command}" } -def updateBuildResources(String environment) { - Map buildConfigParameters = [ - RESOURCE_NAME : env.APPLICATION_NAME, - APP_LABEL : env.APPLICATION_LABEL, - DOCKER_REGISTRY: env.DOCKER_REGISTRY, - IMAGE_VERSION : env.APPLICATION_VERSION - ] - - applyResource(environment, 'configuration/templates/build-config.yaml', buildConfigParameters) -} - def deploy( Integer replicas ) { // rollout latest // get rollout status @@ -85,11 +74,12 @@ try { sh "sed -i 's/REPOSITORY/${env.DOCKER_REPOSITORY}/g' configuration/kubernetes/deploy-config.yaml" sh "sed -i 's/IMAGE/${env.APPLICATION_NAME}:${env.APPLICATION_VERSION}/g' configuration/kubernetes/deploy-config.yaml" - sh "sed -i 's/RESOURCE_NAME/${env.APPLICATION_NAME}/g' configuration/kubernetes/deploy-config.yaml" sh "sed -i 's/LABEL/${env.APPLICATION_LABEL}/g' configuration/kubernetes/deploy-config.yaml" - sh "cat configuration/kubernetes/deploy-config.yaml" + sh "sed -it s/RESOURCE_NAME/${env.APPLICATION_NAME}/g' configuration/kubernetes/servive.yaml" + sh "sed -it s/LABEL/${env.APPLICATION_LABEL}/g' configuration/kubernetes/servive.yaml" + sh "cat configuration/kubernetes/service.yaml" // Update build config for kubernetes // Update Service yaml for kubernetes // Update route yaml for kubernetes diff --git a/configuration/pipelines/deploy.groovy b/configuration/pipelines/deploy.groovy deleted file mode 100644 index 8b7c08c..0000000 --- a/configuration/pipelines/deploy.groovy +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env groovy - diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index 1f4a883..0000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1,10 +0,0 @@ -#server.port=9090 -#spring.jpa.database=POSTGRESQL -#spring.datasource.platform=postgres -#spring.datasource.url=jdbc:postgresql://localhost:5432/postgres -#spring.datasource.username=postgres -#spring.datasource.password=***** -#spring.jpa.show-sql=true -#spring.jpa.generate-ddl=true -#spring.jpa.hibernate.ddl-auto=create-drop -#spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true \ No newline at end of file