作者 Administrator

增加新文件

  1 +apiVersion: v1
  2 +kind: Service
  3 +metadata:
  4 + name: performance-back
  5 + namespace: mmm-suplus-test
  6 + labels:
  7 + k8s-app: performance-back
  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: performance-back
  18 +---
  19 +apiVersion: extensions/v1beta1
  20 +kind: Deployment
  21 +metadata:
  22 + name: performance-back
  23 + namespace: mmm-suplus-test
  24 + labels:
  25 + k8s-app: performance-back
  26 +spec:
  27 + replicas: 1
  28 + template:
  29 + metadata:
  30 + labels:
  31 + k8s-app: performance-back
  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-bp1djh1xn7taumbue1ze
  45 + - cn-hangzhou.i-bp1djh1xn7taumbue1zd
  46 + - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
  47 + - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
  48 + containers:
  49 + - name: performance-back
  50 + image: 192.168.0.243:5000/mmm/sg-storage:local
  51 + imagePullPolicy: Always
  52 + ports:
  53 + - containerPort: 8080
  54 + - containerPort: 443
  55 + volumeMounts:
  56 + - mountPath: /opt/logs
  57 + name: accesslogs
  58 + - mountPath: /go/src/sg-storage/uploads
  59 + name: sgstorage-pvc1
  60 + env:
  61 + - name: LOG_LEVEL
  62 + value: "debug"
  63 + - name: LOG_FILE
  64 + value: "true"
  65 + - name: ERROR_BASE_CODE
  66 + value: "1"
  67 + - name: ERROR_BASE_CODE_MULTIPLE
  68 + value: "1000"
  69 + - name: POSTGRESQL_DB_NAME
  70 + value: "performance_test"
  71 + - name: ENABLE_HTTPS
  72 + value: "true"
  73 + - name: POSTGRESQL_USER
  74 + valueFrom:
  75 + configMapKeyRef:
  76 + name: suplus-config
  77 + key: postgresql.user
  78 + - name: POSTGRESQL_PASSWORD
  79 + valueFrom:
  80 + configMapKeyRef:
  81 + name: suplus-config
  82 + key: postgresql.password
  83 + - name: POSTGRESQL_HOST
  84 + valueFrom:
  85 + configMapKeyRef:
  86 + name: suplus-config
  87 + key: postgresql.host
  88 + - name: POSTGRESQL_PORT
  89 + valueFrom:
  90 + configMapKeyRef:
  91 + name: suplus-config
  92 + key: postgresql.port
  93 + - name: REDIS_HOST
  94 + valueFrom:
  95 + configMapKeyRef:
  96 + name: suplus-config
  97 + key: redis.ip
  98 + - name: REDIS_PORT
  99 + valueFrom:
  100 + configMapKeyRef:
  101 + name: suplus-config
  102 + key: redis.port
  103 + - name: KAFKA_HOSTS
  104 + valueFrom:
  105 + configMapKeyRef:
  106 + name: suplus-config
  107 + key: kafka.host
  108 + - name: KAFKA_PERFORMANCE_ID
  109 + valueFrom:
  110 + configMapKeyRef:
  111 + name: suplus-config
  112 + key: kafkaperformance.id
  113 + volumes:
  114 + - name: accesslogs
  115 + emptyDir: {}
  116 + - name: sgstorage-pvc1
  117 + persistentVolumeClaim:
  118 + claimName: sgstorage-pvc