当前位置: 首页 > wzjs >正文

如何在建设教育协会网站注册考试郑州网站建设zzjisu

如何在建设教育协会网站注册考试,郑州网站建设zzjisu,赣州互联网哪家好,有哪些好的模板网站aws(学习笔记第二十八课) 使用aws eks 学习内容: 什么是aws eksaws eks的hands onaws eks的创建applicationeks和kubernetes简介 1. 使用aws eks 什么是aws eks aws eks的概念 aws eks是kubernetes在aws上包装出来 的新的方式,旨在更加方便结合aws&am…

aws(学习笔记第二十八课)

  • 使用aws eks

学习内容:

  • 什么是aws eks
  • aws ekshands on
  • aws eks的创建application
  • ekskubernetes简介

1. 使用aws eks

  1. 什么是aws eks
    • aws eks的概念
      aws ekskubernetesaws上包装出来 的新的方式,旨在更加方便结合aws,在aws上使用 kubernetes。实际上aws eksaws上的managed service。作为执行containerserver来说,可以使用EC2或者Fargate都是可以的。
    • aws eksECS的区别
      区别在于orchestration tool‌的不同,aws eks使用的kubernetes作为orchestration tool‌,如果onpromise上使用的是kubernetes,那么同样的架构能够在aws同样使用。
      ECS使用的orchestration tool‌aws独自的,智能在aws上使用。
    • 什么是orchestration tool‌
      orchestration tool‌是指一种用于协调和管理系统资源、服务和应用程序的工具,以确保它们能够高效、可靠地运行。这种工具通常用于自动化和优化资源的分配和管理,特别是在云计算和容器化环境中。
  2. aws eks的架构
    在这里插入图片描述
  3. aws上的示例程序
    aws上提供了示例程序,能够使用练习eks
    eks的示例程序

