Code Monkey home page Code Monkey logo

pr-demo's Introduction

description
PR Pipelines Quickstart

Quickstart

This guide presents a basic introduction to Harness GitOps PR Pipelines. Together, we will:

  1. Create a local Kubernetes cluster.

  2. Install GitOps Agent.

  3. Demonstrate how we can progress changes through multiple environments by interacting with your GitOps repository and ApplicationSet.

  4. Clean up.

Prerequisites

  • Docker
  • kind or k3d: These instructions were tested with:
    • kind: v0.19.0
    • k3d: v5.4.9

Starting a local cluster

kind create cluster \
  --wait 120s \
  --config - <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: pr-quickstart
EOF
k3d cluster create pr-quickstart \
  --no-lb \
  --k3s-arg '--disable=traefik@server:0' \
  --wait

Installing GitOps Agent

  1. In GitOps, click Settings, and then Clusters.

    image

  2. Click New Cluster.

  3. In Name, enter the name appset-example.

  4. In GitOps Agent, select the Agent you installed earlier.

  5. Click Continue.

  6. In Details, click Use the credentials of a specific Harness GitOps Agent.

  7. Click Save and Continue. The connections is verified.

    image

  8. Click Finish.

Dev Application Cluster

We'll add Harness GitOps Clusters for the two target clusters where we want to add our application.

  1. Create a new Harness GitOps Cluster for your dev cluster.

  2. Name the cluster dev.

  3. In GitOps Agent, select the GitOps Agent you added earlier.

    Screenshot 2023-06-06 at 15 26 23

  4. In Details, select Specify Kubernetes Cluster URL and credentials.

  5. In Master URL, enter the Endpoint URL for the target cluster (you can use kubectl cluster-info or your cloud console). Ensure that you use the https:// scheme. Here's an example:

    Screenshot 2023-06-06 at 15 35 40
  6. In Authentication, use the authentication method you prefer. In this tutorial, we use the se-name namespace service-account token.

  7. Click Save and Continue. The GitOps Cluster is verified.

  8. Click Finish.

Screenshot 2023-06-06 at 15 30 34

You might see a Warning status. This status simply indicates that nothing has been deployed to the cluster yet.

Create a GitOps repository

In this step, we will create a GitOps repo on GitHub to house variations of our application manifests for different environments: dev, stage, and prod.

Visit https://github.com/mansong1/pr-demo and fork the repository into your own GitHub account.

You can explore the repository and see that the main branch contains common configuration in a base/ directory as well as environment-specific overlays in paths of the form env/<environment name>/. Kustomize is used as a configuration management tool that combines base configuration with environment-specific configuration.

:::note This layout is typical of a GitOps repository using Kustomize and is not at all Harness specific. :::

Cleaning up

To clean up, we will simply destroy our kind or k3d cluster:

kind delete cluster --name pr-quickstart
k3d cluster delete pr-quickstart

pr-demo's People

Contributors

mansong1 avatar markramm-harness avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.