בנושא הזה מפורטות הדרישות להתקנה ולהגדרה של GKE ב-AWS.
הגדרת תחנת עבודה
כדי להתקין ולשדרג את ההתקנה של GKE ב-AWS, צריך גישה לתחנת עבודה שפועלת בה מערכת Linux או MacOS. במסמכים האלה מניחים שאתם משתמשים במעטפת bash ב-Linux או ב-macOS. אם אין לכם גישה לסביבת מעטפת רגילה, אתם יכולים להשתמש ב-Cloud Shell.
כלים
כדי להשלים את ההתקנה של GKE ב-AWS, צריך להתקין את הכלים הבאים.
- כלי שורת הפקודה
anthos-gke - כלי שורת הפקודה
terraform - כלי שורת הפקודה
kubectl
ההתקנה של הכלים האלה מתבצעת כשמשלימים את הדרישות המוקדמות.
Networking
לתחנת העבודה שלכם שבה אתם מבצעים את ההגדרה צריכה להיות גישה לרשת ה-VPC ביציאה 443.
דרישות הרשאת IAM ב- Google Cloud
כדי להתקין את הרכיבים של GKE ב-AWS, אתם צריכים את ההרשאות הבאות לניהול זהויות והרשאות גישה. Google Cloud
- בעלי הפרויקט
- בעל הפרויקט צריך להפעיל ממשקי API בפרויקט ב-Google Cloud שאליו מתחברים לשירות הניהול של GKE ב-AWS.
- בעלים של קטגוריית אחסון
- אחרי שמפעילים ממשקי API בפרויקט, צריך משתמש עם הרשאות אדמין של אובייקטים באחסון.
דרישות ההרשאות ב-AWS IAM
בקטע הזה מוסבר על הרשאות AWS IAM שנדרשות ל-GKE ב-AWS, גם בהתקנה שנוצרה עם anthos-gke init וגם בהתקנה ב-AWS VPC קיים.
למשתמש הזה צריכה להיות גישה אל:
בסעיפים הבאים מפורטות הרשאות ספציפיות.
AWS Key Management Service (KMS)
GKE ב-AWS דורש מפתח AWS KMS כדי להצפין סודות בשכבת האפליקציה באשכולות. לפני שמתקינים את GKE ב-AWS, צריך שם משאב (ARN) של KMS Amazon באותו אזור כמו אשכול המשתמשים, או הרשאות ליצירת מפתח KMS.
התקנת ברירת מחדל
כשמתקינים את GKE ב-AWS באמצעות anthos-gke init, צריך משתמש AWS IAM שמוגדר ב-AWS CLI.
הרשאות ייעודיות ל-VPC
אם אתם מגדירים GKE ב-AWS ב-VPC ייעודי, אתם צריכים לפחות את ההרשאות הבאות.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:CreateAutoScalingGroup",
"autoscaling:DeleteAutoScalingGroup",
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeScalingActivities",
"autoscaling:UpdateAutoScalingGroup",
"ec2:AllocateAddress",
"ec2:AssociateAddress",
"ec2:AssociateRouteTable",
"ec2:AttachInternetGateway",
"ec2:AuthorizeSecurityGroupEgress",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CreateInternetGateway",
"ec2:CreateKeyPair",
"ec2:CreateLaunchTemplate",
"ec2:CreateNatGateway",
"ec2:CreateRoute",
"ec2:CreateRouteTable",
"ec2:CreateSecurityGroup",
"ec2:CreateSubnet",
"ec2:CreateTags",
"ec2:CreateVolume",
"ec2:CreateVpc",
"ec2:DeleteInternetGateway",
"ec2:DeleteKeyPair",
"ec2:DeleteLaunchTemplate",
"ec2:DeleteNatGateway",
"ec2:DeleteNetworkInterface",
"ec2:DeleteRoute",
"ec2:DeleteRouteTable",
"ec2:DeleteSecurityGroup",
"ec2:DeleteSubnet",
"ec2:DeleteTags",
"ec2:DeleteVolume",
"ec2:DeleteVpc",
"ec2:DescribeAccountAttributes",
"ec2:DescribeAddresses",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeImages",
"ec2:DescribeInstanceAttribute",
"ec2:DescribeInstanceCreditSpecifications",
"ec2:DescribeInstances",
"ec2:DescribeInternetGateways",
"ec2:DescribeKeyPairs",
"ec2:DescribeLaunchTemplateVersions",
"ec2:DescribeLaunchTemplates",
"ec2:DescribeNatGateways",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeRouteTables",
"ec2:DescribeSecurityGroups",
"ec2:DescribeSubnets",
"ec2:DescribeTags",
"ec2:DescribeVolumes",
"ec2:DescribeVpcAttribute",
"ec2:DescribeVpcClassicLink",
"ec2:DescribeVpcClassicLinkDnsSupport",
"ec2:DescribeVpcs",
"ec2:DetachInternetGateway",
"ec2:DisassociateAddress",
"ec2:DisassociateRouteTable",
"ec2:ImportKeyPair",
"ec2:ModifyNetworkInterfaceAttribute",
"ec2:ModifySubnetAttribute",
"ec2:ModifyVpcAttribute",
"ec2:ReleaseAddress",
"ec2:RevokeSecurityGroupEgress",
"ec2:RevokeSecurityGroupIngress",
"ec2:RunInstances",
"ec2:TerminateInstances",
"elasticloadbalancing:AddTags",
"elasticloadbalancing:CreateListener",
"elasticloadbalancing:CreateLoadBalancer",
"elasticloadbalancing:CreateTargetGroup",
"elasticloadbalancing:DeleteListener",
"elasticloadbalancing:DeleteLoadBalancer",
"elasticloadbalancing:DeleteTargetGroup",
"elasticloadbalancing:DescribeListeners",
"elasticloadbalancing:DescribeLoadBalancerAttributes",
"elasticloadbalancing:DescribeLoadBalancers",
"elasticloadbalancing:DescribeTags",
"elasticloadbalancing:DescribeTargetGroupAttributes",
"elasticloadbalancing:DescribeTargetGroups",
"elasticloadbalancing:DescribeTargetHealth",
"elasticloadbalancing:ModifyLoadBalancerAttributes",
"elasticloadbalancing:ModifyTargetGroup",
"elasticloadbalancing:ModifyTargetGroupAttributes",
"iam:AddRoleToInstanceProfile",
"iam:CreateInstanceProfile",
"iam:CreateRole",
"iam:CreateServiceLinkedRole",
"iam:DeleteInstanceProfile",
"iam:DeleteRole",
"iam:DeleteRolePolicy",
"iam:GetInstanceProfile",
"iam:GetRole",
"iam:GetRolePolicy",
"iam:ListInstanceProfilesForRole",
"iam:PassRole",
"iam:PutRolePolicy",
"iam:RemoveRoleFromInstanceProfile",
"iam:TagRole",
"kms:CreateAlias",
"kms:CreateKey",
"kms:DescribeKey",
"kms:Decrypt",
"kms:Encrypt",
"s3:CreateBucket",
"s3:PutBucketTagging",
"s3:PutObject",
"s3:PutObjectTagging"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
הרשאות לשימוש ב-VPC משלכם
כדי להשתמש ב-GKE ב-AWS עם AWS VPC משלכם, צריך את ההרשאות הבאות.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:CreateAutoScalingGroup",
"autoscaling:DeleteAutoScalingGroup",
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeScalingActivities",
"autoscaling:UpdateAutoScalingGroup",
"ec2:AllocateAddress",
"ec2:AssociateAddress",
"ec2:AuthorizeSecurityGroupEgress",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CreateKeyPair",
"ec2:CreateLaunchTemplate",
"ec2:CreateSecurityGroup",
"ec2:CreateTags",
"ec2:CreateVolume",
"ec2:DeleteKeyPair",
"ec2:DeleteLaunchTemplate",
"ec2:DeleteNetworkInterface",
"ec2:DeleteSecurityGroup",
"ec2:DeleteTags",
"ec2:DeleteVolume",
"ec2:DescribeAccountAttributes",
"ec2:DescribeAddresses",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeImages",
"ec2:DescribeInstanceAttribute",
"ec2:DescribeInstanceCreditSpecifications",
"ec2:DescribeInstances",
"ec2:DescribeVpcAttribute",
"ec2:DescribeVpcClassicLink",
"ec2:DescribeVpcClassicLinkDnsSupport",
"ec2:DescribeVpcs",
"ec2:DescribeKeyPairs",
"ec2:DescribeLaunchTemplateVersions",
"ec2:DescribeLaunchTemplates",
"ec2:DescribeSecurityGroups",
"ec2:DescribeSubnets",
"ec2:DescribeTags",
"ec2:DescribeVolumes",
"ec2:DisassociateAddress",
"ec2:ImportKeyPair",
"ec2:ModifyNetworkInterfaceAttribute",
"ec2:ReleaseAddress",
"ec2:RevokeSecurityGroupEgress",
"ec2:RevokeSecurityGroupIngress",
"ec2:RunInstances",
"ec2:TerminateInstances",
"elasticloadbalancing:AddTags",
"elasticloadbalancing:CreateListener",
"elasticloadbalancing:CreateLoadBalancer",
"elasticloadbalancing:CreateTargetGroup",
"elasticloadbalancing:DeleteListener",
"elasticloadbalancing:DeleteLoadBalancer",
"elasticloadbalancing:DeleteTargetGroup",
"elasticloadbalancing:DescribeListeners",
"elasticloadbalancing:DescribeLoadBalancerAttributes",
"elasticloadbalancing:DescribeLoadBalancers",
"elasticloadbalancing:DescribeTags",
"elasticloadbalancing:DescribeTargetGroupAttributes",
"elasticloadbalancing:DescribeTargetGroups",
"elasticloadbalancing:DescribeTargetHealth",
"elasticloadbalancing:ModifyLoadBalancerAttributes",
"elasticloadbalancing:ModifyTargetGroup",
"elasticloadbalancing:ModifyTargetGroupAttributes",
"iam:AddRoleToInstanceProfile",
"iam:CreateInstanceProfile",
"iam:CreateRole",
"iam:CreateServiceLinkedRole",
"iam:DeleteInstanceProfile",
"iam:DeleteRole",
"iam:DeleteRolePolicy",
"iam:GetInstanceProfile",
"iam:GetRole",
"iam:GetRolePolicy",
"iam:ListInstanceProfilesForRole",
"iam:PassRole",
"iam:PutRolePolicy",
"iam:RemoveRoleFromInstanceProfile",
"iam:TagRole",
"kms:CreateAlias",
"kms:CreateKey",
"kms:DescribeKey",
"kms:Decrypt",
"kms:Encrypt",
"s3:CreateBucket",
"s3:PutBucketTagging",
"s3:PutObject",
"s3:PutObjectTagging"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
גישה לדומיינים חיצוניים
GKE ב-AWS דורש גישה יוצאת לדומיינים הבאים.
gkeconnect.googleapis.comgkehub.googleapis.comoauth2.googleapis.comstorage.googleapis.comwww.googleapis.comgcr.iok8s.gcr.ioEC2-REGION.ec2.archive.ubuntu.com
מחליפים את EC2-REGION באזור AWS EC2 שבו פועלת ההתקנה של GKE on AWS. לדוגמה, us-west-1.ec2.archive.ubuntu.com/.
אם אתם משתמשים ב-Cloud Service Mesh עם Prometheus ו-Kiali, אתם צריכים לאפשר גישה יוצאת מהדומיינים הבאים:
docker.ioquay.io
הרשאות לעומסי עבודה
כדי להריץ עומס עבודה באשכול משתמשים, לא נדרשת גישה ל-AWS. אתם יכולים לגשת לאשכולות משתמשים של GKE ב-AWS באמצעות Connect או OIDC.