# Copyright 2020 Yasutaka Nishimura (nishi2go). All Rights Reserved.
#
# 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:
  labels:
    app: maximo
    tier: application
    service: jmsserver
  name: maximo-jms
spec:
  replicas: 1
  selector:
    matchLabels:
      app: maximo
      tier: application
      service: jmsserver
  template:
    metadata:
      labels:
        app: maximo
        tier: application
        service: jmsserver
    spec:
      containers:
      - env:
        - name: ADMIN_PASSWORD
          valueFrom:
            secretKeyRef:
              name: liberty-admin-credential
              key: password
        - name: ADMIN_USER_NAME
          valueFrom:
            secretKeyRef:
              name: liberty-admin-credential
              key: username
        - name: LICENSE
          value: accept
        - name: WLP_LOGGING_CONSOLE_LOGLEVEL
          value: info
        - name: SEC_TLS_TRUSTDEFAULTCERTS
          value: "true"
        - name: SEC_IMPORT_K8S_CERTS
          value: "true"
        image: localhost:32000/maximo-liberty/jmsserver:20.0.0.3-webProfile8
        imagePullPolicy: IfNotPresent
        name: maximo-jms
        resources:
          requests:
            memory: "256Mi"
            cpu: "100m"
          limits:
            memory: "2Gi"
            cpu: "2000m"
        ports:
          - containerPort: 7276
            name: jms
            protocol: TCP
          - containerPort: 7286
            name: jms-ssl
            protocol: TCP
        livenessProbe:
            tcpSocket:
              port: jms
            initialDelaySeconds: 15
            periodSeconds: 10
        readinessProbe:
            tcpSocket:
              port: jms
            initialDelaySeconds: 15
            periodSeconds: 10
      restartPolicy: Always
      serviceAccountName: default
