作者 Administrator

增加新文件

  1 +apiVersion: v1
  2 +kind: Service
  3 +metadata:
  4 + name: mmmopp
  5 + namespace: mmm-suplus-preonline
  6 + labels:
  7 + k8s-app: mmmopp
  8 +spec:
  9 + ports:
  10 + - name: "http"
  11 + port: 80
  12 + targetPort: 8080
  13 + - name: "https"
  14 + port: 443
  15 + targetPort: 443
  16 + selector:
  17 + k8s-app: mmmopp
  18 +---
  19 +apiVersion: extensions/v1beta1
  20 +kind: Deployment
  21 +metadata:
  22 + name: mmmopp
  23 + namespace: mmm-suplus-preonline
  24 + labels:
  25 + k8s-app: mmmopp
  26 +spec:
  27 + replicas: 1
  28 + template:
  29 + metadata:
  30 + labels:
  31 + k8s-app: mmmopp
  32 + spec:
  33 + affinity:
  34 + nodeAffinity:
  35 + preferredDuringSchedulingIgnoredDuringExecution:
  36 + - preference: {}
  37 + weight: 100
  38 + requiredDuringSchedulingIgnoredDuringExecution:
  39 + nodeSelectorTerms:
  40 + - matchExpressions:
  41 + - key: kubernetes.io/hostname
  42 + operator: In
  43 + values:
  44 + - cn-hangzhou.i-bp10pa9isz0xg7nlsuzp
  45 + containers:
  46 + - name: mmmopp
  47 + image: 192.168.0.243:5000/mmm/mmmopp:preonline
  48 + imagePullPolicy: Always
  49 + volumeMounts:
  50 + - mountPath: /opt/logs
  51 + name: accesslogs
  52 + - mountPath: /var/www/opp/file
  53 + name: opportunity-pvc1
  54 + ports:
  55 + - containerPort: 8080
  56 + - containerPort: 443
  57 + env:
  58 + - name: MYSQL_HOST
  59 + valueFrom:
  60 + configMapKeyRef:
  61 + name: suplus-config
  62 + key: mysql.host
  63 + - name: MYSQL_PORT
  64 + valueFrom:
  65 + configMapKeyRef:
  66 + name: suplus-config
  67 + key: mysql.port
  68 + - name: REDIS_HOST
  69 + valueFrom:
  70 + configMapKeyRef:
  71 + name: suplus-config
  72 + key: redis.ip
  73 + - name: REDIS_PORT
  74 + valueFrom:
  75 + configMapKeyRef:
  76 + name: suplus-config
  77 + key: redis.port
  78 + - name: MYSQL_USER
  79 + valueFrom:
  80 + configMapKeyRef:
  81 + name: suplus-config
  82 + key: mysql.user
  83 + - name: MYSQL_PASSWORD
  84 + valueFrom:
  85 + configMapKeyRef:
  86 + name: suplus-config
  87 + key: mysql.password
  88 + - name: MYSQL_DB_NAME
  89 + value: "opportunity_preonline"
  90 + - name: RUN_MODE
  91 + value: "prod"
  92 + - name: LOG_LEVEL
  93 + value: "debug"
  94 + - name: aliyun_logs_suplusfile
  95 + value: "stdout"
  96 + - name: aliyun_logs_access
  97 + value: " /opt/logs/app.log"
  98 + volumes:
  99 + - name: accesslogs
  100 + emptyDir: {}
  101 + - name: opportunity-pvc1
  102 + persistentVolumeClaim:
  103 + claimName: opportunity-pvc5