apiVersion: apps/v1
kind: Deployment
metadata:
  name: server-demo-v1
  namespace: dubbo-demo
spec:
  replicas: 2
  selector:
    matchLabels:
      app: server-demo
      version: v1
  template:
    metadata:
      labels:
        app: server-demo
        version: v1
      annotations:
        # Prevent istio rewrite http probe
        sidecar.istio.io/rewriteAppHTTPProbers: "false"
    spec:
      containers:
        - name: server
          image: apache/dubbo-demo:dubbo-go-mesh-provider_0.0.1
          imagePullPolicy: Always
          ports:
            - name: grpc-tri
              containerPort: 50052
              protocol: TCP
          livenessProbe:
            tcpSocket:
              port: 50052
            initialDelaySeconds: 10
            periodSeconds: 5
            timeoutSeconds: 1
          readinessProbe:
            tcpSocket:
              port: 50052
            initialDelaySeconds: 5
            periodSeconds: 5
            timeoutSeconds: 2
          startupProbe:
            exec:
              command:
                - /bin/sh
                - -c
                - sleep 1;echo ok
            failureThreshold: 30
            initialDelaySeconds: 10
            periodSeconds: 5
            timeoutSeconds: 2