k8s部署tomcat及web应用_k8s部署tomcat的yaml文件
1、k8s部署tomcat的yaml文件apiVersion: apps/v1kind: Deploymentmetadata:name: mytomcatspec:replicas: 5selector:matchLabels:app: mytomcatminReadySeconds: 1progressDeadlineSeconds: 60revisionHistoryLimit: 5stra
1、k8s部署tomcat的yaml文件
apiVersion: apps/v1
kind: Deployment
metadata:
name: mytomcat
spec:
replicas: 5
selector:
matchLabels:
app: mytomcat
minReadySeconds: 1
progressDeadlineSeconds: 60
revisionHistoryLimit: 5
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
template:
metadata:
name: mytomcat
labels:
app: mytomcat
spec:
containers:
- name: mytomcat
image: tomcat:8
ports:
- containerPort: 8080
volumeMounts:
- name: tz-config
mountPath: /etc/localtime
volumes:
- name: tz-config
hostPath:
path: /usr/share/zoneinfo/Asia/Shanghai
2、k8s部署tomcat的svc文件
apiVersion: v1
kind: Service
metadata:
name: mytomcat
spec:
type: NodePort
ports:
- port: 8080
nodePort: 30012
selector:
app: mytomcat
更多推荐
所有评论(0)