Installing Kubernetes on AWS with kops

一组图表告诉你,AWS为什么刚刚启动了K8S 容器项目 2017年3月,AWS与Heptio启动K8S Quick Start,或是EC2全面支持K8S前兆。 阅读详情

Installing Kubernetes on AWS with kops

Overview

This quickstart shows you how to easily install a Kubernetes cluster on AWS. It uses a tool called kops.

kops is an opinionated provisioning system:

  • Fully automated installation
  • Uses DNS to identify clusters
  • Self-healing: everything runs in Auto-Scaling Groups
  • Limited OS support (Debian preferred, Ubuntu 16.04 supported, early support for CentOS & RHEL)
  • High-Availability support
  • Can directly provision, or generate terraform manifests

If your opinions differ from these you may prefer to build your own cluster using kubeadm as a building block. kops builds on the kubeadm work.

Creating a cluster

(1/5) Install kops

Requirements

You must have kubectl installed in order for kops to work.

Installation

Download kops from the releases page (it is also easy to build from source):

On MacOS:

wget https://github.com/kubernetes/kops/releases/download/1.8.0/kops-darwin-amd64
chmod +x kops-darwin-amd64
mv kops-darwin-amd64 /usr/local/bin/kops
# you can also install using Homebrew
brew update && brew install kops

On Linux:

wget https://github.com/kubernetes/kops/releases/download/1.8.0/kops-linux-amd64
chmod +x kops-linux-amd64
mv kops-linux-amd64 /usr/local/bin/kops

(2/5) Create a route53 domain for your cluster

kops uses DNS for discovery, both inside the cluster and so that you can reach the kubernetes API server from clients.

kops has a strong opinion on the cluster name: it should be a valid DNS name. By doing so you will no longer get your clusters confused, you can share clusters with your colleagues unambiguously, and you can reach them without relying on remembering an IP address.

You can, and probably should, use subdomains to divide your clusters. As our example we will use useast1.dev.example.com. The API server endpoint will then be api.useast1.dev.example.com.

A Route53 hosted zone can serve subdomains. Your hosted zone could be useast1.dev.example.com, but also dev.example.com or even example.com. kops works with any of these, so typically you choose for organization reasons (e.g. you are allowed to create records under dev.example.com, but not under example.com).

Let’s assume you’re using dev.example.com as your hosted zone. You create that hosted zone using the normal process, or with a command such as aws route53 create-hosted-zone --name dev.example.com --caller-reference 1.

You must then set up your NS records in the parent domain, so that records in the domain will resolve. Here, you would create NS records in example.com for dev. If it is a root domain name you would configure the NS records at your domain registrar (e.g. example.com would need to be configured where you bought example.com).

