2021年10月1日金曜日

EKS for ALB(外部接続編)

参照:
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

=================



以下、ELBのマネージメントコンソル上でもALBが追加れたことが確認できる。






以下の作成されたALBにアクセスしてみる





接続が確認を行う









0 件のコメント:

コメントを投稿

Redis(helm install)

local-storage  は  動的プロビジョニングされない  ため、Helm のインストール時に  PersistentVolume (PV) を事前に作成する必要があります 。 手順: 1)strage classをlocal strageを指定 helm install...