apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: demo-app-rs
spec:
  selector:
    matchLabels:
      app: demo-app
  replicas: 1
  template:
    metadata:
      labels:
        app: demo-app
    spec:
      containers:
      - name: demo-container
        image: viadee/k8s-demo-app:latest
        imagePullPolicy: Always
        envFrom:
          - configMapRef:
              name: app-config
          - secretRef:
              name: app-secret
        ports:
        - containerPort: 8080
          name: http
        resources:
          limits:
            memory: 512Mi
            cpu: 1000m
          requests:
            memory: 256Mi
            cpu: 500m 
        livenessProbe:
          httpGet:
            port: 8080
            path: /actuator/health
          failureThreshold: 3
          initialDelaySeconds: 15
          periodSeconds: 5
          successThreshold: 1
          timeoutSeconds: 1
        readinessProbe:
          httpGet:
            port: 8080
            path: /ready
      restartPolicy: Always
