apiVersion: apps/v1
kind: Deployment
metadata:
  name: jmx-tomcat
  namespace: default
spec:
  replicas: 3
  selector:
    matchLabels:
      app: jmx-tomcat
  template:
    metadata:
      labels:
        app: jmx-tomcat
    spec:
      containers:
      - name: jvm-tomcat
        image: jmx-tomcat:v1
        ports:
        - containerPort: 8080
          name: tomcat
          protocol: TCP
        - containerPort: 2345
          name: jvm
          protocol: TCP
        volumeMounts:
        - mountPath: /jmx/prometheus-jmx-config.yaml
          name: jmx-conf
          subPath: prometheus-jmx-config.yaml
      volumes:
      - name: jmx-conf
        configMap:
          name: prometheus-jmx-config
