Amazon EKS Troubleshooting
最終更新: July 3, 2026
Amazon EKS clusters を運用していると、さまざまな問題が発生する可能性があります。このドキュメントでは、EKS clusters で発生し得る一般的な問題とその解決策を示します。
Table of Contents
- Troubleshooting Basics
- Cluster Creation and Management Issues
- Networking Issues
- Node and Pod Issues
- IAM and Authentication Issues
- Storage Issues
- Logging and Monitoring Issues
- Performance Issues
- Upgrade Issues
- Common Error Messages and Solutions
Troubleshooting Basics
Troubleshooting Approach
EKS cluster の問題を効果的に troubleshoot するための体系的なアプローチ:
- 問題の特定: 問題の症状と影響を明確に特定します。
- 情報の収集: 関連する logs、events、metrics を収集します。
- 分析: 収集した情報を分析し、root cause を特定します。
- 解決: 適切な解決策を適用します。
- 検証: 問題が解決されたことを確認します。
- 文書化: 将来の参照のために問題と解決策を文書化します。
Essential Tools and Commands
EKS troubleshooting に必要な tools と commands:
AWS CLI
AWS CLI を使用して EKS cluster 情報を確認します:
# List EKS clusters
aws eks list-clusters
# Check cluster details
aws eks describe-cluster --name my-cluster
# List node groups
aws eks list-nodegroups --cluster-name my-cluster
# Check node group details
aws eks describe-nodegroup --cluster-name my-cluster --nodegroup-name my-nodegroupkubectl
kubectl を使用して Kubernetes resources を確認します:
# Check node status
kubectl get nodes
kubectl describe node <node-name>
# Check pod status
kubectl get pods --all-namespaces
kubectl describe pod <pod-name> -n <namespace>
# Check service status
kubectl get services --all-namespaces
kubectl describe service <service-name> -n <namespace>
# Check events
kubectl get events --all-namespaces --sort-by='.lastTimestamp'
# Check logs
kubectl logs <pod-name> -n <namespace>
kubectl logs <pod-name> -n <namespace> -c <container-name>eksctl
eksctl を使用して EKS clusters を管理します:
# List clusters
eksctl get clusters
# List node groups
eksctl get nodegroup --cluster my-cluster
# Enable cluster logging
eksctl utils update-cluster-logging --enable-types all --cluster my-cluster --approveAWS CloudWatch
CloudWatch を使用して EKS cluster の logs と metrics を確認します:
# Check CloudWatch log groups
aws logs describe-log-groups --log-group-name-prefix /aws/eks/my-cluster
# Check CloudWatch log streams
aws logs describe-log-streams --log-group-name /aws/eks/my-cluster/cluster
# Check CloudWatch log events
aws logs get-log-events --log-group-name /aws/eks/my-cluster/cluster --log-stream-name <log-stream-name>Log Collection and Analysis
EKS Control Plane Logs
EKS control plane logs を有効化して確認します:
# Enable control plane logs
aws eks update-cluster-config \
--name my-cluster \
--logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}'
# Check logs in CloudWatch
aws logs get-log-events \
--log-group-name /aws/eks/my-cluster/cluster \
--log-stream-name kube-apiserver-<timestamp>Node Logs
Node logs を確認します:
# Connect to node using SSM
aws ssm start-session --target <instance-id>
# Check node logs
sudo journalctl -u kubelet
# Check container runtime logs
sudo journalctl -u docker
sudo journalctl -u containerdPod Logs
Pod logs を確認します:
# Check pod logs
kubectl logs <pod-name> -n <namespace>
# Check previous pod logs
kubectl logs <pod-name> -n <namespace> --previous
# Check specific container logs
kubectl logs <pod-name> -n <namespace> -c <container-name>
# Stream logs
kubectl logs -f <pod-name> -n <namespace>Diagnostic Information Collection
Cluster Diagnostic Information
Cluster diagnostic information を収集します:
# Collect cluster info
kubectl cluster-info dump > cluster-info.txt
# Collect node info
kubectl describe nodes > nodes-info.txt
# Collect pod info
kubectl get pods --all-namespaces -o wide > pods-info.txt
kubectl describe pods --all-namespaces > pods-desc-info.txt
# Collect service info
kubectl get services --all-namespaces -o wide > services-info.txt
kubectl describe services --all-namespaces > services-desc-info.txtSystem Resource Information
System resource information を収集します:
# Check node resource usage
kubectl top nodes
# Check pod resource usage
kubectl top pods --all-namespaces
# Check node disk usage
kubectl debug node/<node-name> -it --image=busybox -- df -hNetwork Diagnostics
Network diagnostic information を収集します:
# Check network policies
kubectl get networkpolicies --all-namespaces
# Check DNS
kubectl run dnsutils --image=tutum/dnsutils --restart=Never -- sleep 3600
kubectl exec -it dnsutils -- nslookup kubernetes.default
# Check network connectivity
kubectl run netshoot --image=nicolaka/netshoot --restart=Never -- sleep 3600
kubectl exec -it netshoot -- ping <target-ip>
kubectl exec -it netshoot -- traceroute <target-ip>Cluster Creation and Management Issues
Cluster Creation Failure
Common Causes
EKS cluster 作成失敗の一般的な原因:
- IAM 権限不足: cluster を作成する IAM user または role に必要な権限がありません
- Service Quota 超過: EKS clusters または関連 resources(例: VPC、subnets)の quota を超過しています
- Network Configuration Issues: VPC、subnet、または security group の設定エラー
- Resource Name Conflict: すでに使用中の cluster names または resource names を使用しています
- AWS Service Availability Issues: EKS または関連 services の availability issues
Troubleshooting Steps
- IAM Permissions を確認:
# Check IAM permissions
aws sts get-caller-identity
# Check required IAM policies
aws iam list-attached-role-policies --role-name <role-name>- Service Quotas を確認:
# Check EKS cluster quota
aws service-quotas get-service-quota --service-code eks --quota-code L-1194D53C
# Check VPC quota
aws service-quotas get-service-quota --service-code vpc --quota-code L-F678F1CE- Network Configuration を確認:
# Check VPC
aws ec2 describe-vpcs --vpc-ids <vpc-id>
# Check subnets
aws ec2 describe-subnets --subnet-ids <subnet-id-1> <subnet-id-2>
# Check routing tables
aws ec2 describe-route-tables --filters "Name=vpc-id,Values=<vpc-id>"
# Check security groups
aws ec2 describe-security-groups --group-ids <security-group-id>- CloudTrail Logs を確認:
# Check CloudTrail events
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateCluster- AWS Service Status を確認:
AWS Service Status Dashboard (https://status.aws.amazon.com/) で EKS と関連 services の状態を確認します。
Common Solutions
- IAM Permissions を追加:
# Add IAM policy for EKS cluster management
aws iam attach-role-policy \
--role-name <role-name> \
--policy-arn arn:aws:iam::aws:policy/AmazonEKSClusterPolicy- Service Quota Increase をリクエスト:
# Request service quota increase
aws service-quotas request-service-quota-increase \
--service-code eks \
--quota-code L-1194D53C \
--desired-value <new-value>- Network Configuration を変更:
# Add subnet tags
aws ec2 create-tags \
--resources <subnet-id> \
--tags Key=kubernetes.io/cluster/<cluster-name>,Value=shared
# Add security group rules
aws ec2 authorize-security-group-ingress \
--group-id <security-group-id> \
--protocol tcp \
--port 443 \
--cidr <cidr-block>- 別の Region で試行:
# Create cluster in different region
aws eks create-cluster \
--region <different-region> \
--name my-cluster \
--role-arn <role-arn> \
--resources-vpc-config subnetIds=<subnet-id-1>,<subnet-id-2>,securityGroupIds=<security-group-id>Cluster Endpoint Access Issues
Common Causes
EKS cluster endpoint access issues の一般的な原因:
- Network Access Restriction: cluster endpoint への network access restrictions
- Authentication Issues: cluster の authentication issues
- kubeconfig Configuration Error: 不正な kubeconfig configuration
- API Server Availability Issues: API server availability issues
Troubleshooting Steps
- Cluster Endpoint を確認:
# Check cluster endpoint
aws eks describe-cluster --name my-cluster --query "cluster.endpoint"
# Test endpoint access
curl -k <cluster-endpoint>- Cluster Endpoint Access Policy を確認:
# Check cluster endpoint access policy
aws eks describe-cluster --name my-cluster --query "cluster.resourcesVpcConfig.endpointPublicAccess"
aws eks describe-cluster --name my-cluster --query "cluster.resourcesVpcConfig.endpointPrivateAccess"
aws eks describe-cluster --name my-cluster --query "cluster.resourcesVpcConfig.publicAccessCidrs"- kubeconfig Configuration を確認:
# Check kubeconfig configuration
cat ~/.kube/config
# Update kubeconfig
aws eks update-kubeconfig --name my-cluster --region <region>- Authentication を確認:
# Check AWS CLI credentials
aws sts get-caller-identity
# Test kubectl authentication
kubectl auth can-i get podsCommon Solutions
- Cluster Endpoint Access Policy を変更:
# Enable public endpoint access
aws eks update-cluster-config \
--name my-cluster \
--resources-vpc-config endpointPublicAccess=true,publicAccessCidrs=["0.0.0.0/0"]
# Enable private endpoint access
aws eks update-cluster-config \
--name my-cluster \
--resources-vpc-config endpointPrivateAccess=true- kubeconfig を再生成:
# Regenerate kubeconfig
aws eks update-kubeconfig --name my-cluster --region <region>- IAM Authentication を設定:
# Check aws-auth ConfigMap
kubectl describe configmap aws-auth -n kube-system
# Update aws-auth ConfigMap
eksctl create iamidentitymapping \
--cluster my-cluster \
--arn <iam-role-or-user-arn> \
--username <username> \
--group system:masters- VPC Endpoint を作成:
# Create VPC endpoint for EKS
aws ec2 create-vpc-endpoint \
--vpc-id <vpc-id> \
--service-name com.amazonaws.<region>.eks \
--vpc-endpoint-type Interface \
--subnet-ids <subnet-id-1> <subnet-id-2> \
--security-group-ids <security-group-id>- CloudShell 経由の One-Click Cluster Access を使用 (released April 30, 2026):
local kubeconfig setup や network access issues により cluster access が妨げられている場合、EKS console は直接的な代替手段を提供します。cluster list で Connect をクリックすると、その cluster 用に kubectl が事前設定された AWS CloudShell が自動的に起動するため、browser からすぐに troubleshooting を開始できます — local kubectl installation、AWS CLI credential setup、kubeconfig configuration は不要です。public または private API endpoints のいずれの clusters もサポートし、すべての regions で利用でき、既存の CloudShell/EKS charges 以外の追加コストは発生しません。(Source: Amazon EKS one-click cluster access)
Cluster Deletion Issues
Common Causes
EKS cluster 削除 issues の一般的な原因:
- Resource Dependencies: cluster に依存する resources がまだ存在しています
- IAM 権限不足: cluster を削除する IAM user または role に必要な権限がありません
- Resource Deletion Failure: cluster resources の削除に失敗しています
Troubleshooting Steps
- Cluster Status を確認:
# Check cluster status
aws eks describe-cluster --name my-cluster --query "cluster.status"- Cluster Resources を確認:
# Check node groups
aws eks list-nodegroups --cluster-name my-cluster
# Check Fargate profiles
aws eks list-fargate-profiles --cluster-name my-cluster
# Check add-ons
aws eks list-addons --cluster-name my-cluster- CloudTrail Logs を確認:
# Check CloudTrail events
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=DeleteClusterCommon Solutions
- 依存 Resources を削除:
# Delete node groups
aws eks delete-nodegroup --cluster-name my-cluster --nodegroup-name <nodegroup-name>
# Delete Fargate profiles
aws eks delete-fargate-profile --cluster-name my-cluster --fargate-profile-name <profile-name>
# Delete add-ons
aws eks delete-addon --cluster-name my-cluster --addon-name <addon-name>- Force Delete:
# Force delete using eksctl
eksctl delete cluster --name my-cluster --force- Manual Resource Cleanup:
# Delete load balancers
kubectl delete services --all --all-namespaces
# Delete PVCs
kubectl delete pvc --all --all-namespaces
# Delete namespaces
kubectl delete namespaces --all --ignore-not-found=true- AWS Resource Cleanup:
# Delete ELBs
aws elb describe-load-balancers | jq -r '.LoadBalancerDescriptions[].LoadBalancerName' | xargs -I {} aws elb delete-load-balancer --load-balancer-name {}
# Delete NLB/ALBs
aws elbv2 describe-load-balancers | jq -r '.LoadBalancers[].LoadBalancerArn' | xargs -I {} aws elbv2 delete-load-balancer --load-balancer-arn {}
# Delete security groups
aws ec2 describe-security-groups --filters "Name=tag:kubernetes.io/cluster/<cluster-name>,Values=owned" | jq -r '.SecurityGroups[].GroupId' | xargs -I {} aws ec2 delete-security-group --group-id {}Networking Issues
Networking issues は EKS clusters で最も一般的な問題の一つです。このセクションでは、一般的な networking issues とその解決策を扱います。
Pod-to-Pod Communication Issues
Common Causes
pod-to-pod communication issues の一般的な原因:
- Network Policies: pod-to-pod communication をブロックする制限的な network policies
- Security Group Rules: pod-to-pod communication をブロックする制限的な security group rules
- CNI Plugin Issues: CNI plugin configuration または version issues
- Pod CIDR Conflict: Pod CIDR range conflicts
- MTU Mismatch: network interfaces 間の MTU mismatch
Troubleshooting Steps
- Network Policies を確認:
# Check network policies
kubectl get networkpolicies --all-namespaces
kubectl describe networkpolicy <networkpolicy-name> -n <namespace>- Security Group Rules を確認:
# Check node security groups
aws ec2 describe-instances \
--filters "Name=tag:eks:cluster-name,Values=my-cluster" \
--query "Reservations[*].Instances[*].SecurityGroups[*]" \
--output text
# Check security group rules
aws ec2 describe-security-group-rules \
--filters "Name=group-id,Values=<security-group-id>"- CNI Plugin を確認:
# Check CNI plugin version
kubectl describe daemonset aws-node -n kube-system | grep Image
# Check CNI plugin configuration
kubectl describe configmap aws-node -n kube-system- Pod CIDR を確認:
# Check pod CIDR
kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}'
# Check pod IPs
kubectl get pods -o wide --all-namespaces- MTU を確認:
# Check node MTU
kubectl debug node/<node-name> -it --image=busybox -- ifconfig
# Check CNI MTU
kubectl describe configmap aws-node -n kube-system | grep MTUCommon Solutions
- Network Policies を変更:
# Create allow network policy
cat <<EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-all
namespace: <namespace>
spec:
podSelector: {}
ingress:
- {}
egress:
- {}
policyTypes:
- Ingress
- Egress
EOF- Security Group Rules を変更:
# Add node-to-node communication rule
aws ec2 authorize-security-group-ingress \
--group-id <security-group-id> \
--protocol all \
--source-group <security-group-id>- CNI Plugin を更新:
# Update CNI plugin
aws eks update-addon \
--cluster-name my-cluster \
--addon-name vpc-cni \
--addon-version <latest-version> \
--resolve-conflicts PRESERVE- CNI Configuration を変更:
# Modify CNI MTU configuration
kubectl set env daemonset aws-node -n kube-system AWS_VPC_ENI_MTU=1500- Pods を再起動:
# Restart pods
kubectl delete pod <pod-name> -n <namespace>Service Access Issues
Common Causes
service access issues の一般的な原因:
- Service Selector Mismatch: Service selector が pod labels と一致しません
- Endpoint Issues: Service endpoints が作成されていません
- Pod Status Issues: Pods が ready ではありません
- Service Port Mismatch: Service port が pod port と一致しません
- kube-proxy Issues: kube-proxy configuration または status issues
Troubleshooting Steps
- Service と Pods を確認:
# Check service
kubectl get services -n <namespace>
kubectl describe service <service-name> -n <namespace>
# Check pods
kubectl get pods -l <service-selector> -n <namespace>
kubectl describe pod <pod-name> -n <namespace>- Endpoints を確認:
# Check endpoints
kubectl get endpoints <service-name> -n <namespace>
kubectl describe endpoints <service-name> -n <namespace>- Pod Status を確認:
# Check pod status
kubectl get pods -l <service-selector> -n <namespace> -o wide
kubectl describe pod <pod-name> -n <namespace>- Service Ports を確認:
# Check service ports
kubectl get service <service-name> -n <namespace> -o jsonpath='{.spec.ports[*]}'
# Check pod ports
kubectl get pod <pod-name> -n <namespace> -o jsonpath='{.spec.containers[*].ports[*]}'- kube-proxy を確認:
# Check kube-proxy status
kubectl get pods -n kube-system -l k8s-app=kube-proxy
kubectl logs -n kube-system -l k8s-app=kube-proxyCommon Solutions
- Service Selector を変更:
# Modify service selector
kubectl patch service <service-name> -n <namespace> -p '{"spec":{"selector":{"app":"<app-label>"}}}'- Pod Labels を変更:
# Modify pod labels
kubectl label pod <pod-name> -n <namespace> app=<app-label> --overwrite- Service Ports を変更:
# Modify service ports
kubectl patch service <service-name> -n <namespace> -p '{"spec":{"ports":[{"port":80,"targetPort":8080}]}}'- kube-proxy を再起動:
# Restart kube-proxy
kubectl delete pod -n kube-system -l k8s-app=kube-proxy- Service を再作成:
# Delete service
kubectl delete service <service-name> -n <namespace>
# Create service
kubectl expose deployment <deployment-name> -n <namespace> --port=80 --target-port=8080Load Balancer Issues
Common Causes
load balancer issues の一般的な原因:
- Missing Subnet Tags: load balancer subnet tags が不足しています
- Security Group Rule Restrictions: 制限的な security group rules
- Health Check Failure: Load balancer health check failures
- Service Annotation Issues: 不正な service annotations
- Quota Exceeded: Load balancer quota exceeded
Troubleshooting Steps
- Service Status を確認:
# Check service status
kubectl get service <service-name> -n <namespace>
kubectl describe service <service-name> -n <namespace>- Load Balancer Status を確認:
# Check load balancer ARN
aws elbv2 describe-load-balancers \
--query "LoadBalancers[?contains(DNSName, '<load-balancer-dns>')].LoadBalancerArn" \
--output text
# Check load balancer status
aws elbv2 describe-load-balancer-attributes \
--load-balancer-arn <load-balancer-arn>
# Check target group health
aws elbv2 describe-target-health \
--target-group-arn <target-group-arn>- Subnet Tags を確認:
# Check subnet tags
aws ec2 describe-subnets \
--subnet-ids <subnet-id-1> <subnet-id-2> \
--query "Subnets[*].{ID:SubnetId,Tags:Tags}"- Security Group Rules を確認:
# Check security group rules
aws ec2 describe-security-group-rules \
--filters "Name=group-id,Values=<security-group-id>"- Service Events を確認:
# Check service events
kubectl get events -n <namespace> --field-selector involvedObject.name=<service-name>Common Solutions
- Subnet Tags を追加:
# Add public subnet tags
aws ec2 create-tags \
--resources <subnet-id-1> <subnet-id-2> \
--tags Key=kubernetes.io/role/elb,Value=1
# Add private subnet tags
aws ec2 create-tags \
--resources <subnet-id-1> <subnet-id-2> \
--tags Key=kubernetes.io/role/internal-elb,Value=1- Security Group Rules を追加:
# Add inbound rule
aws ec2 authorize-security-group-ingress \
--group-id <security-group-id> \
--protocol tcp \
--port 80 \
--cidr 0.0.0.0/0
# Add outbound rule
aws ec2 authorize-security-group-egress \
--group-id <security-group-id> \
--protocol tcp \
--port 80 \
--cidr 0.0.0.0/0- Service Annotations を変更:
# Add internal load balancer annotation
kubectl annotate service <service-name> -n <namespace> \
service.beta.kubernetes.io/aws-load-balancer-internal="true" \
--overwrite
# Add load balancer type annotation
kubectl annotate service <service-name> -n <namespace> \
service.beta.kubernetes.io/aws-load-balancer-type="nlb" \
--overwrite- Service を再作成:
# Backup service
kubectl get service <service-name> -n <namespace> -o yaml > service-backup.yaml
# Delete service
kubectl delete service <service-name> -n <namespace>
# Create service
kubectl apply -f service-backup.yaml- Load Balancer を手動作成:
# Create load balancer
aws elbv2 create-load-balancer \
--name <load-balancer-name> \
--type application \
--subnets <subnet-id-1> <subnet-id-2> \
--security-groups <security-group-id>DNS Issues
Common Causes
DNS issues の一般的な原因:
- CoreDNS Pod Issues: CoreDNS pods が running でない、または ready でありません
- kube-dns Service Issues: kube-dns service が適切に設定されていません
- DNS Policy Issues: Pod DNS policy が適切に設定されていません
- Network Policy Restrictions: DNS traffic をブロックする network policies
- CoreDNS Configuration Issues: CoreDNS configuration errors
Troubleshooting Steps
- CoreDNS Pods を確認:
# Check CoreDNS pods
kubectl get pods -n kube-system -l k8s-app=kube-dns
kubectl describe pod -n kube-system -l k8s-app=kube-dns- kube-dns Service を確認:
# Check kube-dns service
kubectl get service kube-dns -n kube-system
kubectl describe service kube-dns -n kube-system- CoreDNS Configuration を確認:
# Check CoreDNS configuration
kubectl get configmap coredns -n kube-system -o yaml- DNS Resolution をテスト:
# Create DNS resolution test pod
kubectl run dnsutils --image=tutum/dnsutils --restart=Never -- sleep 3600
# Test DNS resolution
kubectl exec -it dnsutils -- nslookup kubernetes.default
kubectl exec -it dnsutils -- nslookup <service-name>.<namespace>.svc.cluster.local- DNS Debugging:
# Create DNS debugging pod
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: dnsutils
namespace: default
spec:
containers:
- name: dnsutils
image: tutum/dnsutils
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
restartPolicy: Always
EOF
# DNS debugging
kubectl exec -it dnsutils -- cat /etc/resolv.conf
kubectl exec -it dnsutils -- dig kubernetes.default.svc.cluster.localCommon Solutions
- CoreDNS を再起動:
# Restart CoreDNS pods
kubectl delete pod -n kube-system -l k8s-app=kube-dns- CoreDNS Configuration を変更:
# Modify CoreDNS configuration
kubectl edit configmap coredns -n kube-system- CoreDNS を Scale Up:
# Scale up CoreDNS
kubectl scale deployment coredns -n kube-system --replicas=3- DNS Policy を変更:
# Modify DNS policy
kubectl patch deployment <deployment-name> -n <namespace> -p '{"spec":{"template":{"spec":{"dnsPolicy":"ClusterFirst"}}}}'- CoreDNS を更新:
# Update CoreDNS
aws eks update-addon \
--cluster-name my-cluster \
--addon-name coredns \
--addon-version <latest-version> \
--resolve-conflicts PRESERVEVPC CNI Issues
Common Causes
VPC CNI issues の一般的な原因:
- IP Address Exhaustion: nodes に割り当てられた IP addresses が不足しています
- ENI Limit Reached: Node ENI (Elastic Network Interface) limit reached
- CNI Version Issues: 古い、または互換性のない CNI version
- CNI Configuration Errors: 不正な CNI configuration
- Permission Issues: CNI の IAM permissions が不足しています
Troubleshooting Steps
- VPC CNI Pods を確認:
# Check VPC CNI pods
kubectl get pods -n kube-system -l k8s-app=aws-node
kubectl describe pod -n kube-system -l k8s-app=aws-node- VPC CNI Logs を確認:
# Check VPC CNI logs
kubectl logs -n kube-system -l k8s-app=aws-node- IP Address Usage を確認:
# Check IP address usage
kubectl exec -n kube-system -l k8s-app=aws-node -- curl -s http://localhost:61679/v1/enis | jq- CNI Configuration を確認:
# Check CNI configuration
kubectl describe daemonset aws-node -n kube-system | grep -A 10 Environment- IAM Permissions を確認:
# Check node IAM role
aws eks describe-nodegroup \
--cluster-name my-cluster \
--nodegroup-name <nodegroup-name> \
--query "nodegroup.nodeRole"
# Check IAM policies
aws iam list-attached-role-policies \
--role-name <node-role-name>Common Solutions
- IP Address Exhaustion を解消:
# Enable prefix delegation
kubectl set env daemonset aws-node -n kube-system ENABLE_PREFIX_DELEGATION=true
# Enable custom networking
kubectl set env daemonset aws-node -n kube-system AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG=true- ENI Limit を増加:
# Update node group with larger instance type
aws eks update-nodegroup-config \
--cluster-name my-cluster \
--nodegroup-name <nodegroup-name> \
--scaling-config desiredSize=<desired-size>,minSize=<min-size>,maxSize=<max-size> \
--update-config maxUnavailable=1- VPC CNI を更新:
# Update VPC CNI
aws eks update-addon \
--cluster-name my-cluster \
--addon-name vpc-cni \
--addon-version <latest-version> \
--resolve-conflicts PRESERVE- CNI Configuration を変更:
# Modify CNI configuration
kubectl set env daemonset aws-node -n kube-system WARM_IP_TARGET=5
kubectl set env daemonset aws-node -n kube-system MINIMUM_IP_TARGET=2- IAM Permissions を追加:
# Add CNI IAM policy
aws iam attach-role-policy \
--role-name <node-role-name> \
--policy-arn arn:aws:iam::aws:policy/AmazonEKS_CNI_PolicyNode and Pod Issues
Node NotReady Issues
Common Causes
node NotReady issues の一般的な原因:
- kubelet Issues: kubelet service が running でない、または errors があります
- Node Network Issues: Node network configuration issues
- Node Resource Exhaustion: Node resource(CPU、memory、disk)の枯渇
- Node Health Check Failure: Node health check failures
- Node Disk Pressure: Node disk space exhaustion
Troubleshooting Steps
- Node Status を確認:
# Check node status
kubectl get nodes
kubectl describe node <node-name>- Node Conditions を確認:
# Check node conditions
kubectl get nodes -o jsonpath='{.items[*].status.conditions}' | jq- kubelet Status を確認:
# Connect to node using SSM
aws ssm start-session --target <instance-id>
# Check kubelet status
sudo systemctl status kubelet
sudo journalctl -u kubelet -n 100- Node Resources を確認:
# Check node resources
kubectl top node <node-name>
# Check disk usage
kubectl debug node/<node-name> -it --image=busybox -- df -h- Node Events を確認:
# Check node events
kubectl get events --field-selector involvedObject.name=<node-name>Common Solutions
- kubelet を再起動:
# Connect to node
aws ssm start-session --target <instance-id>
# Restart kubelet
sudo systemctl restart kubelet- Network Issues を修正:
# Check network configuration
aws ssm start-session --target <instance-id>
sudo cat /etc/cni/net.d/*
sudo systemctl restart containerd- Disk Space を解放:
# Connect to node
aws ssm start-session --target <instance-id>
# Clean up unused images
sudo crictl rmi --prune
# Clean up logs
sudo journalctl --vacuum-time=1d- Node を再起動:
# Reboot EC2 instance
aws ec2 reboot-instances --instance-ids <instance-id>- Node を置換:
# Cordon node
kubectl cordon <node-name>
# Drain node
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data
# Terminate instance
aws ec2 terminate-instances --instance-ids <instance-id>Pod Not Running Issues
Common Causes
pod not running issues の一般的な原因:
- Image Pull Failure: Container image pull failure
- Resource Request Issues: resource requests を満たすための resources が不足しています
- Pod Configuration Error: Pod specification errors
- Scheduling Failure: Pod scheduling failure
- Volume Mount Failure: Volume mount failure
Troubleshooting Steps
- Pod Status を確認:
# Check pod status
kubectl get pod <pod-name> -n <namespace>
kubectl describe pod <pod-name> -n <namespace>- Pod Events を確認:
# Check pod events
kubectl get events -n <namespace> --field-selector involvedObject.name=<pod-name>- Pod Logs を確認:
# Check pod logs
kubectl logs <pod-name> -n <namespace>
kubectl logs <pod-name> -n <namespace> --previous- Container Status を確認:
# Check container status
kubectl get pod <pod-name> -n <namespace> -o jsonpath='{.status.containerStatuses[*]}'- Scheduling を確認:
# Check pod scheduling
kubectl get pod <pod-name> -n <namespace> -o jsonpath='{.status.conditions[?(@.type=="PodScheduled")]}'Common Solutions
- Image Pull Issues を修正:
# Check image availability
docker pull <image-name>
# Create image pull secret
kubectl create secret docker-registry <secret-name> \
--docker-server=<registry-server> \
--docker-username=<username> \
--docker-password=<password> \
--docker-email=<email> \
-n <namespace>
# Add image pull secret to pod
kubectl patch serviceaccount default -n <namespace> -p '{"imagePullSecrets":[{"name":"<secret-name>"}]}'- Resource Issues を修正:
# Reduce resource requests
kubectl patch deployment <deployment-name> -n <namespace> -p '{"spec":{"template":{"spec":{"containers":[{"name":"<container-name>","resources":{"requests":{"memory":"128Mi","cpu":"100m"}}}]}}}}'- Configuration Errors を修正:
# Check and fix pod specification
kubectl get deployment <deployment-name> -n <namespace> -o yaml > deployment.yaml
# Edit deployment.yaml
kubectl apply -f deployment.yaml- Scheduling Issues を修正:
# Check schedulable nodes
kubectl get nodes -o jsonpath='{.items[?(@.spec.unschedulable!=true)].metadata.name}'
# Remove node taints
kubectl taint nodes <node-name> <taint-key>-- Volume Issues を修正:
# Check PVC status
kubectl get pvc -n <namespace>
kubectl describe pvc <pvc-name> -n <namespace>
# Recreate PVC
kubectl delete pvc <pvc-name> -n <namespace>
kubectl apply -f pvc.yamlResource Constraint Issues
Common Causes
resource constraint issues の一般的な原因:
- Insufficient CPU: CPU resources が不足しています
- Insufficient Memory: memory resources が不足しています
- Insufficient Disk: disk space が不足しています
- Resource Quotas: resource quota limits に到達しています
- Limit Ranges: Container limit ranges を超過しています
Troubleshooting Steps
- Resource Usage を確認:
# Check node resources
kubectl top nodes
# Check pod resources
kubectl top pods -n <namespace>- Resource Quotas を確認:
# Check resource quotas
kubectl get resourcequotas -n <namespace>
kubectl describe resourcequota <quota-name> -n <namespace>- Limit Ranges を確認:
# Check limit ranges
kubectl get limitranges -n <namespace>
kubectl describe limitrange <limitrange-name> -n <namespace>- Pod Resources を確認:
# Check pod resource requests and limits
kubectl get pod <pod-name> -n <namespace> -o jsonpath='{.spec.containers[*].resources}'Common Solutions
- Resource Requests and Limits を調整:
# Adjust resource requests and limits
kubectl patch deployment <deployment-name> -n <namespace> -p '{"spec":{"template":{"spec":{"containers":[{"name":"<container-name>","resources":{"requests":{"memory":"256Mi","cpu":"200m"},"limits":{"memory":"512Mi","cpu":"500m"}}}]}}}}'- Resource Quotas を調整:
# Adjust resource quotas
kubectl patch resourcequota <quota-name> -n <namespace> -p '{"spec":{"hard":{"requests.cpu":"10","requests.memory":"20Gi"}}}'- Node Group を拡張:
# Expand node group
aws eks update-nodegroup-config \
--cluster-name my-cluster \
--nodegroup-name <nodegroup-name> \
--scaling-config desiredSize=<desired-size>,minSize=<min-size>,maxSize=<max-size>- Cluster Autoscaler を有効化:
# Deploy Cluster Autoscaler
kubectl apply -f https://raw.githubusercontent.com/kubernetes/autoscaler/master/cluster-autoscaler/cloudprovider/aws/examples/cluster-autoscaler-autodiscover.yamlIAM and Authentication Issues
Cluster Access Denied
Common Causes
cluster access denied の一般的な原因:
- aws-auth ConfigMap Missing: aws-auth ConfigMap が存在しない、または misconfigured です
- IAM Role Not Mapped: IAM role または user が aws-auth ConfigMap に mapping されていません
- Token Expiration: AWS authentication token が期限切れです
- kubeconfig Misconfiguration: kubeconfig が misconfigured です
Troubleshooting Steps
- AWS Identity を確認:
# Check AWS identity
aws sts get-caller-identity- aws-auth ConfigMap を確認:
# Check aws-auth ConfigMap
kubectl get configmap aws-auth -n kube-system -o yaml- kubeconfig を確認:
# Check kubeconfig
cat ~/.kube/config
kubectl config current-context- Authentication を確認:
# Check authentication
kubectl auth can-i get podsCommon Solutions
- kubeconfig を更新:
# Update kubeconfig
aws eks update-kubeconfig --name my-cluster --region <region>- IAM Identity Mapping を追加:
# Add IAM identity mapping using eksctl
eksctl create iamidentitymapping \
--cluster my-cluster \
--arn <iam-role-or-user-arn> \
--username <username> \
--group system:masters
# Or manually edit aws-auth ConfigMap
kubectl edit configmap aws-auth -n kube-system- aws-auth ConfigMap を作成:
# Create aws-auth ConfigMap
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
- rolearn: <node-role-arn>
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes
- rolearn: <admin-role-arn>
username: admin
groups:
- system:masters
EOF- AWS Credentials を更新:
# Refresh AWS credentials
aws sts get-session-token
aws eks get-token --cluster-name my-clusterIRSA Issues
Common Causes
IRSA issues の一般的な原因:
- OIDC Provider Not Configured: cluster の OIDC provider が設定されていません
- Trust Policy Misconfiguration: IAM role trust policy が misconfigured です
- Service Account Annotation Missing: Service account annotation がありません
- IAM Role Permission Issues: IAM role に必要な permissions がありません
Troubleshooting Steps
- OIDC Provider を確認:
# Check OIDC provider
aws eks describe-cluster --name my-cluster --query "cluster.identity.oidc.issuer"
# List OIDC providers
aws iam list-open-id-connect-providers- Service Account を確認:
# Check service account
kubectl get serviceaccount <service-account-name> -n <namespace> -o yaml- IAM Role を確認:
# Check IAM role trust policy
aws iam get-role --role-name <role-name> --query "Role.AssumeRolePolicyDocument"
# Check IAM role policies
aws iam list-attached-role-policies --role-name <role-name>- Pod Environment Variables を確認:
# Check pod environment variables
kubectl exec -it <pod-name> -n <namespace> -- env | grep AWSCommon Solutions
- OIDC Provider を設定:
# Associate OIDC provider
eksctl utils associate-iam-oidc-provider --cluster my-cluster --approve- Trust Policy を修正:
# Get OIDC provider URL
OIDC_PROVIDER=$(aws eks describe-cluster --name my-cluster --query "cluster.identity.oidc.issuer" --output text | sed -e "s/^https:\/\///")
# Update trust policy
cat > trust-policy.json << EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::<account-id>:oidc-provider/${OIDC_PROVIDER}"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"${OIDC_PROVIDER}:sub": "system:serviceaccount:<namespace>:<service-account-name>"
}
}
}
]
}
EOF
aws iam update-assume-role-policy --role-name <role-name> --policy-document file://trust-policy.json- Service Account Annotation を追加:
# Add service account annotation
kubectl annotate serviceaccount <service-account-name> -n <namespace> \
eks.amazonaws.com/role-arn=<role-arn> \
--overwrite- IAM Permissions を追加:
# Attach IAM policy
aws iam attach-role-policy \
--role-name <role-name> \
--policy-arn <policy-arn>Node Join Failure
Common Causes
node join failure の一般的な原因:
- Node Role Permissions: Node IAM role に必要な permissions がありません
- Security Group Restrictions: security group rules が node-to-control plane communication を妨げています
- Bootstrap Failure: Node bootstrap script failure
Troubleshooting Steps
- Node Group Status を確認:
# Check node group status
aws eks describe-nodegroup --cluster-name my-cluster --nodegroup-name <nodegroup-name>- Node IAM Role を確認:
# Check node IAM role
aws iam get-role --role-name <node-role-name>
aws iam list-attached-role-policies --role-name <node-role-name>- Security Groups を確認:
# Check security groups
aws ec2 describe-security-groups --group-ids <security-group-id>- Node Logs を確認:
# Connect to node using SSM
aws ssm start-session --target <instance-id>
# Check kubelet logs
sudo journalctl -u kubeletCommon Solutions
- Node IAM Permissions を追加:
# Attach required policies
aws iam attach-role-policy \
--role-name <node-role-name> \
--policy-arn arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy
aws iam attach-role-policy \
--role-name <node-role-name> \
--policy-arn arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
aws iam attach-role-policy \
--role-name <node-role-name> \
--policy-arn arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy- Security Group Rules を修正:
# Add required inbound rules
aws ec2 authorize-security-group-ingress \
--group-id <node-security-group-id> \
--protocol tcp \
--port 443 \
--source-group <cluster-security-group-id>
aws ec2 authorize-security-group-ingress \
--group-id <node-security-group-id> \
--protocol tcp \
--port 10250 \
--source-group <cluster-security-group-id>- Bootstrap Script を修正:
# Connect to node
aws ssm start-session --target <instance-id>
# Re-run bootstrap script
sudo /etc/eks/bootstrap.sh my-clusterStorage Issues
EBS Volume Issues
Common Causes
EBS volume issues の一般的な原因:
- CSI Driver Not Installed: EBS CSI driver が install されていません
- IAM Permission Issues: Node IAM role に EBS permissions がありません
- Volume Attachment Failure: Volume attachment が失敗します
- StorageClass Misconfiguration: StorageClass が misconfigured です
Troubleshooting Steps
- CSI Driver を確認:
# Check EBS CSI driver
kubectl get pods -n kube-system -l app=ebs-csi-controller
kubectl describe deployment ebs-csi-controller -n kube-system- PVC と PV を確認:
# Check PVC status
kubectl get pvc -n <namespace>
kubectl describe pvc <pvc-name> -n <namespace>
# Check PV status
kubectl get pv
kubectl describe pv <pv-name>- StorageClass を確認:
# Check StorageClass
kubectl get storageclass
kubectl describe storageclass <storageclass-name>- IAM Permissions を確認:
# Check node IAM role permissions
aws iam list-attached-role-policies --role-name <node-role-name>Common Solutions
- EBS CSI Driver をインストール:
# Install EBS CSI driver using eksctl
eksctl create addon \
--cluster my-cluster \
--name aws-ebs-csi-driver \
--service-account-role-arn <role-arn>- IAM Permissions を追加:
# Attach EBS CSI driver policy
aws iam attach-role-policy \
--role-name <role-name> \
--policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy- StorageClass を作成:
# Create StorageClass
cat <<EOF | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ebs-sc
provisioner: ebs.csi.aws.com
parameters:
type: gp3
fsType: ext4
volumeBindingMode: WaitForFirstConsumer
EOFEFS Volume Issues
Common Causes
EFS volume issues の一般的な原因:
- EFS CSI Driver Not Installed: EFS CSI driver が install されていません
- Security Group Issues: security group rules が EFS access を妨げています
- Mount Target Issues: EFS mount targets が設定されていません
- IAM Permission Issues: Node IAM role に EFS permissions がありません
Troubleshooting Steps
- EFS CSI Driver を確認:
# Check EFS CSI driver
kubectl get pods -n kube-system -l app=efs-csi-controller- EFS File System を確認:
# Check EFS file system
aws efs describe-file-systems --file-system-id <file-system-id>
# Check mount targets
aws efs describe-mount-targets --file-system-id <file-system-id>- Security Groups を確認:
# Check EFS security group
aws ec2 describe-security-groups --group-ids <efs-security-group-id>Common Solutions
- EFS CSI Driver をインストール:
# Install EFS CSI driver
kubectl apply -k "github.com/kubernetes-sigs/aws-efs-csi-driver/deploy/kubernetes/overlays/stable/?ref=release-1.5"- Security Groups を設定:
# Allow NFS traffic
aws ec2 authorize-security-group-ingress \
--group-id <efs-security-group-id> \
--protocol tcp \
--port 2049 \
--source-group <node-security-group-id>- Mount Targets を作成:
# Create mount target
aws efs create-mount-target \
--file-system-id <file-system-id> \
--subnet-id <subnet-id> \
--security-groups <security-group-id>Logging and Monitoring Issues
CloudWatch Issues
Common Causes
CloudWatch issues の一般的な原因:
- CloudWatch Agent Not Installed: CloudWatch agent が install されていません
- IAM Permission Issues: Node IAM role に CloudWatch permissions がありません
- Log Group Configuration Issues: Log group が設定されていません
- Agent Configuration Issues: CloudWatch agent が misconfigured です
Troubleshooting Steps
- CloudWatch Agent を確認:
# Check CloudWatch agent pods
kubectl get pods -n amazon-cloudwatch -l name=cloudwatch-agent- IAM Permissions を確認:
# Check node IAM role permissions
aws iam list-attached-role-policies --role-name <node-role-name>- Log Groups を確認:
# Check log groups
aws logs describe-log-groups --log-group-name-prefix /aws/eks/my-clusterCommon Solutions
- CloudWatch Agent をインストール:
# Install CloudWatch Container Insights
kubectl apply -f https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/quickstart/cwagent-fluentd-quickstart.yaml- IAM Permissions を追加:
# Attach CloudWatch policy
aws iam attach-role-policy \
--role-name <node-role-name> \
--policy-arn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicyPrometheus and Grafana Issues
Common Causes
Prometheus and Grafana issues の一般的な原因:
- Prometheus Not Installed: Prometheus が適切に install されていません
- Scrape Target Issues: Scrape targets が設定されていません
- Storage Issues: Prometheus storage issues
- Grafana Data Source Issues: Grafana data source が misconfigured です
Troubleshooting Steps
- Prometheus Pods を確認:
# Check Prometheus pods
kubectl get pods -n monitoring -l app=prometheus
kubectl logs -n monitoring -l app=prometheus- Prometheus Targets を確認:
# Port forward to Prometheus
kubectl port-forward -n monitoring svc/prometheus-server 9090:80
# Check targets in browser: http://localhost:9090/targets- Grafana Pods を確認:
# Check Grafana pods
kubectl get pods -n monitoring -l app=grafana
kubectl logs -n monitoring -l app=grafanaCommon Solutions
- Helm を使用して Prometheus をインストール:
# Install Prometheus
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install prometheus prometheus-community/prometheus -n monitoring --create-namespace- ServiceMonitor を設定:
# Create ServiceMonitor
cat <<EOF | kubectl apply -f -
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: my-app
namespace: monitoring
spec:
selector:
matchLabels:
app: my-app
endpoints:
- port: metrics
interval: 30s
EOFPerformance Issues
Node Performance Issues
Common Causes
node performance issues の一般的な原因:
- Resource Constraints: CPU または memory が不足しています
- Network Bottlenecks: Network bandwidth limitations
- Disk I/O Issues: Disk I/O bottlenecks
- Instance Type Mismatch: Instance type が workload requirements と一致しません
Troubleshooting Steps
- Node Resource Usage を確認:
# Check node resources
kubectl top nodes
kubectl describe node <node-name>- System Performance を確認:
# Connect to node
aws ssm start-session --target <instance-id>
# Check CPU usage
top
# Check memory usage
free -m
# Check disk I/O
iostat -x 1Common Solutions
- Node Group をスケール:
# Scale node group
aws eks update-nodegroup-config \
--cluster-name my-cluster \
--nodegroup-name <nodegroup-name> \
--scaling-config desiredSize=<size>,minSize=<min>,maxSize=<max>- より大きい Instance Type を使用:
# Create new node group with larger instance type
eksctl create nodegroup \
--cluster my-cluster \
--name <new-nodegroup-name> \
--node-type <larger-instance-type> \
--nodes <node-count>Pod Performance Issues
Common Causes
pod performance issues の一般的な原因:
- Resource Limits: Resource limits が厳しすぎます
- Application Issues: Application performance issues
- Network Issues: Network latency または bandwidth issues
- Storage Issues: Storage performance issues
Troubleshooting Steps
- Pod Resource Usage を確認:
# Check pod resources
kubectl top pods -n <namespace>
kubectl describe pod <pod-name> -n <namespace>- Application Logs を確認:
# Check application logs
kubectl logs <pod-name> -n <namespace>Common Solutions
- Resource Limits を調整:
# Adjust resource limits
kubectl patch deployment <deployment-name> -n <namespace> -p '{"spec":{"template":{"spec":{"containers":[{"name":"<container-name>","resources":{"limits":{"memory":"1Gi","cpu":"1000m"}}}]}}}}'- HPA を有効化:
# Create HPA
kubectl autoscale deployment <deployment-name> -n <namespace> --cpu-percent=70 --min=2 --max=10Upgrade Issues
Cluster Upgrade Issues
Common Causes
cluster upgrade issues の一般的な原因:
- Version Compatibility: 互換性のない Kubernetes versions
- Add-on Compatibility: 新しい version と互換性のない add-ons
- API Deprecation: Deprecated APIs が使用されています
- Custom Resource Issues: CRDs が新しい version と互換性がありません
Troubleshooting Steps
- Current Version を確認:
# Check cluster version
aws eks describe-cluster --name my-cluster --query "cluster.version"
# Check node versions
kubectl get nodes -o wide- Add-on Compatibility を確認:
# Check add-on versions
aws eks describe-addon-versions --kubernetes-version <target-version>- Deprecated APIs を確認:
# Install pluto
brew install fairwindsops/tap/pluto
# Check deprecated APIs
pluto detect-files -d .
pluto detect-helm -ACommon Solutions
- Cluster Control Plane をアップグレード:
# Upgrade cluster
aws eks update-cluster-version \
--name my-cluster \
--kubernetes-version <target-version>- Add-ons をアップグレード:
# Upgrade add-ons
aws eks update-addon \
--cluster-name my-cluster \
--addon-name vpc-cni \
--addon-version <target-version> \
--resolve-conflicts PRESERVE
aws eks update-addon \
--cluster-name my-cluster \
--addon-name coredns \
--addon-version <target-version> \
--resolve-conflicts PRESERVE
aws eks update-addon \
--cluster-name my-cluster \
--addon-name kube-proxy \
--addon-version <target-version> \
--resolve-conflicts PRESERVENode Group Upgrade Issues
Common Causes
node group upgrade issues の一般的な原因:
- AMI Compatibility: AMI が cluster version と互換性がありません
- PodDisruptionBudget: PDB が pod eviction を妨げています
- Node Drain Failure: Node drain failure
- Resource Constraints: new nodes のための resources が不足しています
Troubleshooting Steps
- Node Group Status を確認:
# Check node group status
aws eks describe-nodegroup \
--cluster-name my-cluster \
--nodegroup-name <nodegroup-name>- PodDisruptionBudgets を確認:
# Check PDBs
kubectl get pdb --all-namespaces
kubectl describe pdb <pdb-name> -n <namespace>- Node Drain Status を確認:
# Check node status
kubectl get nodes
kubectl describe node <node-name>Common Solutions
- Node Group を更新:
# Update node group
aws eks update-nodegroup-version \
--cluster-name my-cluster \
--nodegroup-name <nodegroup-name>- PodDisruptionBudget を調整:
# Temporarily modify PDB
kubectl patch pdb <pdb-name> -n <namespace> -p '{"spec":{"minAvailable":0}}'- Node Drain を強制:
# Force drain node
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data --forceCommon Error Messages and Solutions
Cluster Errors
error: You must be logged in to the server (Unauthorized)
原因: cluster の authentication issues。
解決策:
- AWS CLI credentials を確認します
- kubeconfig を再生成します
- aws-auth ConfigMap を確認します
# Check AWS CLI credentials
aws sts get-caller-identity
# Regenerate kubeconfig
aws eks update-kubeconfig --name my-cluster --region <region>Unable to connect to the server: dial tcp: lookup xxx: no such host
原因: DNS resolution issue または cluster endpoint issue。
解決策:
- cluster endpoint を確認します
- DNS configuration を確認します
- network connectivity を確認します
# Check cluster endpoint
aws eks describe-cluster --name my-cluster --query "cluster.endpoint"
# Check DNS resolution
nslookup <cluster-endpoint>Node and Pod Errors
Insufficient pods
原因: Node が pods の最大数に達しています。
解決策:
- nodes を追加します
- より大きい instance types を使用します
- prefix delegation を有効化します
# Check node pod capacity
kubectl describe node <node-name> | grep -A 5 "Capacity"
# Reduce pod resource requests
kubectl patch deployment <deployment-name> -n <namespace> -p '{"spec":{"template":{"spec":{"containers":[{"name":"<container-name>","resources":{"requests":{"memory":"128Mi"}}}]}}}}'CrashLoopBackOff
原因: Container が繰り返し crash して restart しています。
解決策:
- container logs を確認します
- application configuration を確認します
- resource constraints を確認します
# Check container logs
kubectl logs <pod-name> -n <namespace>
kubectl logs <pod-name> -n <namespace> --previousImagePullBackOff
原因: container image を pull できません。
解決策:
- image name と tag を確認します
- image registry accessibility を確認します
- image pull secrets を設定します
# Create image pull secret
kubectl create secret docker-registry <secret-name> \
--docker-server=<registry-server> \
--docker-username=<username> \
--docker-password=<password> \
--docker-email=<email> \
-n <namespace>
# Add secret to service account
kubectl patch serviceaccount <service-account-name> -n <namespace> -p '{"imagePullSecrets":[{"name":"<secret-name>"}]}'Evicted
原因: Node resource pressure により Pod が evicted されました。
解決策:
- node resources を確認します
- pod resource requests and limits を調整します
- node group を scale out します
# Check node resources
kubectl describe node <node-name> | grep -A 10 "Allocated resources"Networking Errors
FailedCreateServiceEndpoints
原因: service endpoints を作成できません。
解決策:
- service selector を確認します
- pod labels を確認します
- pod status を確認します
# Check service selector
kubectl get service <service-name> -n <namespace> -o jsonpath='{.spec.selector}'
# Check pod labels
kubectl get pods -n <namespace> --show-labelsEniLimitExceeded
原因: Node ENI limit を超過しています。
解決策:
- より大きい instance type で node group を更新します
- prefix delegation を有効化します
- custom networking を有効化します
# Enable prefix delegation
kubectl set env daemonset aws-node -n kube-system ENABLE_PREFIX_DELEGATION=trueFailedLoadBalancerCreation
原因: load balancer を作成できません。
解決策:
- subnet tags を確認します
- security group rules を確認します
- service annotations を確認します
# Add subnet tags
aws ec2 create-tags \
--resources <subnet-id-1> <subnet-id-2> \
--tags Key=kubernetes.io/role/elb,Value=1IAM and Authentication Errors
error: You must be logged in to the server (Unauthorized)
原因: cluster の authentication issues。
解決策:
- AWS CLI credentials を確認します
- kubeconfig を再生成します
- aws-auth ConfigMap を確認します
# Check AWS CLI credentials
aws sts get-caller-identity
# Regenerate kubeconfig
aws eks update-kubeconfig --name my-cluster --region <region>error: You must be logged in to the server (the server has asked for the client to provide credentials)
原因: IAM authentication issues。
解決策:
- AWS CLI credentials を確認します
- aws-auth ConfigMap を確認します
- IAM role または user mapping を追加します
# Check aws-auth ConfigMap
kubectl get configmap aws-auth -n kube-system -o yaml
# Add IAM role or user mapping
eksctl create iamidentitymapping \
--cluster my-cluster \
--arn <iam-role-or-user-arn> \
--username <username> \
--group system:masterserror: error loading config file "/home/user/.kube/config": open /home/user/.kube/config: permission denied
原因: kubeconfig file permission issues。
解決策:
- kubeconfig file permissions を修正します
- kubeconfig file を再生成します
# Fix kubeconfig file permissions
chmod 600 ~/.kube/config
# Regenerate kubeconfig file
aws eks update-kubeconfig --name my-cluster --region <region>Storage Errors
FailedAttachVolume: Multi-Attach error for volume
原因: Volume がすでに別の node に attach されています。
解決策:
- previous pod を削除します
- volume を手動で detach します
- node を再起動します
# Delete previous pod
kubectl delete pod <old-pod-name> -n <namespace>
# Manually detach volume
aws ec2 detach-volume --volume-id <volume-id>FailedMount: Unable to mount volumes for pod: timeout expired waiting for volumes to attach or mount
原因: volume を mount できません。
解決策:
- volume status を確認します
- CSI driver を確認します
- node を再起動します
# Check volume status
aws ec2 describe-volumes --volume-ids <volume-id>
# Check CSI driver
kubectl get pods -n kube-system -l app=ebs-csi-controller
kubectl logs -n kube-system -l app=ebs-csi-controller -c ebs-pluginPersistentVolumeClaim is not bound
原因: PVC が PV に bound されていません。
解決策:
- PVC と PV status を確認します
- StorageClass を確認します
- volume binding mode を確認します
# Check PVC status
kubectl describe pvc <pvc-name> -n <namespace>
# Check PV status
kubectl get pv
# Check StorageClass
kubectl get storageclassLogging and Monitoring Errors
Failed to list *v1.Pod: Unauthorized
原因: metrics server の authentication issues。
解決策:
- metrics server service account を確認します
- RBAC configuration を確認します
- metrics server を再起動します
# Restart metrics server
kubectl delete pod -n kube-system -l k8s-app=metrics-serverFailed to scrape node
原因: Metrics server が node metrics を収集できません。
解決策:
- kubelet configuration を確認します
- metrics server configuration を確認します
- network connectivity を確認します
# Check kubelet configuration
aws ssm start-session --target <instance-id>
sudo cat /etc/kubernetes/kubelet/kubelet-config.jsonFailed to list *v1.Pod: the server could not find the requested resource
原因: API server configuration issues。
解決策:
- API server configuration を確認します
- cluster version を確認します
- metrics server を再インストールします
# Reinstall metrics server
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yamlQuiz
この章で学んだ内容を確認するには、topic quiz に挑戦してください。