From 5b8d0c6212784dab132698e42186941301f606dd Mon Sep 17 00:00:00 2001 From: Charles Moulliard Date: Tue, 17 Dec 2019 11:27:10 +0100 Subject: [PATCH] chore: Define the deployment resource and add readiness/liveness probe --- config/k8s/generator-application.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/config/k8s/generator-application.yml b/config/k8s/generator-application.yml index 132f90a..681b783 100644 --- a/config/k8s/generator-application.yml +++ b/config/k8s/generator-application.yml @@ -1,18 +1,14 @@ --- -apiVersion: v1 +apiVersion: apps/v1 kind: Deployment metadata: labels: app: spring-boot-generator name: spring-boot-generator spec: - replicas: 1 selector: - app: spring-boot-generator - strategy: - rollingParams: - timeoutSeconds: 3600 - type: Rolling + matchLabels: + app: spring-boot-generator template: metadata: labels: @@ -37,15 +33,27 @@ spec: - containerPort: 8080 name: http protocol: TCP + readinessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 15 + timeoutSeconds: 10 + periodSeconds: 20 + livenessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 30 + timeoutSeconds: 10 + periodSeconds: 20 volumeMounts: - name: config-volume mountPath: /etc/config - securityContext: - privileged: false volumes: - name: config-volume configMap: - name: generator-configmap + name: spring-boot-generator --- apiVersion: v1 kind: Service