k8s部署tomcat的yaml文件
1、k8s部署tomcat的yaml文件apiVersion: apps/v1kind: Deploymentmetadata:name: my-tomcatspec:replicas: 2selector:matchLabels:app: my-tomcatminReadySeconds: 1progressDeadlineSecon...
·
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
更多推荐
已为社区贡献45条内容
所有评论(0)