http_backend.yaml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. ---
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. labels:
  6. app: http-backend
  7. service: http-backend
  8. name: http-backend
  9. namespace: prd
  10. spec:
  11. ports:
  12. - name: http
  13. port: 8080
  14. protocol: TCP
  15. targetPort: 8080
  16. selector:
  17. app: http-backend
  18. type: ClusterIP
  19. ---
  20. apiVersion: v1
  21. kind: ServiceAccount
  22. metadata:
  23. name: http-backend
  24. namespace: prd
  25. labels:
  26. account: http-backend
  27. ---
  28. apiVersion: apps/v1
  29. kind: Deployment
  30. metadata:
  31. labels:
  32. app: http-backend
  33. version: v1
  34. name: http-backend-v1
  35. namespace: prd
  36. spec:
  37. replicas: 1
  38. selector:
  39. matchLabels:
  40. app: http-backend
  41. version: v1
  42. template:
  43. metadata:
  44. labels:
  45. app: http-backend
  46. version: v1
  47. spec:
  48. serviceAccountName: http-backend
  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/http-backend:1583552944
  58. name: http-backend
  59. ports:
  60. - containerPort: 8080
  61. protocol: TCP
  62. name: http-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