作者 yangfu

fix: 增加生产环境配置

  1 +apiVersion: v1
  2 +kind: Service
  3 +metadata:
  4 + name: allied-creation-manufacture
  5 + namespace: mmm-suplus-test
  6 + labels:
  7 + k8s-app: allied-creation-manufacture
  8 +spec:
  9 + ports:
  10 + - name: "http"
  11 + port: 80
  12 + targetPort: 8082
  13 + selector:
  14 + k8s-app: allied-creation-manufacture
  15 +---
  16 +apiVersion: extensions/v1beta1
  17 +kind: Deployment
  18 +metadata:
  19 + name: allied-creation-manufacture
  20 + namespace: mmm-suplus-test
  21 + labels:
  22 + k8s-app: allied-creation-manufacture
  23 +spec:
  24 + replicas: 1
  25 + template:
  26 + metadata:
  27 + labels:
  28 + k8s-app: allied-creation-manufacture
  29 + spec:
  30 + affinity:
  31 + nodeAffinity:
  32 + preferredDuringSchedulingIgnoredDuringExecution:
  33 + - preference: {}
  34 + weight: 100
  35 + requiredDuringSchedulingIgnoredDuringExecution:
  36 + nodeSelectorTerms:
  37 + - matchExpressions:
  38 + - key: kubernetes.io/hostname
  39 + operator: In
  40 + values:
  41 + - cn-hangzhou.i-bp1djh1xn7taumbue1ze
  42 + - cn-hangzhou.i-bp1djh1xn7taumbue1zd
  43 + - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
  44 + - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
  45 + containers:
  46 + - name: allied-creation-manufacture
  47 + image: 192.168.0.243:5000/mmm/allied-creation-manufacture:dev
  48 + imagePullPolicy: Always
  49 + ports:
  50 + - containerPort: 8082
  51 + env:
  52 + - name: POSTGRESQL_DB_NAME
  53 + valueFrom:
  54 + configMapKeyRef:
  55 + name: suplus-config
  56 + key: postgresqlalliedcreation.dbname
  57 + - name: POSTGRESQL_USER
  58 + valueFrom:
  59 + configMapKeyRef:
  60 + name: suplus-config
  61 + key: postgresql.user
  62 + - name: POSTGRESQL_PASSWORD
  63 + valueFrom:
  64 + configMapKeyRef:
  65 + name: suplus-config
  66 + key: postgresql.password
  67 + - name: POSTGRESQL_HOST
  68 + valueFrom:
  69 + configMapKeyRef:
  70 + name: suplus-config
  71 + key: postgresql.host
  72 + - name: POSTGRESQL_PORT
  73 + valueFrom:
  74 + configMapKeyRef:
  75 + name: suplus-config
  76 + key: postgresql.port
  77 + - name: REDIS_HOST
  78 + valueFrom:
  79 + configMapKeyRef:
  80 + name: suplus-config
  81 + key: redis.ip
  82 + - name: REDIS_PORT
  83 + valueFrom:
  84 + configMapKeyRef:
  85 + name: suplus-config
  86 + key: redis.port
  87 + - name: REDIS_AUTH
  88 + value: ""
  89 + - name: LOG_LEVEL
  90 + value: "debug"
  91 + - name: ERROR_BASE_CODE
  92 + value: "1"
  93 + - name: ERROR_BASE_CODE_MULTIPLE
  94 + value: "2000"
  95 + - name: ENABLE_KAFKA_LOG
  96 + value: "true"
  97 + - name: HTTP_PORT
  98 + value: "8082"
  99 + - name: SERVICE_ENV
  100 + value: "prd"
  101 + - name: ALLIED_CREATION_GATEWAY_HOST
  102 + value: "https://allied-creation-gateway-prd.fjmaimaimai.com"
  103 + - name: ALLIED_CREATION_USER_HOST
  104 + value: "https://allied-creation-user-prd.fjmaimaimai.com"
  105 + - name: ALLIED_CREATION_BASIC_HOST
  106 + value: "https://allied-creation-basic-prd.fjmaimaimai.com"
  107 + - name: ALLIED_CREATION_MANUFACTURE_HOST
  108 + value: "http://allied-creation-manufacture-prd.fjmaimaimai.com"
  109 + - name: SMS_SERVE_HOST
  110 + value: "https://sms.fjmaimaimai.com:9897"
  111 + - name: MANUFACTURE_DEFAULT_COMPANYID
  112 + value: "4"
  113 + - name: MANUFACTURE_DEFAULT_ORGID
  114 + value: "44"
  115 + - name: MANUFACTURE_DEFAULT_WORKSHOPID
  116 + value: "1"
  117 + - name: MANUFACTURE_PRODUCT_TYPE
  118 + value: "0502010001ST,0502010007ST,0502010008ST,0502010009ST,0502010010ST,0502010011ST,0502010014ST,0502010016ST,0502010018ST,0502010020ST,0502010021ST,0502010022ST,0502010023ST"
  119 + - name: MQTT_HOST
  120 + value: "47.97.5.102"
  121 + - name: MQTT_PORT
  122 + value: "6000"
@@ -30,6 +30,9 @@ func newK3cloudClient() (*k3cloud.Client, error) { @@ -30,6 +30,9 @@ func newK3cloudClient() (*k3cloud.Client, error) {
30 password = "stx@123456" 30 password = "stx@123456"
31 hostUrl = "https://tianlian.test.ik3cloud.com/k3cloud" 31 hostUrl = "https://tianlian.test.ik3cloud.com/k3cloud"
32 ) 32 )
  33 + if constant.SERVICE_ENV == "prd" {
  34 + hostUrl = "https://tianlian.ik3cloud.com/k3cloud"
  35 + }
33 client, err := k3cloud.NewClient(hostUrl, acctID, username, password) 36 client, err := k3cloud.NewClient(hostUrl, acctID, username, password)
34 return client, err 37 return client, err
35 } 38 }