kubernetes的yml
1: 创建namespace
文件po.yml 内容如下
apiVersion: v1 kind: Namespace metadata: name: po
命令:
kubectl apply -f po.yml
删除namespace
kubectl delete -f po.yml
2: 创建pod
文件po-pods.yml 内容如下
apiVersion: v1 kind: Pod metadata: name: tomcat9 labels: app: tomcat9 spec: containers: - name: tomcat9 image: tomcat:9.0.20-jre8-alpine imagePullPolicy: IfNotPresent restartPolicy: Always
执行命令
kubectl apply -f po-pods.yml
标签:kubectl,name,kubernetes,po,yml,tomcat9 From: https://www.cnblogs.com/popopopopo/p/16851092.html