apiVersion: v1
kind: Pod
metadata:
  labels:
    app: bitnami-tomcat9-jdk18-root-war
  name: bitnami-tomcat9-jdk18-root-war
spec:
  containers:
    - name: bitnami-tomcat9-jdk18-root-war
      image: andriykalashnykov/bitnami-tomcat9-jdk18-root-war:latest
      imagePullPolicy: Always
      env:
        - name: JAVA_OPTS
          value: "-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addressess=true -Dfile.encoding=UTF-8 -Djava.awt.headless=true -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MinRAMPercentage=50.0 -XX:MaxRAMPercentage=90.0"
        - name: TOMCAT_USERNAME
          value: "admin"
        - name: TOMCAT_PASSWORD
          value: "admin"
        - name: TOMCAT_SHUTDOWN_PORT_NUMBER
          value: "8015"
        - name: TOMCAT_ALLOW_REMOTE_MANAGEMENT
          value: "1"
        - name: TOMCAT_ALLOW_REMOTE_MANAGEMENT_ANY_IP
          value: "1"
      readinessProbe:
        httpGet:
          scheme: HTTPS
          path: /index.html
          port: https-8443
        initialDelaySeconds: 5
        timeoutSeconds: 5
        periodSeconds: 5
      livenessProbe:
        tcpSocket:
          port: https-8443
        initialDelaySeconds: 10
        periodSeconds: 30
        timeoutSeconds: 5
        failureThreshold: 1
        successThreshold: 1
      ports:
      - name: http-8080
        containerPort: 8080
      - name: https-8443
        containerPort: 8443
      resources:
        requests:
          memory: "256Mi"
          cpu: "550m"
        limits:
          memory: "256Mi"
          cpu: "750m"
      volumeMounts:
        - name: bitnami-tomcat-storage
          mountPath: "/bitnami-tomcat-storage"
        - name: tomcat-conf-volume
          mountPath: /cm/conf
      lifecycle:
          postStart:
            exec:
              command: ["/bin/sh", "-c", "cp /cm/conf/* /opt/bitnami/tomcat/conf"]
  volumes:
    - name: tomcat-conf-volume
      configMap:
        name: tomcat-conf-cm
    - name: bitnami-tomcat-storage
      persistentVolumeClaim:
        claimName: bitnami-tomcat-claim
