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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. ---
  14. kind: Service
  15. apiVersion: v1
  16. metadata:
  17. namespace: sre
  18. name: service-apollo-admin-server-test-beta
  19. labels:
  20. app: service-apollo-admin-server-test-beta
  21. spec:
  22. ports:
  23. - protocol: TCP
  24. port: 8090
  25. targetPort: 8090
  26. selector:
  27. app: pod-apollo-admin-server-test-beta
  28. type: ClusterIP
  29. sessionAffinity: ClientIP
  30. ---
  31. kind: Deployment
  32. apiVersion: apps/v1beta2
  33. metadata:
  34. namespace: sre
  35. name: deployment-apollo-admin-server-test-beta
  36. labels:
  37. app: deployment-apollo-admin-server-test-beta
  38. spec:
  39. replicas: 3
  40. selector:
  41. matchLabels:
  42. app: pod-apollo-admin-server-test-beta
  43. strategy:
  44. rollingUpdate:
  45. maxSurge: 1
  46. maxUnavailable: 1
  47. type: RollingUpdate
  48. template:
  49. metadata:
  50. labels:
  51. app: pod-apollo-admin-server-test-beta
  52. spec:
  53. nodeSelector:
  54. node: "apollo"
  55. volumes:
  56. - name: volume-configmap-apollo-admin-server-test-beta
  57. configMap:
  58. name: configmap-apollo-admin-server-test-beta
  59. items:
  60. - key: application-github.properties
  61. path: application-github.properties
  62. initContainers:
  63. - image: alpine-bash:3.8
  64. name: check-service-apollo-config-server-test-beta
  65. 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"]
  66. containers:
  67. - image: apollo-admin-server:v1.0.0
  68. imagePullPolicy: IfNotPresent
  69. name: container-apollo-admin-server-test-beta
  70. ports:
  71. - protocol: TCP
  72. containerPort: 8090
  73. volumeMounts:
  74. - name: volume-configmap-apollo-admin-server-test-beta
  75. mountPath: /apollo-admin-server/config/application-github.properties
  76. subPath: application-github.properties
  77. env:
  78. - name: APOLLO_ADMIN_SERVICE_NAME
  79. value: "service-apollo-admin-server-test-beta.sre"
  80. readinessProbe:
  81. tcpSocket:
  82. port: 8090
  83. initialDelaySeconds: 10
  84. periodSeconds: 5
  85. livenessProbe:
  86. tcpSocket:
  87. port: 8090
  88. initialDelaySeconds: 120
  89. periodSeconds: 10
  90. dnsPolicy: ClusterFirst
  91. restartPolicy: Always