123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: fuzzs-scene-sim-test
- spec:
- type: NodePort
- ports:
- - name: backend
- port: 8089
- targetPort: 8089
- nodePort: 30000
- - name: client
- port: 8080
- targetPort: 8080
- nodePort: 30001
- - name: db
- port: 3306
- targetPort: 3306
- nodePort: 30002
- selector:
- app: fuzzs-scene-sim-test-app
- ---
- # 改为NodePort
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: fuzzs-scene-sim-test-app
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: fuzzs-scene-sim-test-app
- template:
- metadata:
- labels:
- app: fuzzs-scene-sim-test-app
- spec:
- securityContext:
- runAsUser: 0
- containers:
- - name: backend
- image: fuzzsscenesimtest-backend:latest
- imagePullPolicy: Never
- ports:
- - containerPort: 8089
- env:
- - name: TZ
- value: Asia/Shanghai
- - name: DB_URL
- value: jdbc:mysql://fuzzs-scene-sim-test:3306/test?serverTimezone=Asia/Shanghai
- - name: client
- image: fuzzsscenesimtest-client:latest
- imagePullPolicy: Never
- ports:
- - containerPort: 8081
- env:
- - name: SERVER_URL
- value: http://fuzzs-scene-sim-test:8089
- - name: CLIENT_PORT
- value: "8081"
- - name: db
- image: mysql:5.7
- volumeMounts:
- - name: mysql-data
- mountPath: /var/lib/mysql
- ports:
- - containerPort: 3306
- env:
- - name: MYSQL_ROOT_PASSWORD
- value: root
- - name: TZ
- value: Asia/Shanghai
- volumes:
- - name: mysql-data
- hostPath:
- path: /home/fuzzs-scene-sim-test/mysql/data
|