- Getting Started with Kubernetes
- Jonathan Baier Jesse White
- 285字
- 2021-06-10 19:47:00
IAM setup
In order for us to use kops, we'll need an IAM role created in AWS with the following permissions:
AmazonEC2FullAccess
AmazonRoute53FullAccess
AmazonS3FullAccess
IAMFullAccess
AmazonVPCFullAccess
Once you've created those pieces manually in the AWS GUI, you can run the following commands from your PC to set up permissions with the correct access:
aws iam create-group --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonEC2FullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonRoute53FullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/IAMFullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonVPCFullAccess --group-name kops
aws iam create-user --user-name kops
aws iam add-user-to-group --user-name kops --group-name kops
aws iam create-access-key --user-name kops
In order to use this newly created kops user to interact with the kops tool, you need to copy down the SecretAccessKey and AccessKeyID from the output JSON, and then configure the AWS CLI as follows:
# configure the aws client to use your new IAM user
aws configure # Use your new access and secret key here
aws iam list-users # you should see a list of all your IAM users here
# Because "aws configure" doesn't export these vars for kops to use, we export them now
export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id)
export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key)
We're going to use a gossip-based cluster to bypass a kops configuration requirement of public DNS zones. This requires kops 1.6.2 or later, and allows you to create a locally registered cluster that requires a name ending in .k8s.local. More on that in a bit.
If you'd like to explore how to purchase and set up publicly routable DNS through a provider, you can review the available scenarios in the kops documentation here: https://github.com/kubernetes/kops/blob/master/docs/aws.md#configure-dns.
推薦閱讀
- 基于C語言的程序設計
- Hands-On Artificial Intelligence on Amazon Web Services
- 網絡服務器架設(Windows Server+Linux Server)
- 返璞歸真:UNIX技術內幕
- Photoshop CS3特效處理融會貫通
- Photoshop CS3圖層、通道、蒙版深度剖析寶典
- 構建高性能Web站點
- 樂高機器人—槍械武器庫
- 項目管理成功利器Project 2007全程解析
- 基于企業網站的顧客感知服務質量評價理論模型與實證研究
- ESP8266 Robotics Projects
- 大數據:引爆新的價值點
- Microsoft Dynamics CRM 2013 Marketing Automation
- 算法設計與分析
- 軟件測試設計