demo-boot-demoapi-k8s.yaml 1.9 KB
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-boot
  labels:
    app: demo-boot
spec:
  replicas: 1
  selector:
    matchLabels:
      app: demo-boot
  template:
    metadata:
      labels:
        app: demo-boot
    spec:
      imagePullSecrets:
      - name: aly-shanghai
      containers:
      - name: demo-boot
        image: registry.cn-shanghai.aliyuncs.com/ibizsys/demo-boot:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 52000
        env:
        - name: SPRING_CLOUD_NACOS_DISCOVERY_IP
          value: "172.16.240.110"      
        - name: SERVER_PORT
          value: "52000"
        - name: SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR
          value: "172.16.240.110:8848"
        - name: SPRING_REDIS_HOST
          value: "172.16.240.110"
        - name: SPRING_REDIS_PORT
          value: "6379"
        - name: SPRING_REDIS_DATABASE
          value: "0"
        - name: SPRING_DATASOURCE_USERNAME
          value: "a_LAB01_df847bdfd"
        - name: SPRING_DATASOURCE_PASSWORD
          value: "3d6@460A"
        - name: SPRING_DATASOURCE_URL
          value: "jdbc:mysql://172.16.186.185:3306/a_LAB01_df847bdfd?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true&serverTimezone=GMT%2B8"
        - name: SPRING_DATASOURCE_DRIVER-CLASS-NAME
          value: "com.mysql.jdbc.Driver"
        - name: SPRING_DATASOURCE_DEFAULTSCHEMA
          value: "a_LAB01_df847bdfd"
        - name: NACOS
          value: "172.16.240.110:8848"      
        - name: SEATA_REGISTRY_NACOS_SERVER-ADDR
          value: "172.16.240.110:8848"      
        - name: SEATA_ENABLED
          value: "true"      

---
apiVersion: v1
kind: Service
metadata:
  name: demo-boot
  labels:
    app: demo-boot
spec:
  type: NodePort
  ports:
  - name: http
    port: 52000
    targetPort: 52000
    nodePort: 52000
    protocol: TCP
  selector:
    app: demo-boot