본문 바로가기

클라우드157

[AWS] EKS Security- 6주차 안녕하세요. 이번주는 6주차 EKS Security 파트를 진행했는데요. k8s의 security 는 인증/인가 부분을 롤/롤바인딩을 serviceaccount에 할당하여 권한을 부여하는 부분이 있는데 EKS는 IAM관련하여 인증/인가하는 부분이 있습니다. 인증/인가도 aws의 서비스와 연동시켜 놓은 것이 놀라웠고 보안/네트워크가 원래 어렵자나요. 그래도 제가 학습한 내용을 모두 이해하셨으면 좋겠습니다. K8S의 인증 인가 참고 > 링크 링크 인증인가는 .kube/config 파일에서 관련 내용을 확인 할 수 있는데 k8s api 서버와 통신을 하기 위한 정보들이 기입되어 있다. 예제 cat .kube/config apiVersion: v1 clusters: - cluster: certificate-au.. 2023. 5. 31.
[AWS] EKS Autoscaling - 5주차 - Karpenter : K8S Native AutoScaler & Fargate # 카펜터 설치를 위한 환경 변수 설정 및 확인 export CLUSTER_ENDPOINT="$(aws eks describe-cluster --name ${CLUSTER_NAME} --query "cluster.endpoint" --output text)" export KARPENTER_IAM_ROLE_ARN="arn:aws:iam::${AWS_ACCOUNT_ID}:role/${CLUSTER_NAME}-karpenter" echo $CLUSTER_ENDPOINT $KARPENTER_IAM_ROLE_ARN # EC2 Spot Fleet 사용을 위한 service-linked-role 생성 확인 : 만들어있는것을 확인하는 거라 아래 에러 출력이 정상! # If the role has already been.. 2023. 5. 23.
[AWS] EKS Autoscaling - 5주차 - CPA - Cluster Proportional Autoscaler 실습 구성 helm repo add cluster-proportional-autoscaler https://kubernetes-sigs.github.io/cluster-proportional-autoscaler # CPA규칙을 설정하고 helm차트를 릴리즈 필요 helm upgrade --install cluster-proportional-autoscaler cluster-proportional-autoscaler/cluster-proportional-autoscaler # nginx 디플로이먼트 배포 cat 2023. 5. 23.
[AWS] EKS Autoscaling - 5주차 - Cluster Autoscaler 실습 전 미리 확인해보기 aws ec2 describe-instances --filters Name=tag:Name,Values=$CLUSTER_NAME-ng1-Node --query "Reservations[*].Instances[*].Tags[*]" --output yaml | yh export ASG_NAME=$(aws autoscaling describe-auto-scaling-groups --query "AutoScalingGroups[? Tags[? (Key=='eks:cluster-name') && Value=='myeks']].AutoScalingGroupName" --output text) aws autoscaling update-auto-scaling-group --auto-scalin.. 2023. 5. 23.
[AWS] EKS Autoscaling - 5주차 -Vertical Pod Autoscaler 설치 # 코드 다운로드 git clone https://github.com/kubernetes/autoscaler.git cd ~/autoscaler/vertical-pod-autoscaler/ tree hack # 배포 과정에서 에러 발생 : 방안1 openssl 버전 1.1.1 up, 방안2 브랜치08에서 작업 ERROR: Failed to create CA certificate for self-signing. If the error is "unknown option -addext", update your openssl version or deploy VPA from the vpa-release-0.8 branch. # 프로메테우스 임시 파일 시스템 사용으로 재시작 시 저장 메트릭과 대시보드 정보가 .. 2023. 5. 23.
[AWS] EKS Autoscaling - 5주차 -Kubernetes based Event Driven Autoscaler 실습 설치 # KEDA 설치 cat 2023. 5. 23.
[AWS] EKS Autoscaling - 5주차 -HPA - Horizontal Pod Autoscaler 실습 실습에 사용할 예제 어플리케이션 소개 index.php 를 불러와 부하를 줄 수 있다. ex)while true;do curl -s $PODIP; sleep 0.5; done 코드 더보기 도커파일 FROM php:5-apache COPY index.php /var/www/html/index.php RUN chmod a+rx index.php index.php 파일 디플로이 예제 apiVersion: apps/v1 kind: Deployment metadata: name: php-apache spec: selector: matchLabels: run: php-apache template: metadata: labels: run: php-apache spec: containers: - name: php-ap.. 2023. 5. 23.
[AWS] EKS Autoscaling - 5주차 -실습환경 배포 배포방법은 이전 글에서 확인 가능합니다. 2023.05.02 - [클라우드/AWS] - [AWS] EKS 실습 ( 원클릭으로 생성하기 ) - 2 주차 웹콘솔 Cloud Formation 배포링크 https://s3.ap-northeast-2.amazonaws.com/cloudformation.cloudneta.net/K8S/eks-oneclick4.yaml AWS CLI 배포 curl -O https://s3.ap-northeast-2.amazonaws.com/cloudformation.cloudneta.net/K8S/eks-oneclick4.yaml # CloudFormation 스택 배포 예시) aws cloudformation deploy --template-file eks-oneclick4.yam.. 2023. 5. 23.
[AWS] EKS Autoscaling - 5주차 이번 주차를 통해 기존 알고 있던 오토스케일에 in/out ( 인스턴스 수의 증가/감소)를 알고 있었는데 K8S에서도 동일하게 있지만 스케일 업이 있다는 것을 알게 되었고 가용성 측면에서 퍼블릭클라우드를 사용하면 이점 이 있을 것이라는 것을 학습하게 되었다. 실습환경도 편리하게 구축되어 있어 이전 블로그를 보지 않더라도 따라할 수 있으니 5주차는 꼭 실습 해보셨으면 좋겠습니다. 이론적인 내용은 리소스 /부하가 있으면 증량해준다는거라 동장 방식을 이해하고 늘어나는지 확인해보자 우선 실습 환경 구축 2023.05.23 - [클라우드/AWS] - [AWS] EKS Autoscaling - 5주차 -실습환경 배포 Kubernetes autoscaling overview 3가지 유형이 있다. 1. Horizont.. 2023. 5. 23.
[AWS] EKS monitoring - 4주차 - 프로메테우스 & 그라파나 참고 블로그 https://malwareanalysis.tistory.com/566 https://hanhorang31.github.io/post/pkos2-4-monitoring/ [PKOS] Thanos를 통한 고가용성 모니터링(프로메테우스) 시스템 구축하기 | HanHoRang Tech Blog 고가용성 모니터링 시스템 구축(프로메테우스, 타노스) hanhorang31.github.io pkos 스터디 4주차 - 메트릭 오픈소스 프로메테우스 4주 차에서는 메트릭 오픈소스인 프로메테우스 오퍼레이터를 공부했습니다. 프로메테우스 오퍼레이터를 이용하여 메트릭 수집방법과 알림기능 실습했습니다. 이번 주차에는 github copilot도움을 malwareanalysis.tistory.com 프로메테우스는 k8.. 2023. 5. 18.
[AWS] EKS monitoring - 4주차 -Metrics-server & kwatch & botkube 메트릭서버는 kubelet으로 부터 수집된 리소스 메트릭을 수집 및 집계하는 클러스터 애드온 구성요소 참고 Installing the Kubernetes Metrics Server - Amazon EKS Installing the Kubernetes Metrics Server The Kubernetes Metrics Server is an aggregator of resource usage data in your cluster, and it is not deployed by default in Amazon EKS clusters. For more information, see Kubernetes Metrics Server on GitHub. The Met docs.aws.amazon.com * cAdvi.. 2023. 5. 18.
[AWS] EKS monitoring - 4주차 -Container Insights metrics in Amazon CloudWatch & Fluent Bit (Logs) CCI : CloudWatch Container Insight의 줄임말이며, 노드에 CW agent, Fluent bit를 daemonset으로 배치하여 로그를 수집한다. k8s에 메트릭 서비와 비슷한 것 같다. Fluent bit : as a DaemonSet to send logs to CloudWatch Logs) Integration in CloudWatch Container Insights for EKS - Docs Blog Fluentd TS 수집 방법: 플루언트비트 Fluent Bit 컨테이너를 데몬셋으로 동작시키고, 아래 3가지 종류의 로그를 CloudWatch Logs 에 전송 /aws/containerinsights/Cluster_Name/application : 로그 소스(All lo.. 2023. 5. 18.
반응형