http_endpoint.yaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. ---
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. labels:
  6. app: http-endpoint
  7. service: http-endpoint
  8. name: http-endpoint
  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
  18. type: ClusterIP
  19. ---
  20. apiVersion: v1
  21. kind: ServiceAccount
  22. metadata:
  23. name: http-endpoint
  24. namespace: prd
  25. labels:
  26. account: http-endpoint
  27. ---
  28. apiVersion: apps/v1
  29. kind: Deployment
  30. metadata:
  31. labels:
  32. app: http-endpoint
  33. version: v1
  34. name: http-endpoint-v1
  35. namespace: prd
  36. spec:
  37. replicas: 1
  38. selector:
  39. matchLabels:
  40. app: http-endpoint
  41. version: v1
  42. template:
  43. metadata:
  44. labels:
  45. app: http-endpoint
  46. version: v1
  47. spec:
  48. serviceAccountName: http-endpoint
  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-endpoint:1583722708
  58. name: http-endpoint
  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
  77. #---
  78. #apiVersion: apps/v1
  79. #kind: Deployment
  80. #metadata:
  81. # labels:
  82. # app: http-endpoint
  83. # version: v2
  84. # name: http-endpoint-v2
  85. # namespace: prd
  86. #spec:
  87. # replicas: 1
  88. # selector:
  89. # matchLabels:
  90. # app: http-endpoint
  91. # version: v2
  92. # template:
  93. # metadata:
  94. # labels:
  95. # app: http-endpoint
  96. # version: v2
  97. # spec:
  98. # serviceAccountName: http-endpoint
  99. # containers:
  100. # - env:
  101. # - name: PATH
  102. # value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/sbin:/opt/go-example
  103. # - name: LANG
  104. # value: zh_CN.UTF-8
  105. # - name: VERSION
  106. # value: v2
  107. # image: ccr.ccs.tencentyun.com/wanpinghui/http-endpoint:1583722730
  108. # name: http-endpoint
  109. # ports:
  110. # - containerPort: 8080
  111. # protocol: TCP
  112. # name: http-api
  113. # workingDir: /opt/go-example
  114. # initContainers:
  115. # - image: busybox
  116. # command:
  117. # - sh
  118. # - -c
  119. # - echo 65535 > /proc/sys/net/core/somaxconn
  120. # imagePullPolicy: Always
  121. # name: setsysctl
  122. # securityContext:
  123. # privileged: true
  124. # imagePullSecrets:
  125. # - name: qcloudregistrykey
  126. # - name: tencenthubkey