py-grpc-example.yaml 919 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. labels:
  6. app: py-grpc-example
  7. version: v1
  8. name: py-grpc-example
  9. namespace: prd
  10. spec:
  11. type: ClusterIP
  12. ports:
  13. - name: grpc-greet
  14. port: 50051
  15. protocol: TCP
  16. targetPort: 50051
  17. selector:
  18. app: py-grpc-example
  19. version: v1
  20. ---
  21. apiVersion: apps/v1
  22. kind: Deployment
  23. metadata:
  24. name: py-grpc-example
  25. namespace: prd
  26. spec:
  27. replicas: 1
  28. selector:
  29. matchLabels:
  30. app: py-grpc-example
  31. version: v1
  32. template:
  33. metadata:
  34. labels:
  35. app: py-grpc-example
  36. version: v1
  37. spec:
  38. containers:
  39. - name: py-grpc-example
  40. image: ccr.ccs.tencentyun.com/wanpinghui/py-example-server:1582956676
  41. ports:
  42. - name: grpc-api
  43. protocol: TCP
  44. containerPort: 50051
  45. imagePullSecrets:
  46. - name: qcloudregistrykey
  47. - name: tencenthubkey
  48. restartPolicy: Always