前端項(xiàng)目,在部署發(fā)布的時(shí)候需要配置yaml文件:
BuildScript文件夾下需要這三個(gè).yaml文件
配置如下:
就這樣,三個(gè)文件內(nèi)容基本一樣燎含,需根據(jù)實(shí)際情況修改namespace及host
源碼在這里
apiVersion: extentions/v1beta1
kind: Deployment
metadata:
name: web-master
namespace: It23-05-foreign-assistant
spec:
replicas: 1
selector:
matchLabels:
run: web-master
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
lablels:
run: web-master
service.alauda.io/name: self.resource_name
annotations:
owner.cm.io/info: '[{"name": "Jeff", "phone":"11111111111"}]'
spec:
containers:
- image: [image]
imagePillPolicy: Always
name: web-master
env:
- name: ENV_FOR_DYNACONF
value: passweb
ports:
- containerPort: 8080
resources:
limits:
cpu: ‘2’
memory: 2G
requests:
cpu: ‘2’
memory: 2G
---
kind: Service
apiVersion: v1
metadata:
name: web-master
namespace: It23-05-foreign-assistant
spec:
template:
metadata:
lablels:
run: web-master
service.alauda.io/name: self.resource_name
ports:
- port: 8080
name: 8080-8080
protocol: TCP
targetPort: 8080
selector:
run: web-master
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
annotations:
haproxy.router.openshift.io.timeout: 900s
name: web-master
namespace: It23-05-foreign-assistant
spec:
host: web-master.xxx.xxxx.xx
to:
kind: Service
name: web-master
port:
targetPort: 8080-8080