This step is easy to mess up (it is the #1 cause of problems!) You can double-check that your cluster is configured correctly if you have the dig tool by running:

dig NS dev.example.com

You should see the 4 NS records that Route53 assigned your hosted zone.

(3/5) Create an S3 bucket to store your clusters state

kops lets you manage your clusters even after installation. To do this, it must keep track of the clusters that you have created, along with their configuration, the keys they are using etc. This information is stored in an S3 bucket. S3 permissions are used to control access to the bucket.

Multiple clusters can use the same S3 bucket, and you can share an S3 bucket between your colleagues that administer the same clusters - this is much easier than passing around kubecfg files. But anyone with access to the S3 bucket will have administrative access to all your clusters, so you don’t want to share it beyond the operations team.

So typically you have one S3 bucket for each ops team (and often the name will correspond to the name of the hosted zone above!)

In our example, we chose dev.example.com as our hosted zone, so let’s pick clusters.dev.example.com as the S3 bucket name.

  • Export AWS_PROFILE (if you need to select a profile for the AWS CLI to work)

  • Create the S3 bucket using aws s3 mb s3://clusters.dev.example.com

  • You can export KOPS_STATE_STORE=s3://clusters.dev.example.com and then kops will use this location by default. We suggest putting this in your bash profile or similar.

(4/5) Build your cluster configuration

Run “kops create cluster” to create your cluster configuration:

kops create cluster --zones=us-east-1c useast1.dev.example.com

kops will create the configuration for your cluster. Note that it only creates the configuration, it does not actually create the cloud resources - you’ll do that in the next step with a kops update cluster. This give you an opportunity to review the configuration or change it.

It prints commands you can use to explore further:

  • List your clusters with: kops get cluster
  • Edit this cluster with: kops edit cluster useast1.dev.example.com
  • Edit your node instance group: kops edit ig --name=useast1.dev.example.com nodes
  • Edit your master instance group: kops edit ig --name=useast1.dev.example.com master-us-east-1c

If this is your first time using kops, do spend a few minutes to try those out! An instance group is a set of instances, which will be registered as kubernetes nodes. On AWS this is implemented via auto-scaling-groups. You can have several instance groups, for example if you wanted nodes that are a mix of spot and on-demand instances, or GPU and non-GPU instances.

(5/5) Create the cluster in AWS

Run “kops update cluster” to create your cluster in AWS:

kops update cluster useast1.dev.example.com --yes

That takes a few seconds to run, but then your cluster will likely take a few minutes to actually be ready. kops update cluster will be the tool you’ll use whenever you change the configuration of your cluster; it applies the changes you have made to the configuration to your cluster - reconfiguring AWS or kubernetes as needed.

For example, after you kops edit ig nodes, then kops update cluster --yes to apply your configuration, and sometimes you will also have to kops rolling-update cluster to roll out the configuration immediately.

Without --yes, kops update cluster will show you a preview of what it is going to do. This is handy for production clusters!

Explore other add-ons

See the list of add-ons to explore other add-ons, including tools for logging, monitoring, network policy, visualization & control of your Kubernetes cluster.

What’s next

Cleanup

  • To delete you cluster: kops delete cluster useast1.dev.example.com --yes

Feedback

基于Kops的AWS中国区Kubernetes快速部署实战(宁夏与北京区域) 为了实现最小权限控制,推荐编写自定义IAM策略,精确限定kops可执行的操作范围。以下是一个典型的精简策略模板(JSON格式):],},],},],},],},逻辑分析与参数说明:策略采用白名单方式,显式声明允许的操作;第一条只读类操作(Describe*)用于探测现有资源,防止重复创建;第二条限制安全组创建及规则写入,资源限定为特定ARN前缀;权限覆盖实例创建所需的所有关联资源类型(AMI、EBS卷、网卡等); 阅读详情

相关推荐

IVP 2021 UNETR: Transformers for 3D Medical Image Segmentation

动机 具有跟踪和扩展路径的全卷积神经网络(FCNNs)(如编码器和解码器),近年来在各种医学图像分割应用中显示出了突出的地位。在这些体系结构中,编码器通过学习全局上下文表示来扮演一个不可或缺的角色,该全局上下文表示将进一步用于解码器的语义输出预测。 卷积层作为FCNN的主要构造块,其局部性限制了此类网络学习长时空间依赖的能力。 在NLP领域,基于transformer的模型已经在各种任务中实现了最先进的基准。transformer中的自我注意机制使他们能够动态地突出词序列的重要特征并学习其长时依赖关系。这

smile909的博客 1979

探索 Kubernetes 高级管理工具:Kops

探索 Kubernetes 高级管理工具:Kops 【免费下载链接】kops Kubernetes Operations (kOps) - Production Grade k8s Installation, Upgrades and Management 项目地...

gitblog_00014的博客 517

国宇测试盒GH7009 SPI读操作全解析:从接线到代码实现的避坑指南

本文详细解析了国宇GH7009测试盒进行SPI读操作的完整流程与避坑要点。重点阐述了硬件连接中IO2时序控制引脚的关键作用,提供了从接线方案、电源处理到上位机代码实现的实战指南,并针对常见的数据不稳定、特定寄存器读取失败等问题给出了具体解决方案。

