diff --git a/configuration/kubernetes/deploy-config.yaml b/configuration/kubernetes/deploy-config.yaml index b1d60bb..d603075 100644 --- a/configuration/kubernetes/deploy-config.yaml +++ b/configuration/kubernetes/deploy-config.yaml @@ -2,86 +2,64 @@ apiVersion: v1 kind: Deployment metadata: labels: - name: db-gateway - name: db-gateway + name: LABEL + name: RESOURCE_NAME spec: replicas: 1 selector: - app: db-gateway + app: RESOURCE_NAME strategy: type: Rolling rollingParams: updatePeriodSeconds: 1 intervalSeconds: 1 timeoutSeconds: 300 - maxSurge: 1 + maxSurge: 25% maxUnavailable: 0 template: metadata: labels: - app: db-gateway + app: RESOURCE_NAME spec: containers: - - name: db-gateway + - name: RESOURCE_NAME image: REPOSITORY/IMAGE env: - name: KUBERNETES_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - - name: CONTAINER_CORE_LIMIT - valueFrom: - resourceFieldRef: - resource: limits.cpu - - name: CONTAINER_MAX_MEMORY - valueFrom: - resourceFieldRef: - resource: limits.memory + - name: CONTAINER_CORE_LIMIT + valueFrom: + resourceFieldRef: + resource: limits.cpu + - name: CONTAINER_MAX_MEMORY + valueFrom: + resourceFieldRef: + resource: limits.memory + + - name: JDBC_URL + valueFrom: + secretKeyRef: + name: jdbc + key: jdbc.url + - name: JDBC_USERNAME + valueFrom: + secretKeyRef: + name: jdbc + key: jdbc.username + - name: JDBC_PASSWORD + valueFrom: + secretKeyRef: + name: jdbc + key: jdbc.password - - name: JDBC_URL - valueFrom: - secretKeyRef: - name: jdbc - key: jdbc.url - - name: JDBC_USERNAME - valueFrom: - secretKeyRef: - name: jdbc - key: jdbc.username - - name: JDBC_PASSWORD - valueFrom: - secretKeyRef: - name: jdbc - key: jdbc.password - - name: TZ - value: Europe/London - image: ${IMAGE}:${IMAGE_VERSION} imagePullPolicy: Always - name: db-gateway - livenessProbe: - httpGet: - path: ${LIVENESS_PATH} - port: 9090 - initialDelaySeconds: 90 - periodSeconds: 30 - timeoutSeconds: 1 - successThreshold: 1 - failureThreshold: 3 - readinessProbe: - httpGet: - path: ${READINESS_PATH} - port: 9090 - initialDelaySeconds: 90 - periodSeconds: 5 - timeoutSeconds: 1 - successThreshold: 1 - failureThreshold: 10 resources: requests: - cpu: 10m + cpu: 0.25 memory: 128Mi limits: - cpu: 500m + cpu: 0.5 memory: 256Mi - restartPolicy: Always - triggers: [] \ No newline at end of file + restartPolicy: Always \ No newline at end of file diff --git a/configuration/pipelines/build.groovy b/configuration/pipelines/build.groovy index 5acce7f..cc31e0b 100644 --- a/configuration/pipelines/build.groovy +++ b/configuration/pipelines/build.groovy @@ -1,7 +1,7 @@ #!/usr/bin/env groovy env.APPLICATION_NAME = 'db-gateway' -env.APPLICATION_LABEL = 'gateways' +env.APPLICATION_LABEL = 'gateway' env.GIT_BRANCH = 'master' env.GIT_REPOSITORY_PATH = "github.com/andyjk15/${env.APPLICATION_NAME}.git" env.GIT_REPOSITORY_URL = "https://${env.GIT_REPOSITORY_PATH}" @@ -86,6 +86,8 @@ 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" // Update build config for kubernetes