# App Server for the Microservice
# Deployment / Replicaset / Pod
apiVersion: apps/v1
kind: Deployment
metadata:
  name: tc8-deploy
  namespace: sigma
  labels:
    app: tc8-deploy
spec:
  replicas: 2
  selector:
    matchLabels:
      # Matching the labels from Pod Meta Data
      # Multiple labels can be used
      app: tc8-pod
  minReadySeconds: 5
  strategy:
    # Re-Create / Rolling Update
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  template:
    metadata:
      labels:
        app: tc8-pod
        version: "8.5.69"
        release: stable
        organization: Apache
    spec:
      containers:
      - name: tc8-container
        image: metamagic/tomcat:8
        # Use Always ONLY for Development purpose.
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8080
        resources:
        # QoS : Burstable
        # Pod will not be launched if the Hardware 
        # resources are not available
        # To check, Run the command kubectl describe pods pod-name
          limits:
            cpu: 500m
            memory: 256Mi
          requests:
            cpu: 256m
            memory: 128Mi

