http_endpoint_blue.yaml 1.6 KB

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