Writing Skills
writing-skills
效率与协作技能,来自 obra/superpowers,查看原文获取完整用途和操作说明。
aws-eks【部署与运维】"Deploys managed Kubernetes clusters with EKS for container orchestration" auto-scaling, networking, and integrations with AWS services for production Kubernetes workloads.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: aws-eks compatibility: opencode completeness: 95 content-types:
Deploy and manage production-grade Kubernetes clusters with automatic control plane updates, high availability, and deep AWS service integration.
Use EKS when:
Avoid EKS when:
Primary Purpose: Provide fully managed Kubernetes control plane with integration to AWS services, eliminating control plane management overhead.
Common Use Cases:
AWSTemplateFormatVersion: '2010-09-09'
Resources:
# EKS Cluster IAM Role
EKSServiceRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: eks.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonEKSServiceRolePolicy
# EKS Cluster
EKSCluster:
Type: AWS::EKS::Cluster
Properties:
Name: production-cluster
Version: 1.27
RoleArn: !GetAtt EKSServiceRole.Arn
ResourcesVpcConfig:
SubnetIds:
- subnet-0123456789abcdef0
- subnet-0123456789abcdef1
- subnet-0123456789abcdef2
SecurityGroupIds:
- sg-0123456789abcdef0
EndpointPrivateAccess: true
EndpointPublicAccess: true
Logging:
ClusterLogging:
- LogTypes:
- api
- audit
- authenticator
- controllerManager
- scheduler
Enabled: true
Tags:
Environment: production
# Node Group IAM Role
NodeGroupRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: ec2.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy
- arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy
- arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryPowerUser
# Managed Node Group
NodeGroup:
Type: AWS::EKS::NodeGroup
Properties:
ClusterName: !Ref EKSCluster
NodeRole: !GetAtt NodeGroupRole.Arn
Subnets:
- subnet-0123456789abcdef0
- subnet-0123456789abcdef1
- subnet-0123456789abcdef2
ScalingConfig:
MinSize: 2
MaxSize: 10
DesiredSize: 3
InstanceTypes:
- t3.medium
- t3.large
DiskSize: 100
Tags:
Name: production-nodes
Key Elements:
Resources:
# OIDC Provider for IRSA
EKSOIDCProvider:
Type: AWS::IAM::OIDCProvider
Properties:
Url: !Sub 'https://oidc.eks.${AWS::Region}.amazonaws.com/id/${EKSClusterOID}'
ClientIdList:
- sts.amazonaws.com
# Service Account Role
ServiceAccountRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Federated: !Sub 'arn:aws:iam::${AWS::AccountId}:oidc-provider/oidc.eks.${AWS::Region}.amazonaws.com/id/${EKSClusterOID}'
Action: sts:AssumeRoleWithWebIdentity
Condition:
StringEquals:
'oidc.eks.${AWS::Region}.amazonaws.com/id/${EKSClusterOID}:sub': 'system:serviceaccount:default:app-sa'
# Application Policy
AppPolicy:
Type: AWS::IAM::Policy
Properties:
PolicyName: app-s3-access
Roles:
- !Ref ServiceAccountRole
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- s3:GetObject
- s3:PutObject
Resource: arn:aws:s3:::app-bucket/*
Key Elements:
EKS + ECR provides:
ALB/NLB integration enables:
CloudWatch + EKS provides:
VPC integration provides:
Problem: AZ failure causes complete outage.
Solution:
Problem: Cluster access uncontrolled; security risk.
Solution:
Problem: Containers run as root; privileged pods.
Solution:
Problem: Cluster issues hard to troubleshoot.
Solution:
| Category | Best Practice |
|---|---|
| Availability | Multi-AZ node groups; managed updates |
| Security | RBAC; IRSA; network policies; PSS |
| Scaling | Cluster Autoscaler; HPA for pods |
| Monitoring | CloudWatch logs; Prometheus/Grafana |
| Updates | Regular cluster and node updates |
| Skill | Purpose |
|---|---|
cncf-aws-ecr | Container image storage |
cncf-aws-vpc | Networking for pod communication |
cncf-aws-iam | IRSA and role management |
cncf-aws-cloudwatch | Cluster monitoring |
Assess Requirements — Understand the use case, scale, integration needs, and existing infrastructure. Checkpoint: Document requirements, constraints, and success criteria.
Design Architecture — Plan component interactions, data flow, and deployment strategy using cloud-native best practices. Checkpoint: Verify the architecture addresses all requirements and follows CNCF conventions.
Implement & Configure — Create manifests, configurations, and deployment scripts. Include resource limits, health checks, and observability hooks. Checkpoint: Validate all YAML against schema and test in a staging environment.
Deploy & Monitor — Apply manifests to the cluster, verify component health, and confirm observability is working. Checkpoint: Confirm all pods/services are running, probes passing, and metrics/alerts configured.