apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: preference
    version: v1
  name: preference-v1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: preference
      version: v1
  template:
    metadata:
      labels:
        app: preference
        version: v1
    spec:
      containers:
      - env:
        - name: JAVA_OPTIONS
          value: -Xms128m -Xmx256m -Djava.net.preferIPv4Stack=true -Djava.security.egd=file:///dev/./urandom
        image: mario21ic/preference:v1
        imagePullPolicy: IfNotPresent
        #imagePullPolicy: Never
        livenessProbe:
          exec:
            command:
            - curl
            - localhost:8080/health
          initialDelaySeconds: 30
          periodSeconds: 5
          timeoutSeconds: 1
        name: preference
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        - containerPort: 8778
          name: jolokia
          protocol: TCP
        - containerPort: 9779
          name: prometheus
          protocol: TCP
        readinessProbe:
          exec:
            command:
            - curl
            - localhost:8080/health
          initialDelaySeconds: 30
          periodSeconds: 5
          timeoutSeconds: 1
        securityContext:
          privileged: false
