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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. 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/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/
  14. ---
  15. kind: Service
  16. apiVersion: v1
  17. metadata:
  18. namespace: sre
  19. name: service-apollo-admin-server-dev
  20. labels:
  21. app: service-apollo-admin-server-dev
  22. spec:
  23. ports:
  24. - protocol: TCP
  25. port: 8090
  26. targetPort: 8090
  27. selector:
  28. app: pod-apollo-admin-server-dev
  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-dev
  37. labels:
  38. app: deployment-apollo-admin-server-dev
  39. spec:
  40. replicas: 3
  41. selector:
  42. matchLabels:
  43. app: pod-apollo-admin-server-dev
  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-dev
  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-dev
  65. topologyKey: kubernetes.io/hostname
  66. volumes:
  67. - name: volume-configmap-apollo-admin-server-dev
  68. configMap:
  69. name: configmap-apollo-admin-server-dev
  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-dev
  76. 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"]
  77. containers:
  78. - image: apollo-admin-server:v1.0.0
  79. securityContext:
  80. privileged: true
  81. imagePullPolicy: IfNotPresent
  82. name: container-apollo-admin-server-dev
  83. ports:
  84. - protocol: TCP
  85. containerPort: 8090
  86. volumeMounts:
  87. - name: volume-configmap-apollo-admin-server-dev
  88. mountPath: /apollo-admin-server/config/application-github.properties
  89. subPath: application-github.properties
  90. env:
  91. - name: APOLLO_ADMIN_SERVICE_NAME
  92. value: "service-apollo-admin-server-dev.sre"
  93. readinessProbe:
  94. tcpSocket:
  95. port: 8090
  96. initialDelaySeconds: 10
  97. periodSeconds: 5
  98. livenessProbe:
  99. tcpSocket:
  100. port: 8090
  101. initialDelaySeconds: 120
  102. periodSeconds: 10
  103. dnsPolicy: ClusterFirst
  104. restartPolicy: Always