如何为私有GKE集群启用Gitlab CI/CD? [英] How to enable Gitlab CI/CD for Private GKE cluster?

查看:113
本文介绍了如何为私有GKE集群启用Gitlab CI/CD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置Gitlab CI/CD的AutoDevops功能,为此,我试图将现有的kubernetes集群设置为我的环境.

I would like to setup the AutoDevops functionality of Gitlab CI/CD, and for that I am trying to setup the existing kubernetes cluster as my environment.

但是,Gitlab需要使用Kubernetes Master API URL来访问Kubernetes API. Kubernetes 公开了几个API,我们想要所有这些API都通用的基本" URL, 例如, https://kubernetes.example.com 而不是

However, the Gitlab requires Kubernetes Master API URL that uses to access the Kubernetes API. Kubernetes exposes several APIs, we want the "base" URL that is common to all of them, e.g., https://kubernetes.example.com rather than https://kubernetes.example.com/api/v1. we will get the API URL by running this command:

kubectl cluster-info | grep 'Kubernetes master' | awk '/http/ {print $NF}

返回一个https://

which returns a https://

就我而言,我有一个专用IP,即 https://172.10.1.x

in my case, I have a private Ip which is https://172.10.1.x

没有任何文档可帮助为私有GKE集群设置gitlab CI.

There aren't any documentations to help setup the gitlab CI for a Private GKE cluster.

如何在正在运行的VM实例或Pod的服务IP的帮助下将gitlab设置为访问我的kubernetes主服务器?或者,如果有解决方案/解决方法的建议,请提供帮助.

How can I set the gitlab to access my kubernetes master with the help of a running VM instance or a pod's service IP ? or if there are any solutions/workarounds suggestions to achieve this, please help.

将现有GKE群集添加为环境

推荐答案

现在(2020年9月)有替代方案,但它不是免费的(仅限GitLab.com Premium/Ultimate)

There is now (Sept. 2020) an alternative, but it is not free (GitLab.com Premium/Ultimate only)

请参见

介绍GitLab Kubernetes代理

GitLab的Kubernetes集成长期以来使无需手动设置即可部署到Kubernetes集群.许多用户都喜欢易用性,而其他用户则遇到了一些挑战.

Introducing the GitLab Kubernetes Agent

GitLab’s Kubernetes integration has long enabled deployment to Kubernetes clusters without manual setup. Many users have enjoyed the ease-of-use, while others have run into some challenges.

当前的集成要求您的集群对Internet开放,以便GitLab访问它.对于许多组织来说,这是不可能的,因为他们必须出于安全性,合规性或监管目的而锁定群集访问.要解决这些限制,用户需要在GitLab之上创建自定义工具,否则他们将无法使用该功能.

The current integration requires your cluster to be open to the Internet for GitLab to access it. For many organizations, this isn’t possible, because they must lock down their cluster access for security, compliance, or regulatory purposes. To work around these restrictions, users needed to create custom tooling on top of GitLab, or they couldn’t use the feature.

今天,我们发布了GitLab Kubernetes代理:一种部署到Kubernetes集群的新方法.该代理在您的群集中运行,因此您无需将其打开到互联网.代理通过从GitLab提取新更改来协调部署,而不是GitLab将更新推送到集群.无论您使用哪种GitOps方法,GitLab都可以满足您的要求.

Today, we’re announcing the GitLab Kubernetes Agent: a new way to deploy to Kubernetes clusters. The Agent runs inside of your cluster, so you don’t need to open it to the internet. The Agent orchestrates deployments by pulling new changes from GitLab, rather than GitLab pushing updates to the cluster. No matter what method of GitOps you use, GitLab has you covered.

请注意,这是该代理程序的第一个版本.当前,GitLab Kubernetes代理具有配置驱动的设置,并可以通过代码进行部署管理.尚不支持某些现有的Kubernetes集成功能,例如Deploy Boards和GitLab Managed Apps. 我们的愿景是最终实现这些功能,并提供新的安全性和合规性-与Agent集中集成.

Note this is the first release of the Agent. Currently, the GitLab Kubernetes Agent has a configuration-driven setup, and enables deployment management by code. Some existing Kubernetes integration features, such as Deploy Boards and GitLab Managed Apps, are not yet supported. Our vision is to eventually implement these capabilities, and provide new security- and compliance-focused integrations with the Agent.

https://about.gitlab.com/images/13_4/gitops -header.png -引入了GitLab Kubernetes代理

https://about.gitlab.com/images/13_4/gitops-header.png -- Introducing the GitLab Kubernetes Agent

请参见文档


另请参见


See also GitLab 13.5 (October 2020)

通过Omnibus GitLab安装GitLab Kubernetes代理

上个月,我们针对以下产品推出了 GitLab Kubernetes代理随Helm安装的自我管理的GitLab实例.

Install the GitLab Kubernetes Agent with Omnibus GitLab

Last month we introduced the GitLab Kubernetes Agent for self-managed GitLab instances installed with Helm.

此版本增加了对官方Linux软件包的支持.

This release adds support for the official Linux package.

在这种新的Kubernetes集成中,代理通过从GitLab提取新更改来协调部署,而不是GitLab将更新推送到您的集群.

In this new Kubernetes integration, the Agent orchestrates deployments by pulling new changes from GitLab, rather than GitLab pushing updates to your cluster.

您可以详细了解 Kubernetes代理现在如何工作,以及查看我们的愿景,看看店里有什么.

You can learn more about how the Kubernetes Agent works now and check out our vision to see what’s in store.

请参见文档 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