2. aws ekshands on

  1. 环境(软件安装)准备
    • 练习用的ec2
      这里依然采用方便的cloudshell进行练习
    • aws cli的版本确认
      aws --version
      
    • 安装eksctl
      curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
      eksctl version
      
    • 安装kubectl
      如果使用cloudshell,不用安装kubectl,如果使用的EC2,那么执行下面的命令。
      curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.18.8/2020-09-18/bin/linux/amd64/kubectl
      chmod +x ./kubectl
      sudo mv ./kubectl /usr/local/bin
      kubectl version --client
      
  2. 对于需要的权限设定role进行作成
    • eksClusterRole的创建
      这里的role主要是赋予给eks服务足够的权利。role的名字是eksClusterRole
      保存到文件,之后使用cloudformation进行创建role的操作。
      AWSTemplateFormatVersion: '2010-09-09'
      Description: 'Amazon EKS Cluster Role'Resources:eksClusterRole:Type: 'AWS::IAM::Role'Properties:AssumeRolePolicyDocument:Version: '2012-10-17'Statement:- Effect: AllowPrincipal:Service:- eks.amazonaws.comAction:- sts:AssumeRoleManagedPolicyArns:- arn:aws:iam::aws:policy/AmazonEKSClusterPolicyOutputs:RoleArn:Description: 'The role that Amazon EKS will use to create AWS resources for Kubernetes clusters'Value: !GetAtt eksClusterRole.ArnExport:Name: !Sub '${AWS::StackName}-RoleArn'
      
    • eks-nodegroup-role的创建
      还需要创建work node的需要的权限role,这个代码由aws提供。
      -> aws work node role link
    AWSTemplateFormatVersion: "2010-09-09"Description: Amazon EKS - Node Group RoleMappings:ServicePrincipals:aws-cn:ec2: ec2.amazonaws.com.cnaws-us-gov:ec2: ec2.amazonaws.comaws:ec2: ec2.amazonaws.comResources:NodeInstanceRole:Type: "AWS::IAM::Role"Properties:AssumeRolePolicyDocument:Version: "2012-10-17"Statement:- Effect: AllowPrincipal:Service:- !FindInMap [ServicePrincipals, !Ref "AWS::Partition", ec2]Action:- "sts:AssumeRole"ManagedPolicyArns:- !Sub "arn:${AWS::Partition}:iam::aws:policy/AmazonEKSWorkerNodePolicy"- !Sub "arn:${AWS::Partition}:iam::aws:policy/AmazonEKS_CNI_Policy"- !Sub "arn:${AWS::Partition}:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"Path: /Outputs:NodeInstanceRole:Description: The node instance roleValue: !GetAtt NodeInstanceRole.Arn
    
  3. 创建eks所在的vpc
    • 使用cloudformation来创建vpc
      这个vpc的创建jsonaws提供示例代码。->eks所在的vpc示例json
      这里在subnet指定采用了hardcoding,如果不进行hardcoding发现总是提示错误,暂定对应。
      ---
      AWSTemplateFormatVersion: '2010-09-09'
      Description: 'Amazon EKS Sample VPC - Public subnets only'Parameters:VpcBlock:Type: StringDefault: 192.168.0.0/16Description: The CIDR range for the VPC. This should be a valid private (RFC 1918) CIDR range.Subnet01Block:Type: StringDefault: 192.168.64.0/18Description: CidrBlock for subnet 01 within the VPCSubnet02Block:Type: StringDefault: 192.168.128.0/18Description: CidrBlock for subnet 02 within the VPCSubnet03Block:Type: StringDefault: 192.168.192.0/18Description: CidrBlock for subnet 03 within the VPC. This is used only if the region has more than 2 AZs.Metadata:AWS::CloudFormation::Interface:ParameterGroups:-Label:default: "Worker Network Configuration"Parameters:- VpcBlock- Subnet01Block- Subnet02Block- Subnet03BlockConditions:Has2Azs:Fn::Or:- Fn::Equals:- {Ref: 'AWS::Region'}- ap-south-1- Fn::Equals:- {Ref: 'AWS::Region'}- ap-northeast-2- Fn::Equals:- {Ref: 'AWS::Region'}- ca-central-1- Fn::Equals:- {Ref: 'AWS::Region'}- cn-north-1- Fn::Equals:- {Ref: 'AWS::Region'}- sa-east-1- Fn::Equals:- {Ref: 'AWS::Region'}- us-west-1HasMoreThan2Azs:Fn::Not:- Condition: Has2AzsResources:VPC:Type: AWS::EC2::VPCProperties:CidrBlock:  !Ref VpcBlockEnableDnsSupport: trueEnableDnsHostnames: trueTags:- Key: NameValue: !Sub '${AWS::StackName}-VPC'InternetGateway:Type: "AWS::EC2::InternetGateway"VPCGatewayAttachment:Type: "AWS::EC2::VPCGatewayAttachment"Properties:InternetGatewayId: !Ref InternetGatewayVpcId: !Ref VPCRouteTable:Type: AWS::EC2::RouteTableProperties:VpcId: !Ref VPCTags:- Key: NameValue: Public Subnets- Key: NetworkValue: PublicRoute:DependsOn: VPCGatewayAttachmentType: AWS::EC2::RouteProperties:RouteTableId: !Ref RouteTableDestinationCidrBlock: 0.0.0.0/0GatewayId: !Ref InternetGatewaySubnet01:Type: AWS::EC2::SubnetMetadata:Comment: Subnet 01Properties:MapPublicIpOnLaunch: trueAvailabilityZone:  ap-northeast-1aCidrBlock:Ref: Subnet01BlockVpcId:Ref: VPCTags:- Key: NameValue: !Sub "${AWS::StackName}-Subnet01"- Key: kubernetes.io/role/elbValue: 1Subnet02:Type: AWS::EC2::SubnetMetadata:Comment: Subnet 02Properties:MapPublicIpOnLaunch: trueAvailabilityZone: ap-northeast-1cCidrBlock:Ref: Subnet02BlockVpcId:Ref: VPCTags:- Key: NameValue: !Sub "${AWS::StackName}-Subnet02"- Key: kubernetes.io/role/elbValue: 1Subnet03:Condition: HasMoreThan2AzsType: AWS::EC2::SubnetMetadata:Comment: Subnet 03Properties:MapPublicIpOnLaunch: trueAvailabilityZone:  ap-northeast-1dCidrBlock:Ref: Subnet03BlockVpcId:Ref: VPCTags:- Key: NameValue: !Sub "${AWS::StackName}-Subnet03"- Key: kubernetes.io/role/elbValue: 1Subnet01RouteTableAssociation:Type: AWS::EC2::SubnetRouteTableAssociationProperties:SubnetId: !Ref Subnet01RouteTableId: !Ref RouteTableSubnet02RouteTableAssociation:Type: AWS::EC2::SubnetRouteTableAssociationProperties:SubnetId: !Ref Subnet02RouteTableId: !Ref RouteTableSubnet03RouteTableAssociation:Condition: HasMoreThan2AzsType: AWS::EC2::SubnetRouteTableAssociationProperties:SubnetId: !Ref Subnet03RouteTableId: !Ref RouteTableControlPlaneSecurityGroup:Type: AWS::EC2::SecurityGroupProperties:GroupDescription: Cluster communication with worker nodesVpcId: !Ref VPCOutputs:SubnetIds:Description: All subnets in the VPCValue:Fn::If:- HasMoreThan2Azs- !Join [ ",", [ !Ref Subnet01, !Ref Subnet02, !Ref Subnet03 ] ]- !Join [ ",", [ !Ref Subnet01, !Ref Subnet02 ] ]SecurityGroups:Description: Security group for the cluster control plane communication with worker nodesValue: !Join [ ",", [ !Ref ControlPlaneSecurityGroup ] ]VpcId:Description: The VPC IdValue: !Ref VPC
      
  4. eks所在的vpc中创建eks cluster
    • 选择自定义配置
      在这里插入图片描述
    • 设定cluster名字和role
      这里设定eks-clusterrole选择上面创建的eksClusterRole
      在这里插入图片描述
    • 设置IAM角色
      这里设置administor的权限,ec-role
      在这里插入图片描述
    • ec2-role的权限设定
      在这里插入图片描述
    • 设置vpc
      这里设置前面已经创建的vpc
      在这里插入图片描述
    • 集群端点访问设定
      这里设置成public
      在这里插入图片描述
    • 等待cluster创建
      这里大概要等待10分钟
      在这里插入图片描述
  5. eks所在的cluster中创建kubeconfig
    • 作成kubeconfig文件
      如果不做成kubeconfig文件,无法访问eks cluster
      aws eks --region ap-northeast-1 update-kubeconfig --name eks-cluster
      
      在这里插入图片描述
  6. 尝试链接eks所在的cluster
    • 链接测试
      kubectl get svc
      
      在这里插入图片描述
  7. 作成eks cluster中的work node
    • 启动work node group
      在这里插入图片描述
    • 这是work node group的名字和IAM role
      这里设定的role就是前面创建的role。名字设置为work-node-group
      在这里插入图片描述
    • 设定ec2 type,节点数和磁盘大小
      在这里插入图片描述
    • 等待work node group创建,这里需要5分钟
      在这里插入图片描述
    • 检查ec2
      可以看到这里作成了三个ec2 instances
      在这里插入图片描述

