<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Adding EKS clusters > 原文:[https://docs.gitlab.com/ee/user/project/clusters/add_eks_clusters.html](https://docs.gitlab.com/ee/user/project/clusters/add_eks_clusters.html) * [EKS requirements](#eks-requirements) * [Additional requirements for self-managed instances](#additional-requirements-for-self-managed-instances-core-only) * [New EKS cluster](#new-eks-cluster) * [Troubleshooting creating a new cluster](#troubleshooting-creating-a-new-cluster) * [Error: Request failed with status code 422](#error-request-failed-with-status-code-422) * [Could not load Security Groups for this VPC](#could-not-load-security-groups-for-this-vpc) * [`ROLLBACK_FAILED` during cluster creation](#rollback_failed-during-cluster-creation) * [Existing EKS cluster](#existing-eks-cluster) * [Create a default Storage Class](#create-a-default-storage-class) * [Deploy the app to EKS](#deploy-the-app-to-eks) # Adding EKS clusters[](#adding-eks-clusters "Permalink") GitLab 支持添加新的和現有的 EKS 集群. ## EKS requirements[](#eks-requirements "Permalink") 在通過 GitLab 集成在 Amazon EKS 上創建第一個集群之前,請確保滿足以下要求: * 設置了[Amazon Web Services](https://aws.amazon.com/)帳戶,您就可以登錄. * 您有權管理 IAM 資源. * 如果要使用[現有的 EKS 集群](#existing-eks-cluster) : * 已正確配置工作節點的 Amazon EKS 集群. * [安裝并配置](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#get-started-kubectl)了`kubectl`以訪問 EKS 集群. ### Additional requirements for self-managed instances[](#additional-requirements-for-self-managed-instances-core-only "Permalink") 如果您使用自我管理的 GitLab 實例,則必須首先使用一組 Amazon 憑證配置 GitLab. 這些憑證將用于承擔創建集群的用戶提供的 Amazon IAM 角色. 創建一個 IAM 用戶,并確保其有權承擔您的用戶將用來創建 EKS 群集的角色. 例如,以下策略文檔允許在帳戶`123456789012`假設一個角色的名稱以`gitlab-eks-` : ``` { "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": "arn:aws:iam::123456789012:role/gitlab-eks-*" } } ``` 為 IAM 用戶生成訪問密鑰,并使用憑據配置 GitLab: 1. 導航至**管理區域>設置>集成,**然后展開**Amazon EKS**部分. 2. Check **啟用 Amazon EKS 集成**. 3. 在相應的`Account ID` , `Access key ID`和`Secret access key`字段中輸入帳戶 ID 和訪問密鑰憑據. 4. Click **保存更改**. ## New EKS cluster[](#new-eks-cluster "Permalink") 在 GitLab 12.5 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/22392) . 要創建新的 Kubernetes 集群并將其添加到您的項目,組或實例: 1. 導航到您的: * 項目的 **操作> Kubernetes**頁面,用于項目級集群. * 組的 **Kubernetes**頁面,用于組級別集群. * **管理區>** **Kubernetes** ,用于實例級集群. 2. Click **添加 Kubernetes 集群**. 3. 在" **創建新集群"**選項卡下,單擊**Amazon EKS** . 將為您提供一個`Account ID`和`External ID` ,供下一步使用. 4. 在[IAM 管理控制臺中](https://console.aws.amazon.com/iam/home) ,創建一個 IAM 角色: 1. 在左側面板中,選擇**角色** . 2. 單擊**創建角色** . 3. 在`Select type of trusted entity` ,選擇**另一個 AWS 賬戶** . 4. 在 GitLab 中的`Account ID`字段中輸入`Account ID` . 5. 選中**需要外部 ID** . 6. 在 GitLab 中將`External ID`輸入到`External ID`字段中. 7. 單擊**下一步:權限** . 8. 點擊**創建策略** ,這將打開一個新窗口. 9. 選擇**JSON**標簽,然后粘貼以下代碼段代替現有內容: ``` { "Version" : "2012-10-17" , "Statement" : [ { "Effect" : "Allow" , "Action" : [ "autoscaling:CreateAutoScalingGroup" , "autoscaling:DescribeAutoScalingGroups" , "autoscaling:DescribeScalingActivities" , "autoscaling:UpdateAutoScalingGroup" , "autoscaling:CreateLaunchConfiguration" , "autoscaling:DescribeLaunchConfigurations" , "cloudformation:CreateStack" , "cloudformation:DescribeStacks" , "ec2:AuthorizeSecurityGroupEgress" , "ec2:AuthorizeSecurityGroupIngress" , "ec2:RevokeSecurityGroupEgress" , "ec2:RevokeSecurityGroupIngress" , "ec2:CreateSecurityGroup" , "ec2:createTags" , "ec2:DescribeImages" , "ec2:DescribeKeyPairs" , "ec2:DescribeRegions" , "ec2:DescribeSecurityGroups" , "ec2:DescribeSubnets" , "ec2:DescribeVpcs" , "eks:CreateCluster" , "eks:DescribeCluster" , "iam:AddRoleToInstanceProfile" , "iam:AttachRolePolicy" , "iam:CreateRole" , "iam:CreateInstanceProfile" , "iam:CreateServiceLinkedRole" , "iam:GetRole" , "iam:ListRoles" , "iam:PassRole" , "ssm:GetParameters" ], "Resource" : "*" } ] } ``` **注意:**這些權限使 GitLab 能夠創建資源,但不能刪除它們. 這意味著,如果在創建過程中遇到錯誤,更改將不會回滾,您必須手動刪除資源. 您可以通過刪除相關的[CloudFormation 堆棧](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-delete-stack.html)來做到這一點 10. 點擊**審核政策** . 11. 為此策略輸入合適的名稱,然后點擊**創建策略** . 您現在可以關閉此窗口. 12. 切換回"創建角色"窗口,然后選擇剛創建的策略. 13. 單擊**下一步:標簽** ,并選擇輸入您希望與此角色關聯的任何標簽. 14. 單擊**下一步:查看** . 15. 在提供的字段中輸入角色名稱和可選描述. 16. 點擊**創建角色** ,新角色名稱將顯示在頂部. 單擊其名稱,然后從新創建的角色復制`Role ARN` . 5. 在 GitLab 中,將復制的角色 ARN 輸入到`Role ARN`字段中. 6. Click **使用 AWS 進行身份驗證**. 7. 選擇集群的設置: * **Kubernetes 集群名稱** -您希望賦予集群的名稱. * **環境范圍** -該集群的[關聯環境](index.html#setting-the-environment-scope-premium) . * **Kubernetes 版本** -要使用的 Kubernetes 版本. 當前唯一支持的版本是 1.14\. * **角色名稱** -選擇[IAM 角色](https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html)以允許 Amazon EKS 和 Kubernetes 控制平面代表您管理 AWS 資源. 此 IAM 角色與上面創建的 IAM 角色是分開的,如果尚不存在,則需要創建它. * **區域** -將在其中創建群集的[區域](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) . * **密鑰對名稱** -如果需要,選擇可用于連接到工作節點的[密鑰對](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) . * **VPC-**選擇要用于 EKS 群集資源的[VPC](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) . * **子網** -在您的 VPC 中選擇運行工作節點的[子網](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html) . 您必須至少選擇兩個. * **安全組** -選擇[安全組](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html)以應用到在工作節點子網中創建的 EKS 管理的彈性網絡接口. * **實例類型** -工作節點的[實例類型](https://aws.amazon.com/ec2/instance-types/) . * **節點數** -工作節點數. * **由 GitLab 管理的群集** -如果要讓 GitLab 管理該群集的名稱空間和服務帳戶,請選中此復選框. 有關更多信息,請參見[托管集群部分](index.html#gitlab-managed-clusters) . 8. 最后,單擊**創建 Kubernetes 集群**按鈕. 大約 10 分鐘后,您的集群便可以使用了. 現在,您可以繼續安裝一些[預定義的應用程序](index.html#installing-applications) . **注意:**您需要將 AWS 外部 ID 添加到[AWS CLI 中](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html#cli-configure-role-xaccount)的[IAM 角色,](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html#cli-configure-role-xaccount)才能使用`kubectl`管理集群. ### Troubleshooting creating a new cluster[](#troubleshooting-creating-a-new-cluster "Permalink") 創建新集群時,通常會遇到以下錯誤. #### Error: Request failed with status code 422[](#error-request-failed-with-status-code-422 "Permalink") 提交初始身份驗證表單時,如果無法確定您提供的角色,則 GitLab 會返回狀態碼 422 錯誤. 確保已使用 GitLab 提供的**帳戶 ID**和**外部 ID**正確配置了角色. 在 GitLab 中,確保輸入正確的**Role ARN** . #### Could not load Security Groups for this VPC[](#could-not-load-security-groups-for-this-vpc "Permalink") 當在配置表單中填充選項時,GitLab 將返回此錯誤,因為 GitLab 已成功承擔了您提供的角色,但是該角色沒有足夠的權限來檢索表單所需的資源. 確保已為角色分配了正確的權限. #### `ROLLBACK_FAILED` during cluster creation[](#rollback_failed-during-cluster-creation "Permalink") 由于 GitLab 在創建一個或多個資源時遇到錯誤,因此創建過程停止. 您可以檢查關聯的[CloudFormation 堆棧](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-view-stack-data-resources.html)以查找創建失敗的特定資源. 如果`Cluster`資源因錯誤`The provided role doesn't have the Amazon EKS Managed Policies associated with it.`失敗,則`The provided role doesn't have the Amazon EKS Managed Policies associated with it.` , **角色名稱**中指定的**角色**配置不正確. **注意:**此角色不應與上面創建的角色相同. 如果您沒有現有的[EKS 群集 IAM 角色](https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html) ,則必須創建一個. ## Existing EKS cluster[](#existing-eks-cluster "Permalink") 有關添加現有 EKS 群集的信息,請參閱" [現有 Kubernetes 群集"](add_remove_clusters.html#existing-kubernetes-cluster) . ### Create a default Storage Class[](#create-a-default-storage-class "Permalink") Amazon EKS 沒有開箱即用的默認存儲類,這意味著對持久卷的請求將不會自動滿足. 作為 Auto DevOps 的一部分,已部署的 PostgreSQL 實例將請求持久存儲,并且如果沒有默認存儲類,它將無法啟動. 如果默認的存儲類尚不存在并且需要使用,請按照 Amazon 的[存儲類指南](https://docs.aws.amazon.com/eks/latest/userguide/storage-classes.html)創建一個. 或者,通過將項目變量[`POSTGRES_ENABLED`](../../../topics/autodevops/customize.html#environment-variables)設置為`false`來禁用 PostgreSQL. ### Deploy the app to EKS[](#deploy-the-app-to-eks "Permalink") 在禁用 RBAC 和部署服務的情況下,現在可以利用[Auto DevOps](../../../topics/autodevops/index.html)構建,測試和部署應用程序. 如果尚未啟用,則[啟用 Auto DevOps](../../../topics/autodevops/index.html#at-the-project-level) . 如果創建了通配符 DNS 條目以解析到負載均衡器,請在"自動 DevOps"設置下的" `domain`字段中輸入它. 否則,已部署的應用程序將無法在群集外部從外部獲得. [![Deploy Pipeline](https://img.kancloud.cn/da/5c/da5c27027e5fc60965cde37c393c2b47_1310x262.png)](img/pipeline.png) 將自動創建一個新管道,該管道將開始構建,測試和部署該應用程序. 管道完成后,您的應用將在 EKS 中運行,并可供用戶使用. 單擊**CI / CD>環境** . [![Deployed Environment](https://img.kancloud.cn/eb/ee/ebeeced78dbd5bdec5c3690241d03ae7_2328x440.png)](img/environment.png) 您將看到環境及其部署狀態的列表,以及瀏覽到應用程序,查看監視指標甚至訪問正在運行的 Pod 上的 Shell 的選項.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看