










apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: web
name: web
spec:
replicas: 1
selector:
matchLabels:
app: web
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: web
spec:
containers:
- image: registry.cn-hangzhou.aliyuncs.com/shiningrise/nginx:1.22.1
name: nginx
resources: {}
status: {}
---
apiVersion: v1
kind: Service
metadata:
name: my-nodeport-service
labels:
app: web
spec:
type: NodePort
selector:
app: web
ports:
- name: http
port: 80
targetPort: 80
nodePort: 30001 # 可选,如果没有指定,Kubernetes 会自动分配
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。