3. aws eks的创建application

  1. 部署redis数据库
    • 使用下面的github上的官方sample程序
      redis-master-controller
      git clone https://github.com/kubernetes/examples.git
      cd examples/guestbook-go
      
    • 之后进入example文件夹,启动redis controller
      kubectl apply -f redis-master-controller.yaml
      
      在这里插入图片描述
    • 启动redis service
      kubectl apply -f redis-master-service.yaml
      
      在这里插入图片描述
  2. 部署guest-book服务
    1. 启动guest-book
      kubectl apply -f guestbook-controller.yaml
      kubectl apply -f guestbook-service.yaml
      
    2. 确定external ip
      get pod,svc -o wide
      
      这里看出external ip没有生成成功,说明还是有问题。检查下work node group,看出这里创建之后存在问题,还在解析中。
      在这里插入图片描述

4. aws ekskubernetes简介

  1. 关于 aws ekskubernetes
    EKS(Elastic Kubernetes Service)就是aws提供的managed Kubenetes服务。通过awsmanaged封装,能够便利的管理Kubenetes服务,减轻运用的负担。并且,通过awsmanaged服务,更好的利用kubenetes提供的各种resource
    Kubenetes(K8S)是Google公司开发的Borg项目为基础的OSS(Open Source Software)Kubenetes(K8S)能够对container化的应用程序进行部署(deploy),自动的scaling,并且进行管理。非常多的云(cloud)提供商的系统本身就是使用的Kubenetes
    以下是Kubenetes的整体架构。
    在这里插入图片描述

  2. 什么是Control Plain(master node)
    Control Plain(master node)就是集群cluster内部的work nodecontainer管理的节点node。在eks cluster之后存在着两种节点。

    • Control Plain(master node)
    • work node

    Control Plain(master node)保持着kubernetes中对象的状态,接受从client来的command,进行API Action的执行,进行container部署。或者,schdulerControl Plain(master node)进行动作,通知work node上的kubelet(agent)进行动作。kubelet(agent),接受Control plain(master)的指示启动container

  3. 什么是work node
    work node就是实际上启动


