gitlab ci使用_用gitlab ci和argocd在kubernetes中创建gitops

gitlab ci使用Just a simple word, 只是一个简单的词, it is how you do DevOps in Git. 这就是您在Git中进行DevOps的方式。 You store and manage your deployments in Git repositories. With this, you will leverage the version-cont...
摘要由CSDN通过智能技术生成

gitlab ci使用

Just a simple word,

只是一个简单的词,

it is how you do DevOps in Git.

这就是您在Git中进行DevOps的方式。

You store and manage your deployments in Git repositories. With this, you will leverage the version-control system for tracking changes in the deployments and coordinating work among infrastructure teams like how programmers do. When you have everything declaratively configured as a code in the Git system, this Git centralized workflow allows you to manage the infrastructure at scale, and set the stage for accelerating automation, i.e., “Git as a single source of truth”.

您可以在Git存储库中存储和管理部署。 这样,您将利用版本控制系统来跟踪部署中的更改,并在基础架构团队之间协调程序员的工作,从而协调工作。 当您在Git系统中将所有内容声明性地配置为代码时,此Git集中式工作流程将使您能够大规模管理基础架构,并为加速自动化打下基础,即“将Git作为单一事实来源”。

In this example, we are going to learn how to construct the GitOps workflow from end-to-end using GitLab CI, ArgoCD with Helm Chart. This series is based on the following components:

在此示例中,我们将学习如何使用带有Helm Chart的GitLab CI,ArgoCD端到端构建GitOps工作流程。 本系列基于以下组件:

  • GitLab CI Pipeline

    亚搏体育app CI Pipeline

  • Kubernetes template using Helm chart

    使用Helm图表的Kubernetes模板

  • Continuous Deployment using ArgoCD

    使用ArgoCD进行连续部署

先决条件 (Prerequisites)

Before we begin, you need to have the Kubernetes cluster set up and running. If not, you can follow this instruction on my previous post on how to set up the K8s cluster using Kubespray.

在开始之前,您需要先设置并运行Kubernetes集群 。 如果没有,您可以按照我以前的文章中有关如何使用Kubespray设置K8s集群的说明进行操作

Image for post

An ingress controller (e.g., Nginx) is also required to access the ArgoCD dashboard and deployed web application. Plus, through this guide, we are going to use the K8S Lens IDE as it helps to operate the cluster a lot easier.

还需要一个入口控制器 (例如Nginx )来访问ArgoCD仪表板和已部署的Web应用程序。 另外,通过本指南,我们将使用K8S Lens IDE,因为它有助于更​​轻松地操作群集。

1. ArgoCD (1. ArgoCD)

A declarative, GitOps continuous delivery tool for Kubernetes. argoproj.github.io/argo-cd

用于Kubernetes的声明性GitOps连续交付工具。 argoproj.github.io/argo-cd

1.1。 配置 (1.1. Setting Up)

Repositories: Helm Chart: argo/argo-cd, GitHub: argoproj/argo-helm/charts/argo-cd

仓库: Helm Chart: argo / argo-cd ,GitHub: argoproj / argo-helm / charts / argo-cd

$ kubectl create namespace argocd
$ helm repo add argo https://argoproj.github.io/argo-helm

For extra helm values configuration to access the server UI you have the following options:

要进行额外的头盔值配置以访问服务器UI,您可以使用以下选项:

  1. kubectl port-forward service/argocd-server -n argocd 8080:443 then open the browser on http://localhost:8080 and accept the certificate.

    kubectl port-forward service/argocd-server -n argocd 8080:443然后在http:// localhost:8080上打开浏览器并接受证书。

  2. Enable ingress in the values file service.ingress and add the annotation for ssl passthrough:

    在值文件service.ingress启用入口,并为ssl passthrough添加注释:

Note that I also add --insecure flag to run with TLS disabled and set the installCRDs value to false to avoid nonexistant webhooks.

请注意,我还添加了--insecure标志以在禁用TLS的情况下运行,并将installCRDs值设置为false 以避免不存在的webhooks

installCRDs: false
server:
  extraArgs:
  - --insecure
  service: 
    type: ClusterIP
  ingress:
    enabled: true
    annotations:
      - kubernetes.io/ingress.class: nginx
      - nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
      - nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    hosts:
      - argocd.gitops.local
    paths:
      - /
kubectl create namespace argocd
helm repo add argo https://argoproj.github.io/argo-helm
# extra values file is based on this gist
# https://gist.github.com/pcrete/250896d4ff90ce2afa496c9f515b6be5
helm install argocd argo/argo-cd \
-f https://gist.githubusercontent.com/pcrete/250896d4ff90ce2afa496c9f515b6be5/raw/0057742a532e8dfd578c139385537cd39de07f03/argocd-values.yaml \
--version 2.6.0 \
--namespace argocd
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值