dapp9builder的博客 224

kOps 使用教程

kOps 使用教程 项目介绍 kOps 是一个用于创建、操作和管理 Kubernetes 集群的工具,它致力于提供生产级别的集群部署体验。kOps 将帮助你轻松地在云环境中(如 AWS, GCP)搭建、销毁、升级和维护高可用的 Kubernetes 集群。该项目支持自动配置必要的基础设施,简化了集群生命周期的管理。 项目快速启动 安装 kOps 首先确保你的系统安装了 Go 编译环境,然后通过以下...

gitblog_00629的博客 825

Modelsim安装教程以及管理员身份运行patch_dll.bat时找不到文件mgls.dll的解决

Modesim安装教程 Modesim版本有很多,但是安装方式大都相同,我们以modesim.10.5为例,电脑使用的是win10 64位,讲一下安装过程中的步骤以及出现问题的解决方法 一 安装 1.首先解压安装包,在解压的安装包内选择应用程序,右键选择管理员运行。 2.稍等一会,有的电脑会弹出是否允许modesim进行更改,选择 是 即可,然后出现下面的界面,点击下一步。 3.弹出此界面选择安装路径,选择安装路径,我是在D盘新建的文件夹,直接把文件夹中的路径复制在框内。文件夹名称切记不要带中文 4.

weixin_48564372的博客 1万+

学习使用turtlebot2——ROS上安装turtlebot2

安装环境:    安装Ubuntu 14.04版本和ROS Indigo    参考:http://wiki.ros.org/turtlebot/Tutorials安装步骤    有两种安装方法,一种直接的安装命令,另外一种源码编译安装,区别在于:直接安装命令是安装在电脑默认路径/opt/ros/indigo/share里面不便于更改代码,因为默认路径下文件一般有访问权限,无法直接更改,需要使用s...

weixin_42670641的博客 2532

Kubernetes Operations (kops) 中文指南

Kubernetes Operations (kops) 中文指南 项目介绍 Kubernetes Operations (kops) 是用于部署和管理 Kubernetes 集群的工具,它简化了在云提供商上创建、升级和管理 Kubernetes 集群的过程。这个项目特别强调自动化、安全性和可扩展性,使得运维团队能够更高效地操作他们的 Kubernetes 环境。kops-cn 是 kops 的...

gitblog_00828的博客 767

Windows 10 本地开发环境:用 ShardingSphere-Proxy 5.4.1 快速搭建 MySQL 分库分表测试环境

本文详细介绍了在Windows 10系统中使用ShardingSphere-Proxy 5.4.1快速搭建MySQL分库分表测试环境的完整教程。从环境准备、MySQL配置到ShardingSphere-Proxy的核心设置,逐步指导开发者完成本地开发环境的搭建,并提供了分片策略详解和常见问题排查方法,帮助开发者高效验证分库分表功能。

weixin_28366053的博客 216

kops-安装k8s集群自动化脚本示例

#!/bin/bash ##########定义变量########## #你的AWS账户AK SK信息 aws_configure_your_AK= aws_configure_your_SK= aws_configure_your_region=eu-west-3 aws_configure_your_output=json #判断是否需要新建IAM用户和用户组,还是使用已存在的IAM用户和用户组(填写Y/N);Y表示新建IAM用户和用户组,N表示使用已有IAM用户和用户组 #如果此前使用本脚本,.

qq522044637的博客 1384

3.6KW储能双向逆变器(原理图PCB源码)

通过百度网盘分享的文件:优快云 3.6KW储能双向逆变器 链接:https://pan.baidu.com/s/18NN6KnpywFUIDtAQ4b1LTg?pwd=csdn 提取码:csdn

2401_86562087的博客 2191

2、探索谷歌云平台(GCP):入门指南

