1
0

deployment-adminservice.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ---
  2. # configmap for apollo-adminservice
  3. kind: ConfigMap
  4. apiVersion: v1
  5. metadata:
  6. {{- $adminServiceFullName := include "apollo.adminService.fullName" . }}
  7. name: {{ $adminServiceFullName }}
  8. data:
  9. application-github.properties: |
  10. spring.datasource.url = jdbc:mysql://{{include "apollo.configdb.serviceName" .}}:{{ .Values.configdb.service.port }}/{{ .Values.configdb.dbName }}{{ if .Values.configdb.connectionStringProperties }}?{{ .Values.configdb.connectionStringProperties }}{{ end }}
  11. spring.datasource.username = {{ required "configdb.userName is required!" .Values.configdb.userName }}
  12. spring.datasource.password = {{ required "configdb.password is required!" .Values.configdb.password }}
  13. ---
  14. kind: Deployment
  15. apiVersion: apps/v1
  16. metadata:
  17. name: {{ $adminServiceFullName }}
  18. labels:
  19. {{- include "apollo.service.labels" . | nindent 4 }}
  20. spec:
  21. replicas: {{ .Values.adminService.replicaCount }}
  22. selector:
  23. matchLabels:
  24. app: {{ $adminServiceFullName }}
  25. {{- with .Values.adminService.strategy }}
  26. strategy:
  27. {{- toYaml . | nindent 4 }}
  28. {{- end }}
  29. template:
  30. metadata:
  31. labels:
  32. app: {{ $adminServiceFullName }}
  33. spec:
  34. {{- with .Values.adminService.imagePullSecrets }}
  35. imagePullSecrets:
  36. {{- toYaml . | nindent 8 }}
  37. {{- end }}
  38. volumes:
  39. - name: volume-configmap-{{ $adminServiceFullName }}
  40. configMap:
  41. name: {{ $adminServiceFullName }}
  42. items:
  43. - key: application-github.properties
  44. path: application-github.properties
  45. defaultMode: 420
  46. containers:
  47. - name: {{ .Values.adminService.name }}
  48. image: "{{ .Values.adminService.image.repository }}:{{ .Chart.AppVersion }}"
  49. imagePullPolicy: {{ .Values.adminService.image.pullPolicy }}
  50. ports:
  51. - name: http
  52. containerPort: {{ .Values.adminService.containerPort }}
  53. protocol: TCP
  54. env:
  55. - name: SPRING_PROFILES_ACTIVE
  56. value: 'github,kubernetes'
  57. {{- range $key, $value := .Values.adminService.env }}
  58. - name: {{ $key }}
  59. value: {{ $value }}
  60. {{- end }}
  61. volumeMounts:
  62. - name: volume-configmap-{{ $adminServiceFullName }}
  63. mountPath: /apollo-adminservice/config/application-github.properties
  64. subPath: application-github.properties
  65. livenessProbe:
  66. tcpSocket:
  67. port: {{ .Values.adminService.containerPort }}
  68. initialDelaySeconds: {{ .Values.adminService.liveness.initialDelaySeconds }}
  69. periodSeconds: {{ .Values.adminService.liveness.periodSeconds }}
  70. readinessProbe:
  71. httpGet:
  72. path: /health
  73. port: {{ .Values.adminService.containerPort }}
  74. initialDelaySeconds: {{ .Values.adminService.readiness.initialDelaySeconds }}
  75. periodSeconds: {{ .Values.adminService.readiness.periodSeconds }}
  76. resources:
  77. {{- toYaml .Values.adminService.resources | nindent 12 }}
  78. {{- with .Values.adminService.nodeSelector }}
  79. nodeSelector:
  80. {{- toYaml . | nindent 8 }}
  81. {{- end }}
  82. {{- with .Values.adminService.affinity }}
  83. affinity:
  84. {{- toYaml . | nindent 8 }}
  85. {{- end }}
  86. {{- with .Values.adminService.tolerations }}
  87. tolerations:
  88. {{- toYaml . | nindent 8 }}
  89. {{- end }}