apiVersion: v1
kind: Namespace
metadata:
name: hw-test
labels:
name: hw-label-test
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: hw-test
name: hw-deployment
spec:
selector:
matchLabels:
app: helloworld
replicas: 2
template:
metadata:
labels:
app: helloworld
spec:
containers:
- name: helloworld
image: 192.168.190.130:5000/hello-world
ports:
- containerPort: 9080
---
apiVersion: v1
kind: Service
metadata:
namespace: hw-test
name: hw-service
spec:
selector:
app: helloworld
ports:
- protocol: TCP
port: 9080
targetPort: 9080
nodePort: 31080
type: NodePort
Kubernetes项目部署脚本1
最新推荐文章于 2024-08-21 17:34:08 发布