k8s 部署nginx-> vue (简易版)
apiVersion: apps/v1kind: Deploymentmetadata:name: pc-deploymentnamespace: liyuanspec:replicas: 1selector:matchLabels:app: nginx-podtemplate:metadata:labels:app: nginx-podspec:containers:
·
apiVersion: apps/v1
kind: Deployment
metadata:
name: pc-deployment
namespace: liyuan
spec:
replicas: 1
selector:
matchLabels:
app: nginx-pod
template:
metadata:
labels:
app: nginx-pod
spec:
containers:
- name: nginx
image: nginx:1.17.1
ports:
- containerPort: 80
volumeMounts:
- name: nginx-web
mountPath: /usr/share/nginx/html
volumes:
- name: nginx-web
hostPath:
path: /root/www/html
type: DirectoryOrCreate
---
apiVersion: v1
kind: Service
metadata:
name: nginx-svc
namespace: liyuan
spec:
selector:
app: nginx-pod
type: NodePort
ports:
- port: 80
targetPort: 80
nodePort: 30010
更多推荐
已为社区贡献16条内容
所有评论(0)