Home

0

쿠버네티스 - ReadinessProbe & LivenessProbe

목차 쿠버네티스 - Namespace 쿠버네티스 - Ingress Post not found: k8s/deployment/deployment Post not found: k8s/replicaset/replicaset 쿠버네티스 - Node 쿠버네티스 - Pod Post not found: k8s/k8s Pod Pod 는 쿠버네티스에서 관리하는 가장 작은 배포 단위 쿠버네티스는 Pod 을 이용해 Container 를 관리 한다. Pod 는 단일 Node 에서 실행되며 각각의 Pod 는 고유한 IP 와 Host 이름을 가지고 있다. 쿠버네티스는 Pod 을 배포 하고 Pod 안에 한개 이상의 컨테이너가 존재한다. Pod 내 Container는 모두 동일한 Host 에서 실행되며 Network 와 저장소를 공유한다. apiVersion: v1kind: Podmetadata: name: echo labels: app: echospec: containers: - name: app image: ghcr.io/subicura/echo:v1 다중 컨테이너

0

EKS - Cluster Autoscaler

목차 EKS - Cluster Autoscaler EKS - EFS CSI Driver 설치 EKS - EBS CSI Driver 설치 EKS - ALB Controller 를 활용한 NLB 생성 EKS - ALB Controller 설치 EKS - Cluster Access 문제 EKS - NodeGroup 생성 EKS - eksctl 로 클러스터 생성 및 삭제 EKS (Elastic Kubernetes Service) 참고 https://github.com/kubernetes/autoscaler https://docs.aws.amazon.com/ko_kr/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "autoscaling:DescribeAutoScalingGroups", "autoscaling:DescribeAutoScalingInstances", "autoscaling:DescribeLaunchConfigurations", "autoscaling:DescribeScalingActivities", "autoscaling:DescribeTags", "ec2:DescribeInstanceTypes", "ec2:DescribeLaunchTemplateVersions" ], "Resource": ["*"] }, { "Effect": "Allow", "Action": [ "autoscaling:SetDesiredCapacity", "autoscaling:TerminateInstanceInAutoScalingGroup", "ec2:DescribeImages", "ec2:GetInstanceTypesFromInstanceRequirements", "eks:DescribeNodegroup" ], "Resource": ["*"] } ]} helm repo add autoscaler https://kubernetes.github.io/autoscaler helm show values autoscaler/cluster-autoscaler 적용 대상 node에는 아래의 tag가 달려야 한다. k8s.io/cluster-autoscaler/skcc-dev-floot-eks: ownedk8s.io/cluster-autoscaler/enabled: true

0

EKS - EFS CSI Driver 설치

목차 EKS - Cluster Autoscaler EKS - EFS CSI Driver 설치 EKS - EBS CSI Driver 설치 EKS - ALB Controller 를 활용한 NLB 생성 EKS - ALB Controller 설치 EKS - Cluster Access 문제 EKS - NodeGroup 생성 EKS - eksctl 로 클러스터 생성 및 삭제 EKS (Elastic Kubernetes Service) 참고 https://aws.amazon.com/ko/blogs/tech/persistent-storage-for-kubernetes/ EFS CSI Driver 설치를 위한 EKS 내 Service Account 생성curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-efs-csi-driver/master/docs/iam-policy-example.json aws iam create-policy \ --policy-name AmazonEKS_EFS_CSI_Driver_Policy \ --policy-document file://iam-policy-example.json eksctl create iamserviceaccount \ --cluster my-cluster \ --namespace kube-system \ --name efs-csi-controller-sa \ --attach-policy-arn arn:aws:iam::<111122223333>:policy/AmazonEKS_EFS_CSI_Driver_Policy \ --approve \ --region <region-code> EBS CSI Driver 설치

0

쿠버네티스 - k9s

목차 Post not found: k8s/namespace Post not found: k8s/ingress Post not found: k8s/deployment Post not found: k8s/replicaset Post not found: k8s/node Post not found: k8s/pod

0

쿠버네티스 - Resource 제한

목차 Post not found: k8s/namespace Post not found: k8s/ingress Post not found: k8s/deployment Post not found: k8s/replicaset Post not found: k8s/node Post not found: k8s/pod ResourcePod의 spec에서 resources 필드를 통해 리소스를 제한할 수 있습니다. resources 필드는 limits 와 requests 로 구성됩니다. limits는 Pod가 사용할 수 있는 최대 리소스 양을 설정하고, requests는 Pod가 최소한으로 필요로 하는 리소스 양을 설정합니다. apiVersion: v1kind: Podmetadata: name: my-podspec: containers: - name: my-container image: nginx resources: limits: cpu: "1" memory: "512Mi" requests: cpu: "500m" memory: "256Mi"

0

EKS - EBS CSI Driver 설치

