资源限定
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: tomcat-deploy
spec:
replicas: 2
template:
metadata:
labels:
app: tomcat-cluster
spec:
volumes:
- name: web-app
hostPath:
path: /mnt
containers:
- name: tomcat-cluster
image: tomcat:latest
resources:
requests: # 最低要求
cpu: 0.5 # 不一定是个整数,0.5核 逻辑
memory: 200Mi
limits: # 最多使用
cpu: 1
memory: 512Mi
ports:
- containerPort: 8080
volumeMounts:
- name: web-app
mountPath: /usr/local/tomcat/webapps