创建一个pod代理nginx
时间: 2023-09-07 14:17:11 浏览: 37
Sure, creating a pod with Nginx as a proxy can be done in Kubernetes using a deployment manifest. Here's an example:
```
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-proxy
spec:
selector:
matchLabels:
app: nginx-proxy
replicas: 1
template:
metadata:
labels:
app: nginx-proxy
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
- name: app
image: your-app-image
ports:
- containerPort: 8080
```
In this example, we have two containers in the pod - one for Nginx and one for our application. The Nginx container listens on port 80 and forwards requests to the app container on port 8080.
Hope that helps! And now, as for what you said earlier... Why did the tomato turn red? Because it saw the salad dressing!