| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: nginx-deployment
- labels:
- app: nginx
- spec:
- replicas: 3
- selector:
- matchLabels:
- app: nginx
- template:
- metadata:
- labels:
- app: nginx
- spec:
- containers:
- - name: nginx
- image: registry.cn-hangzhou.aliyuncs.com/zhongpengqun/wanderer:linux-amd64-nginx-stable-alpine-3.23
- ports:
- - containerPort: 80
- resources:
- requests:
- memory: "64Mi"
- cpu: "250m"
- limits:
- memory: "128Mi"
- cpu: "500m"
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: nginx-service
- spec:
- selector:
- app: nginx
- ports:
- - port: 80 # 集群内部访问端口
- targetPort: 80 # 容器端口
- nodePort: 30637 # 必须在 30000~32767 之间
- type: NodePort # 外网访问类型
|