YAML文件内容(把tomcat和mysql放到同一个Pod中)
apiVersion: v1
kind: Pod
metadata:
name: my-app
labels:
name: my-app
spec:
containers:
- name: tomcat
image: tomcat:1.0
ports:
- containerPort: 8080
- name: mysql
image: mysql:5.7
ports:
- containerPort: 3306
注意:属于同一Pod的容器之间相互访问仅需通过localhost就可以访问