文章转载自:

http://WF8DXtTi.zpmmn.cn
http://kkGRxmea.zpmmn.cn
http://ZZL4Q1BC.zpmmn.cn
http://m7kLVnMt.zpmmn.cn
http://LftR7r5t.zpmmn.cn
http://zPt3kk0w.zpmmn.cn
http://xcdgTgV5.zpmmn.cn
http://Jz45Mxrl.zpmmn.cn
http://MvfYV1vS.zpmmn.cn
http://kijGX6j9.zpmmn.cn
http://DVEUXdaR.zpmmn.cn
http://Pu5xmq3Q.zpmmn.cn
http://PCqmeW6G.zpmmn.cn
http://OuHr3vNW.zpmmn.cn
http://v6I3RBl2.zpmmn.cn
http://b1NPQILe.zpmmn.cn
http://BYA9CKeN.zpmmn.cn
http://dJb7tBXn.zpmmn.cn
http://hdSOGV7Q.zpmmn.cn
http://jyMEmTbA.zpmmn.cn
http://kIhmjePH.zpmmn.cn
http://QHZCskIN.zpmmn.cn
http://m3bGiwWE.zpmmn.cn
http://8jH9GUe9.zpmmn.cn
http://AuHA4SGd.zpmmn.cn
http://MjuibKtR.zpmmn.cn
http://EPb7kGtq.zpmmn.cn
http://0OErwcK0.zpmmn.cn
http://haicPguG.zpmmn.cn
http://KwX8AFQm.zpmmn.cn
http://www.dtcms.com/wzjs/666380.html

相关文章:

  • 新闻静态网站咋做网络维护服务合同模板
  • 网站开发项目小组成员职责免费做个人网站
  • 汤唯梁朝伟做视频网站wordpress 产品列表
  • 网站开发过程及要求视频网站开发问题
  • 网站自己做还是用程序vpn网站模板
  • 合肥高端品牌网站建设河北邢台做移动网站
  • 建设电子商务网站前的市场分析wordpress过时了
  • 网站做压测郑州见效果付费优化公司
  • 协会网站建设方案广州番禺各镇分布图
  • 城乡建设厅网站做虾苗网站有哪些流程
  • 好的网站怎么设计师农场游戏系统开发网站建设推广
  • 做图赚钱的网站建设网银
  • 网站字体特效代码wordpress 表单js改变
  • 教育培训机构有关的网站python为什么叫爬虫
  • 乐从网站建设制作动画软件app手机
  • 网站推广优化排名seo大气黑色女性时尚类网站织梦模板
  • redis做网站统计晨光科技 网站建设
  • 最牛网站建设是谁logo免费生成器
  • 如何查网站有无备案不用付费的正能量软件
  • 沧州网站运营重庆大渝网最新消息
  • 青海建设银行的官方网站做pc端网站案例
  • 网站开发的策划书建设销售型网站
  • 传媒公司 网站开发网站建设的基本流程有哪些
  • 保定网络营销网站建设公司网页如何建立
  • 西安快速建站网络公司芜湖移动互联网开发
  • 自己做网赌网站南京网页设计照片
  • 网站制作自己做做一个网站前端页面多少钱
  • qq说说赞在线自助下单网站线上设计师与线下设计师的区别
  • 设计型网站案例网络营销方案分享
  • 网站如何做电脑和手机app网络营销品牌策划优化