---
apiVersion: v1
kind: Service
metadata:
  name: initdatabase
  namespace: edoc2
  labels:
    app: initdatabase
spec:
  ports:
  - name: initdatabase
    port: 8785
    targetPort: 8785
    protocol: TCP
  selector:
    app: initdatabase
  type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: initdatabase
  namespace: edoc2
  labels:
    app: initdatabase
    k8s-app: initdatabase
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: initdatabase
  template:
    metadata:
      labels:
        app: initdatabase
    spec:
      hostname: initdatabase
      terminationGracePeriodSeconds: 60
      containers:
      - name: initdatabase-container
        image: registry.edoc2.com:5000/edoc2v5/initdatabase:km-v6.1.0.0
        imagePullPolicy: IfNotPresent
        ports:
        - name: init
          containerPort: 8785
        envFrom:
        - configMapRef:
            name: mid-envfile
        - configMapRef:
            name: ecm-envfile
        - configMapRef:
            name: inbiz-envfile
        - configMapRef:
            name: km-envfile
        - configMapRef:
            name: docflow-envfile
        resources:
          requests:
            cpu: 950m
            memory: 1.9Gi
          limits:
            cpu: 1000m
            memory: 2Gi
        securityContext:
          capabilities:
            add: ["SYS_PTRACE"]
      restartPolicy: Always
      nodeSelector:
        node.drive.nodelabels: InDrive
