How to Deploy Tomcat on k8s
跳到导航
跳到搜索
k8s部署tomcat
Deployment
root@k8s-master ~]# cat tomcat.yml apiVersion: apps/v1 kind: Deployment metadata: name: tomcat-deployment labels: app: tomcat spec: replicas: 3 selector: matchLabels: app: tomcat template: metadata: labels: app: tomcat spec: containers: - name: tomcat image: tomcat:latest ports: - containerPort: 8080 #run [root@k8s-master ~]# kubectl apply -f tomcat.yml deployment.apps/tomcat-deployment created
具体Deployment编写细节请参考以下地址: https://kubernetes.io/zh/docs/concepts/workloads/controllers/deployment/