#
#    Copyright 2016-2020 the original author or authors.
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
#

apiVersion: apps/v1
kind: Deployment
metadata:
  name: jpetstore2-deployment
  labels:
    app: jpetstore2
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jpetstore2
  template:
    metadata:
      labels:
        app: jpetstore2
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/port: '8088'
        #prometheus.io/path: "/jpetstore/metrics"
    spec:
      containers:
      - name: jpetstore2
        image: onek0708/jpetstore2:v1
        ports:
        - containerPort: 8080
        volumeMounts:
          - name: tomcat-users
            mountPath: /usr/local/tomcat/conf/tomcat-users.xml
            subPath: tomcat-users.xml
          - name: tomcat-manager
            mountPath: /usr/local/tomcat/conf/Catalina/localhost/manager.xml
            subPath: manager.xml
      volumes:
      - name: tomcat-users
        configMap:
          name: tomcat-users
      - name: tomcat-manager
        configMap:
          name: tomcat-manager
