server.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. ---
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. labels:
  6. app: grpc-example
  7. service: grpc-example
  8. name: grpc-example
  9. namespace: prd
  10. spec:
  11. ports:
  12. - name: grpc
  13. port: 50051
  14. protocol: TCP
  15. targetPort: 50051
  16. selector:
  17. app: grpc-example
  18. type: ClusterIP
  19. ---
  20. apiVersion: v1
  21. kind: ServiceAccount
  22. metadata:
  23. name: grpc-example
  24. namespace: prd
  25. labels:
  26. account: grpc-example
  27. ---
  28. apiVersion: apps/v1
  29. kind: Deployment
  30. metadata:
  31. labels:
  32. app: grpc-example
  33. version: v1
  34. name: grpc-example-v1
  35. namespace: prd
  36. spec:
  37. replicas: 3
  38. selector:
  39. matchLabels:
  40. app: grpc-example
  41. version: v1
  42. template:
  43. metadata:
  44. labels:
  45. app: grpc-example
  46. version: v1
  47. spec:
  48. serviceAccountName: grpc-example
  49. containers:
  50. - env:
  51. - name: PATH
  52. value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/sbin:/opt/go-example
  53. - name: LANG
  54. value: zh_CN.UTF-8
  55. - name: VERSION
  56. value: v1
  57. image: ccr.ccs.tencentyun.com/wanpinghui/go-example-server:1583552883
  58. name: grpc-example
  59. ports:
  60. - containerPort: 50051
  61. protocol: TCP
  62. name: grpc-api
  63. workingDir: /opt/go-example
  64. initContainers:
  65. - image: busybox
  66. command:
  67. - sh
  68. - -c
  69. - echo 65535 > /proc/sys/net/core/somaxconn
  70. imagePullPolicy: Always
  71. name: setsysctl
  72. securityContext:
  73. privileged: true
  74. imagePullSecrets:
  75. - name: qcloudregistrykey
  76. - name: tencenthubkey