本文全面介绍了谷歌云平台(GCP)的入门知识,涵盖其全球基础设施、核心服务和使用方法。内容包括GCP区域与可用区结构、创建免费账户、配置计算资源(如GCE虚拟机)、存储类型(PD、Filestore、GCS)、网络架构(VPC)、组织与项目管理、身份访问控制(IAM),以及计算、存储、数据库、大数据和人工智能等各类云服务。文章还提供了资源规划、安全管理和成本控制等实用建议,帮助用户快速上手并高效利用GCP构建可扩展的云解决方案。

uber9的博客 256

kOps + Karpenter 集成实践:实现 K8s 集群的动态扩展

我们需要为 Karpenter 创建和配置专用的 IAM Role 和 Policy,允许 Karpenter 通过 OIDC 身份验证该角色,并为该角色添加必要的权限,使其能够动态创建、管理和删除AWS资源(如EC2实例),以满足 Kubernetes 工作负载的需求。尽管如此,kOps 和 Karpenter 的结合仍然是一个强有力的工具组合,适合需要动态扩展和多实例支持的场景,但在实施时需要注意这些局限性并做好相关规划。在创建集群前,您需要配置集群所在的 Region,以及集群的名称。

cloudpilot_ai的博客 1211

保姆级AI辅助科研选题指南!利用Gemini 3 Pro选出可操作、新颖且有价值的高质选题(附AI提示词模板)

例如:【示例主题】。我是一名【身份,例如:博士生/研究者】,我的专业是【专业】,我正在撰写学术期刊文章,我关注的研究问题是:【研究问题】。我是一位xxx,专业是【专业】,我正在撰写学术期刊文章,我的研究问题是【研究问题】,请你充当学术写作专家,给我推荐一些能够解决我的研究问题的研究方法。我们的任务是借助Gemini 3 Pro围绕研究主题,提出具体的研究问题,可以按照研究问题的提出方法来对Gemini 3 Pro提问,也能直接利用开放性的思维直接对其提问,还可按照某种特定研究问题的示例提出具体的研究问题。

智能AI让学术科研更容易 582

kubernetes系列之十七:使用kops在AWS部署kubernetes并建立基于AWS Network Load Balancer的service

一、前言

cloudvtech的博客 5130

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

kops:在 AWS 与 GCE 上部署生产级高可用 Kubernetes 集群

