apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-microprofile
  labels:
    app: hello-microprofile
    book: microservices4javadev
    version: v1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hello-microprofile
      version: v1
  template:
    metadata:
      labels:
        app: hello-microprofile
        book: microservices4javadev
        version: v1
    spec:
      containers:
      - env:
        - name: JAVA_OPTIONS
          value: -Xms128m -Xmx256m -Djava.net.preferIPv4Stack=true -Djava.security.egd=file:///dev/./urandom
        - name: GREETING_BACKENDSERVICEHOST
          value: backend
        image: rhdevelopers/hello-microprofile:1.0
        imagePullPolicy: IfNotPresent
        livenessProbe:
          httpGet: # make an HTTP request
              port: 8080 # port to use
              path: /api/hello # endpoint to hit
              scheme: HTTP # or HTTPS
          initialDelaySeconds: 20
          periodSeconds: 5
          timeoutSeconds: 1
        name: hello-microprofile
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        readinessProbe:
          httpGet: # make an HTTP request
              port: 8080 # port to use
              path: /api/hello # endpoint to hit
              scheme: HTTP # or HTTPS
          initialDelaySeconds: 10
          periodSeconds: 5
          timeoutSeconds: 1
