--- kind: ConfigMap apiVersion: v1 metadata: name: release-apollo-portal data: application-github.properties: | spring.datasource.url = jdbc:mysql://192.168.122.37:3306/ApolloPortalDB?characterEncoding=utf8 spring.datasource.username = root spring.datasource.password = 666666 apollo.portal.envs = fat,uat,dev,prod apollo-env.properties: | dev.meta = http://dev-apollo-configservice.apolloconfig:8080 fat.meta = http://fat-apollo-configservice.apolloconfig:8080 prod.meta = http://prod-apollo-configservice.apolloconfig:8080 uat.meta = http://uat-apollo-configservice.apolloconfig:8080 --- kind: Service apiVersion: v1 metadata: name: release-apollo-portal labels: app.kubernetes.io/version: "1.9.1" spec: type: ClusterIP ports: - name: http protocol: TCP port: 8070 targetPort: 8070 selector: app: release-apollo-portal sessionAffinity: ClientIP --- kind: Deployment apiVersion: apps/v1 metadata: name: release-apollo-portal labels: app.kubernetes.io/version: "1.9.1" spec: replicas: 1 selector: matchLabels: app: release-apollo-portal template: metadata: labels: app: release-apollo-portal spec: volumes: - name: configmap-release-apollo-portal configMap: name: release-apollo-portal items: - key: application-github.properties path: application-github.properties - key: apollo-env.properties path: apollo-env.properties defaultMode: 420 containers: - name: apollo-portal image: "apolloconfig/apollo-portal:1.9.1" imagePullPolicy: IfNotPresent ports: - name: http containerPort: 8070 protocol: TCP env: - name: SPRING_PROFILES_ACTIVE value: "github,auth" volumeMounts: - name: configmap-release-apollo-portal mountPath: /apollo-portal/config/application-github.properties subPath: application-github.properties - name: configmap-release-apollo-portal mountPath: /apollo-portal/config/apollo-env.properties subPath: apollo-env.properties livenessProbe: tcpSocket: port: 8070 initialDelaySeconds: 100 periodSeconds: 10 readinessProbe: httpGet: path: /health port: 8070 initialDelaySeconds: 30 periodSeconds: 5 resources: {} --- --- ---