# # Copyright 2021 Apollo Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # --- # configmap for apollo-adminservice kind: ConfigMap apiVersion: v1 metadata: {{- $adminServiceFullName := include "apollo.adminService.fullName" . }} name: {{ $adminServiceFullName }} data: application-github.properties: | spring.datasource.url = jdbc:mysql://{{include "apollo.configdb.serviceName" .}}:{{include "apollo.configdb.servicePort" .}}/{{ .Values.configdb.dbName }}{{ if .Values.configdb.connectionStringProperties }}?{{ .Values.configdb.connectionStringProperties }}{{ end }} spring.datasource.username = {{ required "configdb.userName is required!" .Values.configdb.userName }} spring.datasource.password = {{ required "configdb.password is required!" .Values.configdb.password }} {{- if .Values.adminService.config.contextPath }} server.servlet.context-path = {{ .Values.adminService.config.contextPath }} {{- end }} --- kind: Deployment apiVersion: apps/v1 metadata: name: {{ $adminServiceFullName }} labels: {{- include "apollo.service.labels" . | nindent 4 }} spec: replicas: {{ .Values.adminService.replicaCount }} selector: matchLabels: app: {{ $adminServiceFullName }} {{- with .Values.adminService.strategy }} strategy: {{- toYaml . | nindent 4 }} {{- end }} template: metadata: labels: app: {{ $adminServiceFullName }} spec: {{- with .Values.adminService.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} volumes: - name: volume-configmap-{{ $adminServiceFullName }} configMap: name: {{ $adminServiceFullName }} items: - key: application-github.properties path: application-github.properties defaultMode: 420 containers: - name: {{ .Values.adminService.name }} image: "{{ .Values.adminService.image.repository }}:{{ .Values.adminService.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.adminService.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.adminService.containerPort }} protocol: TCP env: - name: SPRING_PROFILES_ACTIVE value: {{ .Values.adminService.config.profiles | quote }} {{- range $key, $value := .Values.adminService.env }} - name: {{ $key }} value: {{ $value }} {{- end }} volumeMounts: - name: volume-configmap-{{ $adminServiceFullName }} mountPath: /apollo-adminservice/config/application-github.properties subPath: application-github.properties livenessProbe: tcpSocket: port: {{ .Values.adminService.containerPort }} initialDelaySeconds: {{ .Values.adminService.liveness.initialDelaySeconds }} periodSeconds: {{ .Values.adminService.liveness.periodSeconds }} readinessProbe: httpGet: path: {{ .Values.adminService.config.contextPath }}/health port: {{ .Values.adminService.containerPort }} initialDelaySeconds: {{ .Values.adminService.readiness.initialDelaySeconds }} periodSeconds: {{ .Values.adminService.readiness.periodSeconds }} resources: {{- toYaml .Values.adminService.resources | nindent 12 }} {{- with .Values.adminService.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.adminService.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.adminService.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}