apiVersion: apps/v1
kind: Deployment
metadata:
  name: spring-auf-kubernetes
  labels:
    app: spring-auf-kubernetes
spec:
  replicas: 2
  selector:
    matchLabels:
      app: spring-auf-kubernetes
  template:
    metadata:
      labels:
        app: spring-auf-kubernetes
      annotations:
        prometheus.io/path: "/actuator/prometheus"
        prometheus.io/port: "8080"
        prometheus.io/scrape: "true"
    spec:
      containers:
        - name: spring-auf-kubernetes
          image: fr1zle/spring-auf-kubernetes:20190227202627
          ports:
            - containerPort: 8080
            - containerPort: 1099
          # imagePullPolicy: Always <- für minikube deaktiviert
          # Java Starten
          args: [
            "/usr/bin/java",
            "-Djava.awt.headless=true",
            "-Duser.home=/tmp",
            "-Dfile.encoding=UTF-8",
            "-Dsun.jnu.encoding=UTF-8",
            "-Djava.security.egd=file:/dev/./urandom",
            "-Dcom.sun.management.jmxremote",
            "-Dcom.sun.management.jmxremote.authenticate=false",
            "-Dcom.sun.management.jmxremote.ssl=false",
            "-Dcom.sun.management.jmxremote.local.only=false",
            "-Dcom.sun.management.jmxremote.port=1099",
            "-Dcom.sun.management.jmxremote.rmi.port=1099",
            "-Djava.rmi.server.hostname=127.0.0.1",
            "-noverify",
            "-cp",
            "app:app/lib/*",
            "org.springframework.boot.loader.JarLauncher"
          ]
          # Readiness / Liveness Probe
          readinessProbe:
            httpGet:
              path: /actuator/health
              port: 8080
            initialDelaySeconds: 30
            periodSeconds: 10
            timeoutSeconds: 3
          livenessProbe:
            httpGet:
              path: /actuator/info
              port: 8080
            initialDelaySeconds: 30
            periodSeconds: 10
            timeoutSeconds: 3
          resources:
            requests:
              cpu: 100m
              memory: 500Mi
            limits:
              cpu: 1
              memory: 800Mi
