service-apollo-config-server-dev.yaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #
  2. # Copyright 2021 Apollo Authors
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. ---
  17. # configmap for apollo-config-server-dev
  18. kind: ConfigMap
  19. apiVersion: v1
  20. metadata:
  21. namespace: sre
  22. name: configmap-apollo-config-server-dev
  23. data:
  24. application-github.properties: |
  25. spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env.sre:3306/ApolloConfigDB?characterEncoding=utf8
  26. spring.datasource.username = FillInCorrectUser
  27. spring.datasource.password = FillInCorrectPassword
  28. eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/
  29. ---
  30. kind: Service
  31. apiVersion: v1
  32. metadata:
  33. namespace: sre
  34. name: service-apollo-meta-server-dev
  35. labels:
  36. app: service-apollo-meta-server-dev
  37. spec:
  38. ports:
  39. - protocol: TCP
  40. port: 8080
  41. targetPort: 8080
  42. selector:
  43. app: pod-apollo-config-server-dev
  44. type: ClusterIP
  45. clusterIP: None
  46. sessionAffinity: ClientIP
  47. ---
  48. kind: Service
  49. apiVersion: v1
  50. metadata:
  51. namespace: sre
  52. name: service-apollo-config-server-dev
  53. labels:
  54. app: service-apollo-config-server-dev
  55. spec:
  56. ports:
  57. - protocol: TCP
  58. port: 8080
  59. targetPort: 8080
  60. nodePort: 30002
  61. selector:
  62. app: pod-apollo-config-server-dev
  63. type: NodePort
  64. sessionAffinity: ClientIP
  65. ---
  66. kind: StatefulSet
  67. apiVersion: apps/v1
  68. metadata:
  69. namespace: sre
  70. name: statefulset-apollo-config-server-dev
  71. labels:
  72. app: statefulset-apollo-config-server-dev
  73. spec:
  74. serviceName: service-apollo-meta-server-dev
  75. replicas: 2
  76. selector:
  77. matchLabels:
  78. app: pod-apollo-config-server-dev
  79. updateStrategy:
  80. type: RollingUpdate
  81. template:
  82. metadata:
  83. labels:
  84. app: pod-apollo-config-server-dev
  85. spec:
  86. affinity:
  87. podAntiAffinity:
  88. preferredDuringSchedulingIgnoredDuringExecution:
  89. - weight: 100
  90. podAffinityTerm:
  91. labelSelector:
  92. matchExpressions:
  93. - key: app
  94. operator: In
  95. values:
  96. - pod-apollo-config-server-dev
  97. topologyKey: kubernetes.io/hostname
  98. volumes:
  99. - name: volume-configmap-apollo-config-server-dev
  100. configMap:
  101. name: configmap-apollo-config-server-dev
  102. items:
  103. - key: application-github.properties
  104. path: application-github.properties
  105. containers:
  106. - image: apolloconfig/apollo-configservice:1.9.2
  107. securityContext:
  108. privileged: true
  109. imagePullPolicy: IfNotPresent
  110. name: container-apollo-config-server-dev
  111. ports:
  112. - protocol: TCP
  113. containerPort: 8080
  114. volumeMounts:
  115. - name: volume-configmap-apollo-config-server-dev
  116. mountPath: /apollo-configservice/config/application-github.properties
  117. subPath: application-github.properties
  118. env:
  119. - name: APOLLO_CONFIG_SERVICE_NAME
  120. value: "service-apollo-config-server-dev.sre"
  121. readinessProbe:
  122. tcpSocket:
  123. port: 8080
  124. initialDelaySeconds: 10
  125. periodSeconds: 5
  126. livenessProbe:
  127. tcpSocket:
  128. port: 8080
  129. initialDelaySeconds: 120
  130. periodSeconds: 10
  131. dnsPolicy: ClusterFirst
  132. restartPolicy: Always