service-apollo-admin-server-test-beta.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. ---
  2. # configmap for apollo-admin-server-test-beta
  3. kind: ConfigMap
  4. apiVersion: v1
  5. metadata:
  6. namespace: sre
  7. name: configmap-apollo-admin-server-test-beta
  8. data:
  9. application-github.properties: |
  10. spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-test-beta-env.sre:3306/TestBetaApolloConfigDB?characterEncoding=utf8
  11. spring.datasource.username = FillInCorrectUser
  12. spring.datasource.password = FillInCorrectPassword
  13. eureka.service.url = http://statefulset-apollo-config-server-test-beta-0.service-apollo-meta-server-test-beta:8080/eureka/,http://statefulset-apollo-config-server-test-beta-1.service-apollo-meta-server-test-beta:8080/eureka/,http://statefulset-apollo-config-server-test-beta-2.service-apollo-meta-server-test-beta:8080/eureka/
  14. ---
  15. kind: Service
  16. apiVersion: v1
  17. metadata:
  18. namespace: sre
  19. name: service-apollo-admin-server-test-beta
  20. labels:
  21. app: service-apollo-admin-server-test-beta
  22. spec:
  23. ports:
  24. - protocol: TCP
  25. port: 8090
  26. targetPort: 8090
  27. selector:
  28. app: pod-apollo-admin-server-test-beta
  29. type: ClusterIP
  30. sessionAffinity: ClientIP
  31. ---
  32. kind: Deployment
  33. apiVersion: apps/v1
  34. metadata:
  35. namespace: sre
  36. name: deployment-apollo-admin-server-test-beta
  37. labels:
  38. app: deployment-apollo-admin-server-test-beta
  39. spec:
  40. replicas: 3
  41. selector:
  42. matchLabels:
  43. app: pod-apollo-admin-server-test-beta
  44. strategy:
  45. rollingUpdate:
  46. maxSurge: 1
  47. maxUnavailable: 1
  48. type: RollingUpdate
  49. template:
  50. metadata:
  51. labels:
  52. app: pod-apollo-admin-server-test-beta
  53. spec:
  54. affinity:
  55. podAntiAffinity:
  56. preferredDuringSchedulingIgnoredDuringExecution:
  57. - weight: 100
  58. podAffinityTerm:
  59. labelSelector:
  60. matchExpressions:
  61. - key: app
  62. operator: In
  63. values:
  64. - pod-apollo-admin-server-test-beta
  65. topologyKey: kubernetes.io/hostname
  66. volumes:
  67. - name: volume-configmap-apollo-admin-server-test-beta
  68. configMap:
  69. name: configmap-apollo-admin-server-test-beta
  70. items:
  71. - key: application-github.properties
  72. path: application-github.properties
  73. initContainers:
  74. - image: alpine-bash:3.8
  75. name: check-service-apollo-config-server-test-beta
  76. command: ['bash', '-c', "curl --connect-timeout 2 --max-time 5 --retry 60 --retry-delay 1 --retry-max-time 120 service-apollo-config-server-test-beta.sre:8080"]
  77. containers:
  78. - image: apollo-admin-server:v1.0.0
  79. imagePullPolicy: IfNotPresent
  80. name: container-apollo-admin-server-test-beta
  81. ports:
  82. - protocol: TCP
  83. containerPort: 8090
  84. volumeMounts:
  85. - name: volume-configmap-apollo-admin-server-test-beta
  86. mountPath: /apollo-admin-server/config/application-github.properties
  87. subPath: application-github.properties
  88. env:
  89. - name: APOLLO_ADMIN_SERVICE_NAME
  90. value: "service-apollo-admin-server-test-beta.sre"
  91. readinessProbe:
  92. tcpSocket:
  93. port: 8090
  94. initialDelaySeconds: 10
  95. periodSeconds: 5
  96. livenessProbe:
  97. tcpSocket:
  98. port: 8090
  99. initialDelaySeconds: 120
  100. periodSeconds: 10
  101. dnsPolicy: ClusterFirst
  102. restartPolicy: Always