我正在 kubernetes 中创建服务。如何将 Classic Load Balancer 更改为 Network Load Balancer?我正在为它提供的外部客户端 IP 转向网络负载均衡器。我使用 AWS。这是我的配置:
apiVersion : apps/v1
kind: Deployment
metadata:
name: my-web-deployment-multi-pod
labels:
app : my-k8s-deployment
spec:
replicas: 3
selector:
matchLabels:
project: cia
template:
metadata:
labels:
project: cia
spec:
containers:
- name : my-web
image: adv4000/k8sphp:latest
ports:
- containerPort: 80 # Port on Pod
- name : not-my-web
image: tomcat:8.5.38
ports:
- containerPort: 8080 # Port on Pod
apiVersion: v1
kind: Service
metadata:
name: my-multi-pods-service
spec:
type: LoadBalancer
selector:
project: cia
ports:
- name : my-web-app-listener
protocol : TCP
port : 80
targetPort: 80
- name : not-my-web-app-listener
protocol : TCP
port : 8888
targetPort: 8080