apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    dependOn: mariadb, nginx
  name: ticket-manager
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ticket-manager
  template:
    metadata:
      labels:
        app: ticket-manager
    spec:
      # initContainers:
      # - name: wait-for-onezone
      #   image: roandocker/k8s-wait-for:1.0.0
      #   imagePullPolicy: IfNotPresent
      #   args:
      #     - "job"
      #     - "initdata-job"
      containers:
      - name: ticket-manager
        env:
        - name: DB_HOST
          value: mariadb
        - name: DB_PORT
          value : "3306"
        - name: DB_USER
          value: root
        - name: DB_PASSWD
          value: root123
        - name: DB_DATABASE
          value: ticket
        - name: DB_LOGMODE
          value: "true"
        image: roandocker/ticket-manager:1.0.0
        imagePullPolicy: Always
        livenessProbe:
          initialDelaySeconds: 30
          periodSeconds: 10
          tcpSocket:
            port: 8080
          timeoutSeconds: 3
          failureThreshold: 30
        ports:
        - containerPort: 8080
        readinessProbe:
          initialDelaySeconds: 30
          periodSeconds: 10
          tcpSocket:
            port: 8080
          timeoutSeconds: 3
          failureThreshold: 30
        resources:
          limits:
            cpu: 150m
            memory: 680Mi
          requests:
            cpu: 50m
            memory: 256Mi
      enableServiceLinks: false
...