apiVersion: apps/v1
kind: Deployment
metadata:
  name: spring-kuberized
spec:
  replicas: 2
  selector:
    matchLabels:
      app: containerized-app
  template:
    metadata:
      labels:
        app: containerized-app
    spec:
      containers:
        - name: containerized-app
          image: cschieb/spring-boot-containerized:latest
          imagePullPolicy: Never
          env:
            - name: SPRING_PROFILES_ACTIVE
              value: prod
          ports:
            - name: app-port
              containerPort: 8080
          livenessProbe:
            httpGet:
              path: /actuator/health
              port: app-port
            periodSeconds: 5
            failureThreshold: 1
          startupProbe:
            httpGet:
              path: /actuator/health
              port: app-port
            failureThreshold: 6
            periodSeconds: 5