apiVersion: apps/v1
kind: Deployment
metadata:
  name: message-service
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate: 
      maxSurge: 1
      maxUnavailable: 1
  selector:
    matchLabels:
      app: message-service
  template:
    metadata:
      labels:
        app: message-service
        version: "1.0"
    spec:
      serviceAccountName: "spring-cloud"
      imagePullSecrets:
        - name: regcreddocker
      containers:
      - image: triathlonguy/message-service:1.0
        imagePullPolicy: Always
        name: message-service
        ports:
          - containerPort: 8080
        env:
          - name: "JAVA_OPTS"
            value: "-XshowSettings:vm -XX:MaxRAMPercentage=75.0"
          - name: "service_version"
            value: "1.0"
        resources:
          requests:
            cpu: 1000m
            memory: 1024M
          limits:
            cpu: 1000m
            memory: 1024M
        livenessProbe:
          initialDelaySeconds: 20
          periodSeconds: 5
          httpGet:
            port: 8080
            path: /alive
        readinessProbe:
          initialDelaySeconds: 20
          periodSeconds: 5
          httpGet:
            port: 8080
            path: /actuator/health




