参照:
https://docs.aws.amazon.com/ja_jp/eks/latest/userguide/network-load-balancing.html
1)公式から以下のマニュフェストを利用して実施する。
kubectl apply -f nginx.yaml
(赤文字の箇所がALBを認識する際に重要)
=======nginx.yaml=====
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-app
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: public.ecr.aws/nginx/nginx:1.19.6
ports:
- name: http
containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: sample-service
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: external
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
spec:
ports:
- port: 80
targetPort: 80
protocol: TCP
type: LoadBalancer
selector:
app: nginx
=================
0 件のコメント:
コメントを投稿