diff --git a/configuration/kubernetes/deploy-config.yaml b/configuration/kubernetes/deployment.yaml similarity index 59% rename from configuration/kubernetes/deploy-config.yaml rename to configuration/kubernetes/deployment.yaml index 0e053b5..4f0dd8f 100644 --- a/configuration/kubernetes/deploy-config.yaml +++ b/configuration/kubernetes/deployment.yaml @@ -1,19 +1,18 @@ -apiVersion: v1 +apiVersion: apps/v1 kind: Deployment metadata: labels: name: LABEL name: RESOURCE_NAME + namespace: production spec: replicas: 1 selector: - app: RESOURCE_NAME + matchLabels: + app: RESOURCE_NAME strategy: - type: Rolling - rollingParams: - updatePeriodSeconds: 1 - intervalSeconds: 1 - timeoutSeconds: 300 + type: RollingUpdate + rollingUpdate: maxSurge: 25% maxUnavailable: 0 template: @@ -22,9 +21,9 @@ spec: app: RESOURCE_NAME spec: containers: - - name: RESOURCE_NAME - image: REPOSITORY/IMAGE - env: + - image: REPOSITORY/IMAGE + name: RESOURCE_NAME + env: - name: KUBERNETES_NAMESPACE valueFrom: fieldRef: @@ -53,12 +52,24 @@ spec: secretKeyRef: name: jdbc key: jdbc.password - imagePullPolicy: Always - resources: - requests: - cpu: 0.25 - memory: 128Mi - limits: - cpu: 0.5 - memory: 256Mi - restartPolicy: Always \ No newline at end of file + ports: + - containerPort: 9090 + name: RESOURCE_NAME +# readinessProbe: +# httpGet: +# path: / +# port: 9090 +# timeoutSeconds: 2 +# successThreshold: 2 +# failureThreshold: 2 + imagePullPolicy: Always + resources: + requests: + cpu: 0.25 + memory: 128Mi + limits: + cpu: 0.5 + memory: 256Mi + restartPolicy: Always + imagePullSecrets: + - name: registry-secret \ No newline at end of file diff --git a/configuration/kubernetes/service.yaml b/configuration/kubernetes/service.yaml index 94c0fb6..0966951 100644 --- a/configuration/kubernetes/service.yaml +++ b/configuration/kubernetes/service.yaml @@ -2,14 +2,13 @@ kind: Service apiVersion: v1 metadata: labels: - name: LABEL - name: RESOURCE_NAME + name: gateway + name: db-gateway spec: selector: - app: RESOURCE_NAME + app: db-gateway ports: - port: 9090 - protocol: TCP targetPort: 9090 sessionAffinity: None type: ClusterIP diff --git a/configuration/pipelines/build.groovy b/configuration/pipelines/build.groovy index a4dd4d3..e2a9a55 100644 --- a/configuration/pipelines/build.groovy +++ b/configuration/pipelines/build.groovy @@ -72,10 +72,10 @@ try { stage('Build Image') { mvn 'clean package -DskipTests' - 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 "sed -i 's/REPOSITORY/${env.DOCKER_REPOSITORY}/g' configuration/kubernetes/deployment.yaml" + sh "sed -i 's/IMAGE/${env.APPLICATION_NAME}:${env.APPLICATION_VERSION}/g' configuration/kubernetes/deployment.yaml" + sh "sed -i 's/RESOURCE_NAME/${env.APPLICATION_NAME}/g' configuration/kubernetes/deployment.yaml" + sh "sed -i 's/LABEL/${env.APPLICATION_LABEL}/g' configuration/kubernetes/deployment.yaml" sh "sed -it 's/RESOURCE_NAME/${env.APPLICATION_NAME}/g' configuration/kubernetes/service.yaml" sh "sed -it 's/LABEL/${env.APPLICATION_LABEL}/g' configuration/kubernetes/service.yaml" diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index ebf6499..5a5a5f8 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -19,6 +19,5 @@ spring: org.hibernate.jdbc.lob.non_contextual_creation: true format_sql: true database: postgresql - server: port: 9090 \ No newline at end of file