목차 EKS - Cluster Autoscaler EKS - EFS CSI Driver 설치 EKS - EBS CSI Driver 설치 EKS - ALB Controller 를 활용한 NLB 생성 EKS - ALB Controller 설치 EKS - Cluster Access 문제 EKS - NodeGroup 생성 EKS - eksctl 로 클러스터 생성 및 삭제 EKS (Elastic Kubernetes Service) 참고 https://aws.amazon.com/ko/blogs/tech/persistent-storage-for-kubernetes/ EBS CSI Driver 설치를 위한 EKS 내 Service Account 생성eksctl create iamserviceaccount \ --name ebs-csi-controller-sa \ --namespace kube-system \ --cluster <Cluste 이름> \ --attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \ --approve \ --role-only \ --role-name AmazonEKS_EBS_CSI_DriverRole EBS CSI Driver 설치aws eks describe-addon-versions --addon-name aws-ebs-csi-driver eksctl create addon \ --name aws-ebs-csi-driver \ --cluster <Cluste 이름> \ --service-account-role-arn arn:aws:iam::<AWS 계정 ID>:role/AmazonEKS_EBS_CSI_DriverRole \ --force

0

EKS - ALB Controller 를 활용한 NLB 생성

목차 EKS - Cluster Autoscaler EKS - EFS CSI Driver 설치 EKS - EBS CSI Driver 설치 EKS - ALB Controller 를 활용한 NLB 생성 EKS - ALB Controller 설치 EKS - Cluster Access 문제 EKS - NodeGroup 생성 EKS - eksctl 로 클러스터 생성 및 삭제 EKS (Elastic Kubernetes Service) 참고 https://docs.aws.amazon.com/ko_kr/eks/latest/userguide/network-load-balancing.html apiVersion: v1kind: Servicemetadata: name: nlb-sample-service namespace: nlb-sample-app 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 service.beta.kubernetes.io/aws-load-balancer-name: skcc-prd-vitality-dx-nlb-ftp service.beta.kubernetes.io/subnets: <Public Subnet1 ID>, <Public Subnet2 ID>spec: ports: - port: 80 targetPort: 80 protocol: TCP type: LoadBalancer selector: app: nginx apiVersion: apps/v1kind: Deploymentmetadata: name: nlb-sample-app namespace: nlb-sample-appspec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: public.ecr.aws/nginx/nginx:1.21 ports: - name: tcp containerPort: 80

0

EKS - ALB Controller 설치

목차 EKS - Cluster Autoscaler EKS - EFS CSI Driver 설치 EKS - EBS CSI Driver 설치 EKS - ALB Controller 를 활용한 NLB 생성 EKS - ALB Controller 설치 EKS - Cluster Access 문제 EKS - NodeGroup 생성 EKS - eksctl 로 클러스터 생성 및 삭제 EKS (Elastic Kubernetes Service) 참고 https://docs.aws.amazon.com/ko_kr/eks/latest/userguide/aws-load-balancer-controller.html IAM policy & role 생성curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.7/docs/install/iam_policy.json aws iam create-policy \ --policy-name AWSLoadBalancerControllerIAMPolicy \ --policy-document file://iam_policy.json ServiceAccount 생성eksctl create iamserviceaccount \ --cluster=my-cluster \ --namespace=kube-system \ --name=aws-load-balancer-controller \ # 원하는 Service Account 이름으로 변경해도 된다 --role-name AmazonEKSLoadBalancerControllerRole \ --attach-policy-arn=arn:aws:iam::111122223333:policy/AWSLoadBalancerControllerIAMPolicy \ --approve

0

EKS - Cluster Access 문제

목차 EKS - Cluster Autoscaler EKS - EFS CSI Driver 설치 EKS - EBS CSI Driver 설치 EKS - ALB Controller 를 활용한 NLB 생성 EKS - ALB Controller 설치 EKS - Cluster Access 문제 EKS - NodeGroup 생성 EKS - eksctl 로 클러스터 생성 및 삭제 EKS (Elastic Kubernetes Service) Error 현재 사용자 또는 역할이 이 EKS Cluster 에 있는 Kubenetes 객체에 엑세스 할 수 없습니다.EKS Dashboard 에서 다음과 같이 문구가 뜨면서 Kubernetes 객체에 정상적으로 Access 하지 못하는 문제가 있다. 다음과 같이 에러가 발생하는 이유는 생성한 클러스터 내부 ConfigMap의 aws-auth에 현재 사용자 또는 역할이 없어 AWS Console에서 확인이 안되는 것이다. 1. ARN 확인 2. ConfigMap 수정다음 명령어를 통해 aws-auth ConfigMap 에 접근해 mapUsers 를 추가 해주도록 하자.

0

EKS - NodeGroup 생성

목차 EKS - Cluster Autoscaler EKS - EFS CSI Driver 설치 EKS - EBS CSI Driver 설치 EKS - ALB Controller 를 활용한 NLB 생성 EKS - ALB Controller 설치 EKS - Cluster Access 문제 EKS - NodeGroup 생성 EKS - eksctl 로 클러스터 생성 및 삭제 EKS (Elastic Kubernetes Service) 참고 UserData 생성 https://docs.aws.amazon.com/ko_kr/eks/latest/userguide/launch-templates.html#launch-template-custom-ami https://eksctl.io/usage/managing-nodegroups/ https://kim-dragon.tistory.com/54 1. LauchTemplate 생성1. UserData 생성을 위한 EKS Cluster 정보 확인aws eks describe-cluster 명령어를 이용해 필요한 EKS 클러스터의 정보를 가져오도록 한다. 클러스터 Certificate Authority 확인 aws eks describe-cluster \ --query "cluster.certificateAuthority.data" \ --output text \ --name [클러스터 이름] \ --region [지역] \ --profile [aws-profile]