service-apollo-admin-server-dev.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. ---
  2. # configmap for apollo-admin-server-dev
  3. kind: ConfigMap
  4. apiVersion: v1
  5. metadata:
  6. namespace: sre
  7. name: configmap-apollo-admin-server-dev
  8. data:
  9. application-github.properties: |
  10. spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env.sre:3306/DevApolloConfigDB?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-dev
  19. labels:
  20. app: service-apollo-admin-server-dev
  21. spec:
  22. ports:
  23. - protocol: TCP
  24. port: 8090
  25. targetPort: 8090
  26. selector:
  27. app: pod-apollo-admin-server-dev
  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-dev
  36. labels:
  37. app: deployment-apollo-admin-server-dev
  38. spec:
  39. replicas: 3
  40. selector:
  41. matchLabels:
  42. app: pod-apollo-admin-server-dev
  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-dev
  52. spec:
  53. nodeSelector:
  54. node: "apollo"
  55. volumes:
  56. - name: volume-configmap-apollo-admin-server-dev
  57. configMap:
  58. name: configmap-apollo-admin-server-dev
  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-dev
  65. command: ['bash', '-c', "curl --connect-timeout 2 --max-time 5 --retry 60 --retry-delay 1 --retry-max-time 120 service-apollo-config-server-dev.sre:8080"]
  66. containers:
  67. - image: apollo-admin-server:v1.0.0
  68. securityContext:
  69. privileged: true
  70. imagePullPolicy: IfNotPresent
  71. name: container-apollo-admin-server-dev
  72. ports:
  73. - protocol: TCP
  74. containerPort: 8090
  75. volumeMounts:
  76. - name: volume-configmap-apollo-admin-server-dev
  77. mountPath: /apollo-admin-server/config/application-github.properties
  78. subPath: application-github.properties
  79. env:
  80. - name: APOLLO_ADMIN_SERVICE_NAME
  81. value: "service-apollo-admin-server-dev.sre"
  82. readinessProbe:
  83. tcpSocket:
  84. port: 8090
  85. initialDelaySeconds: 10
  86. periodSeconds: 5
  87. livenessProbe:
  88. tcpSocket:
  89. port: 8090
  90. initialDelaySeconds: 120
  91. periodSeconds: 10
  92. dnsPolicy: ClusterFirst
  93. restartPolicy: Always