> 本文基于 [kubernetes-handbook](https://kubernetes.feisky.xyz) 部署章节整理。`kops`(Kubernetes Operations)是一个生产级 Kubernetes 集群部署工具,可在 AWS、GCE、VMWare vSphere 等云平台上自动创建高可用集群。通过阅读本文,你将掌握 kops 与 kubectl 的安装、AWS IAM

gitblog_00748的博客 715

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

kOps 集群更新与 Kubernetes 升级完全指南:从 kops update 到 kops reconcile

本指南基于 kOps 官方运维文档,系统讲解 kOps 工具自身的更新方法,以及 Kubernetes 集群版本升级的完整流程:手动编辑 `kubernetesVersion`、`kops upgrade cluster` 自动化升级、kOps 1.31 引入的 `kops reconcile cluster` 新流程,以及 Terraform 用户和滚动更新策略等实战细节。读完本文,你将掌握在生

gitblog_00645的博客 585

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

kops在AWS EC2上自建K8S集群

目录一、下载kops二、安装aws-iam-authenticator三、创建密钥对四、部署集群五、创建策略 一、下载kops curl -LO https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64 chmod +

weixin_41335923的博客 1235

开源项目 `aws-k8s-kops-ansible` 教程

开源项目 aws-k8s-kops-ansible 教程 1. 项目的目录结构及介绍 aws-k8s-kops-ansible/ ├── group_vars/ │ └── all ├── roles/ ├── .gitignore ├── LICENSE ├── README.md ├── addons.yaml ├── ansible.cfg ├── config-kubectl.yaml...

gitblog_00541的博客 1025

kops_使用Kops在AWS上基于八卦的Kubernetes集群

kops 使用Kops创建Kubernetes集群需要一个顶级域或一个子域并设置Route 53托管区域。 该域允许工作节点发现主服务器,而主节点则发现所有etcd服务器。 为了使kubectl能够直接与主机对话,这也是必需的。 这效果很好,但对开发人员而言又是一个麻烦。 Kops 1.6.2增加了对基于八卦的节点发现的实验支持。 这使得使用Kops无需DNS即可设置Kubernetes集...

danpob13624的博客 256

10分钟上手kOps+Terraform:打造生产级K8s基础设施即代码

Kubernetes Operations (kOps) 是一款专为生产环境设计的Kubernetes集群管理工具,能够帮助用户快速实现K8s集群的安装、升级和日常管理。结合Terraform的基础设施即代码能力,二者强强联合,为用户提供了一套完整的生产级K8s部署解决方案。本文将带你在10分钟内快速掌握如何使用kOps和Terraform构建稳定可靠的Kubernetes基础设施。 ## 为什

gitblog_00318的博客 916

使用Kops在AWS上基于八卦的Kubernetes集群

使用Kops创建Kubernetes集群需要一个顶级域或一个子域并设置Route 53托管区域。 该域允许工作节点发现主服务器,而主节点则发现所有etcd服务器。 为了使kubectl能够直接与主机对话,这也是必需的。 这工作得很好,但对开发人员而言又是一个麻烦。 Kops 1.6.2增加了对基于八卦的节点发现的实验支持。 这使得使用Kops无需DNS设置Kubernetes集群的过程变...

danpob13624的博客 232

kops_使用KOPS的Kubernetes群集中SQL Server

kops In this article, we will review how to create a Kubernetes cluster in AWS using KOPS, provision Elastic Block Store (EBS) as persistent volume to store the database files and deploy SQL Server...

culuo4781的博客 446

kOps 1.30 版本解读:Kubernetes 1.30 支持、AWS SDK v2 迁移与内嵌资产哈希链

kOps(Kubernetes Operations)1.30 系列是面向生产环境的 Kubernetes 安装、升级与管理工具的一次重要版本更新。本指南基于仓库中的官方发布说明([docs/releases/1.30-NOTES.md](https://link.gitcode.com/i/3175ae30d4f2ee6c99bb41dde2d97290)),结合源码深入解读 1.30 的三大核

gitblog_00145的博客 703

kOps toolbox instance-selector 实战指南:用资源规格声明式生成 AWS 实例组

`kops toolbox instance-selector` 是 kOps(Kubernetes Operations)中一个专为 AWS 集群设计的高效工具:你不再需要手工挑选 `m5.large`、`c6i.xlarge` 这类具体机型,而是直接以 **vCPU 数量、内存大小、GPU、网络接口等资源规格** 描述"我想要的节点长什么样",工具会自动从 EC2 实例类型清单中筛选出匹配的机

gitblog_00425的博客 770

kOps 集群认证配置指南:kopeio 与 AWS IAM Authenticator 实战

本文基于 kOps(Kubernetes Operations)仓库的 [docs/authentication.md](https://link.gitcode.com/i/e2a7f20cea87498b5d528361bf783d88) 官方文档,系统讲解如何在 kOps 集群中配置用户认证系统,核心覆盖两大方案:实验性的 kopeio authentication 与生产常用的 AWS I

gitblog_00690的博客 485

在AWS中国区使用kops安装k8s完全指南

原文链接:http://blog.geekidentity.com/k8s/kops/install-k8s-with-kops-in-china/ 因为一些众所周知的原因,AWS中国区并没有k8s集群,因此我们需要自己安装k8s。而k8s官方提供了一个工具kops来帮助我们快速地在AWS上创建k8s集群。下面是使用kops在AWS创建集群的详细过程。 安装kops (Binaries) ...

geekidentity 3504
上一篇: 在阿里云上部署生产级别Kubernetes集群
下一篇: IBM Cloud Private technical community
hxpjava1
博客等级 码龄19年 1365粉丝 511原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值