--- # configmap for apollo-admin-server-test-beta kind: ConfigMap apiVersion: v1 metadata: namespace: sre name: configmap-apollo-admin-server-test-beta data: application-github.properties: | spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-test-beta-env.sre:3306/TestBetaApolloConfigDB?characterEncoding=utf8 spring.datasource.username = FillInCorrectUser spring.datasource.password = FillInCorrectPassword --- kind: Service apiVersion: v1 metadata: namespace: sre name: service-apollo-admin-server-test-beta labels: app: service-apollo-admin-server-test-beta spec: ports: - protocol: TCP port: 8090 targetPort: 8090 selector: app: pod-apollo-admin-server-test-beta type: ClusterIP sessionAffinity: ClientIP --- kind: Deployment apiVersion: apps/v1beta2 metadata: namespace: sre name: deployment-apollo-admin-server-test-beta labels: app: deployment-apollo-admin-server-test-beta spec: replicas: 3 selector: matchLabels: app: pod-apollo-admin-server-test-beta strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate template: metadata: labels: app: pod-apollo-admin-server-test-beta spec: nodeSelector: node: "apollo" volumes: - name: volume-configmap-apollo-admin-server-test-beta configMap: name: configmap-apollo-admin-server-test-beta items: - key: application-github.properties path: application-github.properties initContainers: - image: alpine-bash:3.8 name: check-service-apollo-config-server-test-beta command: ['bash', '-c', "curl --connect-timeout 2 --max-time 5 --retry 60 --retry-delay 1 --retry-max-time 120 service-apollo-config-server-test-beta.sre:8080"] containers: - image: apollo-admin-server:v1.0.0 imagePullPolicy: IfNotPresent name: container-apollo-admin-server-test-beta ports: - protocol: TCP containerPort: 8090 volumeMounts: - name: volume-configmap-apollo-admin-server-test-beta mountPath: /apollo-admin-server/config/application-github.properties subPath: application-github.properties env: - name: APOLLO_ADMIN_SERVICE_NAME value: "service-apollo-admin-server-test-beta.sre" readinessProbe: tcpSocket: port: 8090 initialDelaySeconds: 10 periodSeconds: 5 livenessProbe: tcpSocket: port: 8090 initialDelaySeconds: 120 periodSeconds: 10 dnsPolicy: ClusterFirst restartPolicy: Always