@@ -0,0 +1,64 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: nginx-app
+---
+apiVersion: apps/v1
+kind: Deployment
+ name: nginx-deployment
+ namespace: nginx-app
+ labels:
+ app: nginx
+spec:
+ replicas: 3
+ selector:
+ matchLabels:
+ template:
+ metadata:
+ 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"
+ readinessProbe:
+ httpGet:
+ path: /
+ port: 80
+ initialDelaySeconds: 5
+ periodSeconds: 5
+ livenessProbe:
+ initialDelaySeconds: 10
+ periodSeconds: 10
+
+kind: Service
+ name: nginx-service
+ - protocol: TCP
+ targetPort: 80
+ nodePort: 30080 # 指定一个节点端口
+ type: NodePort # 改为NodePort类型