# # 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-config-server-prod kind: ConfigMap apiVersion: v1 metadata: namespace: sre name: configmap-apollo-config-server-prod data: application-github.properties: | spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-prod-env.sre:3306/ApolloConfigDB?characterEncoding=utf8 spring.datasource.username = FillInCorrectUser spring.datasource.password = FillInCorrectPassword eureka.service.url = http://statefulset-apollo-config-server-prod-0.service-apollo-meta-server-prod:8080/eureka/,http://statefulset-apollo-config-server-prod-1.service-apollo-meta-server-prod:8080/eureka/ --- kind: Service apiVersion: v1 metadata: namespace: sre name: service-apollo-meta-server-prod labels: app: service-apollo-meta-server-prod spec: ports: - protocol: TCP port: 8080 targetPort: 8080 selector: app: pod-apollo-config-server-prod type: ClusterIP clusterIP: None sessionAffinity: ClientIP --- kind: Service apiVersion: v1 metadata: namespace: sre name: service-apollo-config-server-prod labels: app: service-apollo-config-server-prod spec: ports: - protocol: TCP port: 8080 targetPort: 8080 nodePort: 30005 selector: app: pod-apollo-config-server-prod type: NodePort sessionAffinity: ClientIP --- kind: StatefulSet apiVersion: apps/v1 metadata: namespace: sre name: statefulset-apollo-config-server-prod labels: app: statefulset-apollo-config-server-prod spec: serviceName: service-apollo-meta-server-prod replicas: 2 selector: matchLabels: app: pod-apollo-config-server-prod updateStrategy: type: RollingUpdate template: metadata: labels: app: pod-apollo-config-server-prod spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: - pod-apollo-config-server-prod topologyKey: kubernetes.io/hostname volumes: - name: volume-configmap-apollo-config-server-prod configMap: name: configmap-apollo-config-server-prod items: - key: application-github.properties path: application-github.properties containers: - image: apolloconfig/apollo-configservice:1.9.2 securityContext: privileged: true imagePullPolicy: IfNotPresent name: container-apollo-config-server-prod ports: - protocol: TCP containerPort: 8080 volumeMounts: - name: volume-configmap-apollo-config-server-prod mountPath: /apollo-configservice/config/application-github.properties subPath: application-github.properties env: - name: APOLLO_CONFIG_SERVICE_NAME value: "service-apollo-config-server-prod.sre" readinessProbe: tcpSocket: port: 8080 initialDelaySeconds: 10 periodSeconds: 5 livenessProbe: tcpSocket: port: 8080 initialDelaySeconds: 120 periodSeconds: 10 dnsPolicy: ClusterFirst restartPolicy: Always