apiVersion: apps/v1
kind: Deployment
metadata:
  name: guestbook-service
  labels:
    app: guestbook-service
    version: "1.0"
    visualize: "true"
    type: workshop
spec:
  replicas: 2
  selector:
    matchLabels:
      app: guestbook-service
      version: "1.0"
      serving: "true"
  template:
    metadata:
      labels:
        app: guestbook-service
        serving: "true"
        version: "1.0"
        visualize: "true"
        ## Istio Adapter
        service-mesh.3scale.net: "true"
        service-mesh.3scale.net/authentication-method: ""        
        service-mesh.3scale.net/service-id: "3"
        service-mesh.3scale.net/credentials: "istio-api"
      annotations:
        sidecar.istio.io/inject: 'true'
    spec:
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      containers:
      - name: guestbook-service
        image: clamer/guestbook-service:latest
        imagePullPolicy: Always
        livenessProbe:
          httpGet:
            path: /actuator/health
            port: 8080
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 3
          successThreshold: 1
          failureThreshold: 3
        readinessProbe:
          httpGet:
            path: /
            port: 8080
          initialDelaySeconds: 20
          periodSeconds: 10
          timeoutSeconds: 3
          successThreshold: 1
          failureThreshold: 3
        ports:
        - containerPort: 8080
          name: http
        resources:
          requests:
            cpu: 400m
            memory: 500Mi
          limits:
            cpu: 1500m
            memory: 1000Mi
