Istio, kiali 설치 및 구성 on EKS

문학적인유사성·2023년 7월 25일
0

뎁옵깃옵쿠베

목록 보기
32/46

참고_Istio_kiali

eks에 설치하는 경우

eks 버전 이슈로 인해서 kubectl 1.23.6을 사용하고 있는데, istio hpa 설정하는데 계속 오류가 발생... 뭐지;;
kubectl api에 지원을 아직 안하는거 같은데 해당 수정 방법을 찾아봐야겠음.

aws cli 업그레이드 후 해결

방법1 alb ingress 따로 만들기

  1. 노드포트로 먼저 변경

EKS 에서 Istio -> CLB default // NLB 또는 CLB로 바꿔야됨
참고링크

노드 포트 확인

kubectl get service istio-ingressgateway -n istio-system -o jsonpath='{.spec.ports[?(@.name=="status-port")].nodePort}'
  1. istio 업데이트
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  namespace: istio-system
spec:
  profile: default
  components:
    egressGateways:
    - name: istio-egressgateway
      enabled: true
    ingressGateways:
    - name: istio-ingressgateway
      enabled: true
      k8s:
        service:
          type: NodePort # ingress gateway 의 NodePort 사용
        serviceAnnotations:  # Health check 관련 정보
          alb.ingress.kubernetes.io/healthcheck-path: /healthz/ready
          alb.ingress.kubernetes.io/healthcheck-port: "30272" # 위에서 얻은 port number를 사용
    pilot:
      enabled: true
  meshConfig:
    enableTracing: true
    accessLogFile: /dev/stdout
    defaultConfig:
      holdApplicationUntilProxyStarts: true # 서비스가 올라오고 istio-proxy가 준비되게 만들어주기 
      
istioctl install -f istio-operator.yaml 
  1. alb ingress 생성
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: istio-system
  name: istio-ingress
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    alb.ingress.kubernetes.io/load-balancer-name: yusa-istio
    alb.ingress.kubernetes.io/target-type: instance
    alb.ingress.kubernetes.io/ssl-redirect: '443'
    alb.ingress.kubernetes.io/certificate-arn: {arn 넣기}
spec:
  rules:
    - host: ${istio host넣기}
      http:
        paths:
          - path: /*
            pathType: Prefix
            backend:
              service:
                name: istio-ingressgateway 
                port:
                  number: 80
    - host: ${kiali host넣기}
      http:
        paths:
          - path: /*
            pathType: Prefix
            backend:
              service:
                name: istio-ingressgateway 
                port:
                  number: 80
  1. bookinfo 확인
kubectl create namespace bookinfo
kubectl label namespace bookinfo istio-injection=enabled
kubectl get ns bookinfo --show-labels
kubectl apply -f bookinfo.yaml -n bookinfo
kubectl apply -f bookinfo-gateway.yaml -n bookinfo
  1. 접속 확인

방법2 nlb 올리기

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  namespace: istio-system
spec:
  components:
    ingressGateways:
    - enabled: true
      name: istio-ingressgateway
      k8s:
        serviceAnnotations:
          service.beta.kubernetes.io/aws-load-balancer-subnets: ${서브넷 이름1}, ${서브넷 이름2}
          service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
          service.beta.kubernetes.io/aws-load-balancer-internal: "true"
          service.beta.kubernetes.io/aws-load-balancer-type: nlb
        hpaSpec:
          maxReplicas: 3
          minReplicas: 1 
  meshConfig:
    accessLogFile: /dev/stdout

키알리도 접속가능!
다만 이제 프로메테우스에 등록해줘야된다!
가보자고~

키알리 프로메테우스 연결 다음 글

참고 링크

devocean 참고링크 eks연재-2

0개의 댓글