본문 바로가기

EKS

(38)
Grafana - EKS Custom DashBoard 구성하기 그라파나 대시보드를 만들기 위해서는 PromSQL을 사용해야하는데, 이보다 중요한게 바로 지표가 무엇인지 정확히 아는 것 입니다. 아래를 통해서 간단하게 pod에 대한 지표를 체크할 수 있습니다. https://github.com/kubernetes/kube-state-metrics/blob/master/docs/pod-metrics.md kubernetes/kube-state-metrics Add-on agent to generate and expose cluster-level metrics. - kubernetes/kube-state-metrics github.com 하지만 가장 정확한 방법은 역시 프로메테우스를 띄우고 직접 지표를 확인해 보는 것 입니다. 여기서 원하는 지표들을 직접 찾아서 쿼리하여..
Grafana - Image Render Plugin & Slack Alert 연동 Kubernetes 환경에서 Image Render Plugin을 설치하여 Alert을 이미지와 함께 이쁘게 던지고 싶은데, 한글화된 자료가 없어서 좀 힘들었습니다. 공식자료들을 살펴보면 아래와 같은 value.yaml을 설정하면 가능하나, 실제로 적용했을 경우 알 수 없는 플러그인이라는 에러가 발생합니다. plugins: - grafana-image-renderer 돌아돌아 살피던 중 방법을 알아냈는데 순서는 아래와 같습니다. Grafana DashBoard Alert 세팅 -> Alert 발생 -> S3에 해당 이미지 업로드 -> Slack에 Alert 전달 따라서 먼저 S3에 관한 세팅해보도록 하겠습니다. 먼저 Grafana에서 사용할 수 있는 IAM 계정을 만들어줍니다. 저는 grafana-ima..
Prometheus - EFS Provisioner / PVC 연동 프로메테우스는 시계열 DB이며, 파드가 Empty Dir이 기본 속성인 것을 생각하면, 파드가 죽었을 경우 그 동안 수집한 메트릭이 모두 사라진다는 것을 알 수 있습니다. 따라서 이를 방지하기 위해서 PVC를 통해 볼륨을 매핑하여 사용하여야 하는데, AWS에서 EBS의 경우 Zone을 선택하여 사용해야하기 때문에, 이중화 삼중화 사중화등으로 구성한 경우, 프로메테우스가 해당 볼륨을 제대로 매핑할 수 없는 경우가 생깁니다. 물론, affinity 설정을 통해 PVC한 볼륨과 맞게 프로메테우스를 띄우시는 것도 방법입니다. 하지만, 이중화 구성을 못하기 때문에 EFS를 사용하여 해결하는 방법을 알아보도록 하겠습니다. --- 수정 사항 ------------------------------------------..
EKS Cluster 구축 - 6. Helm3 설치 Helm3 버전이 출시되고 꽤 안정화되어 이제 구글에도 레퍼런스가 많아지기 시작했습니다. 먼저, 기존 helm2를 설치하셨다면 아래 명령어를 통해서 찾아지는 경로를 모두 삭제해주시면 됩니다. sudo find / -name helm kubectl -n kube-system delete deployment tiller-deploy kubectl -n kube-system delete service/tiller-deploy 이제, helm3를 설치해보도록 하겠습니다. 맥의 경우 아래와 같습니다. brew install helm 일반 리눅스의 경우 아래와 같습니다. curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_..
EKS istio - 2. istio 구성 istio를 세팅하도록 하겠습니다. cd ~/environment curl -L https://git.io/getLatestIstio | sh - cd istio-* sudo mv -v bin/istioctl /usr/local/bin/ tiller 계정의 rbac를 아래 명령어를 통해 수정해주세요 kubectl apply -f install/kubernetes/helm/helm-service-account.yaml helm을 통해 istio를 설치하도록 하겠습니다. helm install install/kubernetes/helm/istio-init --name istio-init --namespace istio-system ALB를 통해 istio를 구성할 것이기 때문에 아래와 같이 수행해주세요. h..
EKS istio - 1. Intro istio는 무엇이며 istio를 사용했을 때, 어떠한 형태의 흐름을 갖게되는지 간단하게 설명하도록 하겠습니다. istio란 무엇일까요? 우리가 실제로 서비스를 구축하고 운영하게 되면 장애가 발생하지 않을 수는 없습니다. 특히나 MSA 아키텍쳐로 구성 개발하게 되면 각 서비스간의 트래픽의 장애 모니터링 및 조치를 고민하게 됩니다. Service Mesh를 통해 각 서비스간의 통신을 엮고 관리하는데, 그 방법은 아래와 같습니다. 먼저, istio는 control plane과 data plane으로 나뉩니다. Control Plane은 경량 프록시를 서비스 옆에 컨테이너로 하나 띄워서 정책을 주고, 그 정책을 가지고 트래픽을 컨트롤하게 됩니다. 각 구성요소를 하나씩 보면, Envoy 서비스 메시를 구성하는 ..
EKS Mornitoring - 2. AlertManager 세팅 공식다큐는 다음과 같으며, https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/ Alerting rules | Prometheus Alerting rules allow you to define alert conditions based on Prometheus expression language expressions and to send notifications about firing alerts to an external service. Whenever the alert expression results in one or more vector elements at a given po prometheus.io 각 Alert.y..
EKS Cloudwatch 연동 - 3. FluentD - Cloudwatch 연동 먼저, 앞의 부분을 수행하시고 지우지 않으셨다면, 네임스페이스가 생성되어있기 때문에 수행하지 않으셔도 됩니다. 아래 명령어를 수행해서, 네임스페이스를 만들어주세요. kubectl apply -f https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/master/k8s-yaml-templates/cloudwatch-namespace.yaml Fluent.D 설치 kubectl create configmap cluster-info \ --from-literal=cluster.name=CB-TEST-EKS-CLUSTER \ --from-literal=logs.region=ap-northeast-2 -n amazon-..