Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ style = "tango"
[[menu.main]]
# This section add 'Tutorial' to the header navigation bar.
name = "Tutorial"
url = "https://github.com/pipe-cd/tutorial"
url = "/docs-v0.50.x/tutorial/"
weight = 25

[params]
Expand Down
38 changes: 38 additions & 0 deletions docs/content/en/docs-v0.50.x/tutorial/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "Tutorial"
linkTitle: "Tutorial"
weight: 2
description: >
A hands-on introduction to PipeCD for beginners (30m-1h).
---

This is a hands-on introduction to PipeCD for the beginners.

## The Goal

By the end of this tutorial, you will be able to:

- Understand the basic mechanism of PipeCD
- Experiment with PipeCD
- Deploy with your pipeline in GitOps style

This is **NOT** intended for those who right now want to:

- Install PipeCD in a production-ready way (See [Docs > Installation](../installation/))
- Develop and test PipeCD (See [CONTRIBUTING.md](https://github.com/pipe-cd/pipecd/blob/master/CONTRIBUTING.md))

## What You Will Do

You will run PipeCD on local and deploy by it. The architecture is as below:

![Architecture in the tutorial](/images/tutorial/architecture.svg)

1. [Mechanism Overview](./overview/): Quickly learn about the basic mechanism
2. [Prerequisites](./prerequisites/): What you need before the tutorial.
3. [Install](./install/): Install PipeCD on local.
4. [Deploy](./deploy/): Deploy and customize the pipeline.
5. [Next Step](./next-step/): Next actions after the tutorial.

## See Also

- [PipeCD Docs](../../docs-v0.50.x/)
27 changes: 27 additions & 0 deletions docs/content/en/docs-v0.50.x/tutorial/deploy/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: "Deploy"
linkTitle: "Deploy"
weight: 4
description: >
Deploy applications using your local PipeCD.
---

In this chapter, you will deploy applications by your local PipeCD.

The deployment flow is like this:

1. You edit the config.
2. You push the config to remote.
3. Your Piped detects the config change on remote.
4. Your Piped deploys.

This chapter consists of 2 steps:

1. [Deploy Simply](./deploy-simply/): Deploy an application in a simple way.
2. [Deploy with a Customized Pipeline](./deploy-with-pipeline/): Customize the deployment pipeline.

---

[Next: 1. Deploy Simply >](./deploy-simply/)

[< Previous: 3. Install Piped](../install/install-piped/)
99 changes: 99 additions & 0 deletions docs/content/en/docs-v0.50.x/tutorial/deploy/deploy-simply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: "1. Deploy Simply"
linkTitle: "1. Deploy Simply"
weight: 1
description: >
Deploy an application to your platform in a simple way.
---

# 1. Deploy Simply

In this page, you will deploy an application to your platform in a simple way.

## 1. Prepare config files

1-1. Edit configuration files of one platform under `/src/deploy/` in your cloned repository as bellow.

> **Note:** Each platform has a deployment config file (`app.pipecd.yaml`) + platform specific files.

- For **Kubernetes**:
- You will run a [helloworld](https://github.com/pipe-cd/pipecd/pkgs/container/helloworld) service.
- Use `kubernetes/simple/`. You do not need to edit.
- For **Google Cloud Run**:
- You will run a [helloworld](https://github.com/pipe-cd/pipecd/pkgs/container/helloworld) service.
- Use `cloudrun/simple/`. You do not need to edit.
- For **Amazon ECS**:
- You will run an nginx service.
- Edit `ecs/simple/` as below.
- `app.pipecd.yaml`: Edit `targetGroupArn`.
- `servicedef.yaml`: Edit `cluster`, `securityGroups`, and `subnets`.
- `taskdef.yaml`: Edit `executionRoleArn`.
- For **AWS Lambda**:
- You will create a function of your own image.
- Edit `lambda/simple/` as below.
- `function.yaml`: Edit `role` and `image`.
- For **Terraform**:
- You will generate a file on local.
- Edit `terraform/simple/` as below.
- `main.tf`: Edit `path` and `filename`.

1-2. Commit and push the changes to remote.


## 2. Register the application

2-1. Go to the applications page. [http://localhost:8080](http://localhost:8080)

2-2. Click `+ ADD`.

2-3. Enter values and click `SAVE`->`SAVE`.
- `Piped`: Your Piped
- `Platform Provider`: The platform
- `Application`: The application you configured in [1.](#1-prepare-config-files)

![add-application-input](/images/tutorial/deploy/application-add-input.png)

2-4. If successful, you will see the dialog like the following image.

![application-is-added](/images/tutorial/deploy/application-is-added.png)


## 3. Watch the first deployment

3-1. Go to the deployments page. [http://localhost:8080/deployments](http://localhost:8080/deployments)

3-2. Wait until a new deployment automatically appears. Then click it to see details.

> **Note:** You do NOT need to invoke a deployment by yourself since your Piped automatically starts it. **This is GitOps.**

![deployment-before-appear](/images/tutorial/deploy/deployment-before-appear.png)
![deployment-appear](/images/tutorial/deploy/deployment-appear.png)


3-3. Wait until the status becomes `SUCCESS`/`FAILURE`. If it shows `FAILURE`, check the log in the page.

![deployment-deploying](/images/tutorial/deploy/deployment-deploying.png)


3-4. When the status becomes `SUCCESS`, the deployment is successfully finished.

![deployment-success](/images/tutorial/deploy/deployment-success.png)

3-5. Check your platform (Kubernetes cluster, cloud console, etc.) to confirm the result.


## 4. Edit the config and watch a new deployment

4-1. Edit the config file you deployed. (e.g. Change the image tag, sizing, etc.)

4-2. Commit and push the change to remote.

4-3. Go to the deployments page again. [http://localhost:8080/deployments](http://localhost:8080/deployments)

4-4. A new deployment will start in a few minutes.

---

[Next: Deploy with a Customized Pipeline >](../deploy-with-pipeline/)

[< Previous: Deploy](../)
102 changes: 102 additions & 0 deletions docs/content/en/docs-v0.50.x/tutorial/deploy/deploy-with-pipeline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: "2. Deploy with a Customized Pipeline"
linkTitle: "2. Deploy with Pipeline"
weight: 2
description: >
Customize the deployment pipeline with strategies like canary or blue/green.
---

# 2. Deploy with a Customized Pipeline

In this page, you will customize the deployment pipeline by editing the `app.pipecd.yaml` deployment configuration.

## Overview

In the previous step, you deployed an application using the default pipeline (Quick Sync).
PipeCD also supports customized pipelines with stages such as:

- **K8S_CANARY_ROLLOUT** / **ECS_CANARY_ROLLOUT**: Deploy a canary version alongside the stable version.
- **K8S_TRAFFIC_ROUTING** / **ECS_TRAFFIC_ROUTING**: Shift traffic between the stable and canary versions.
- **WAIT_APPROVAL**: Pause the pipeline until a manual approval is given on the console.
- **ANALYSIS**: Automatically analyze metrics to determine the deployment's health.
- **K8S_PRIMARY_ROLLOUT** / **ECS_PRIMARY_ROLLOUT**: Promote the canary version to primary.
- **K8S_CANARY_CLEAN** / **ECS_CANARY_CLEAN**: Clean up the canary resources.

## Steps

### 1. Edit `app.pipecd.yaml`

Edit the `app.pipecd.yaml` in the directory of the platform you deployed in the previous step.

For example, for **Kubernetes**, edit `src/deploy/kubernetes/simple/app.pipecd.yaml`:

```yaml
apiVersion: pipecd.dev/v1beta1
kind: KubernetesApp
spec:
name: tutorial-kubernetes-simple
pipeline:
stages:
- name: K8S_CANARY_ROLLOUT
with:
replicas: 50%
- name: WAIT_APPROVAL
with:
approvers:
- hello-pipecd
- name: K8S_PRIMARY_ROLLOUT
- name: K8S_CANARY_CLEAN
```

For **Amazon ECS**, edit `src/deploy/ecs/simple/app.pipecd.yaml`:

```yaml
apiVersion: pipecd.dev/v1beta1
kind: ECSApp
spec:
name: tutorial-ecs-simple
pipeline:
stages:
- name: ECS_CANARY_ROLLOUT
with:
scale: 50%
- name: WAIT_APPROVAL
with:
approvers:
- hello-pipecd
- name: ECS_PRIMARY_ROLLOUT
- name: ECS_CANARY_CLEAN
```

### 2. Edit a manifest

Make some change to the manifest file as well (e.g., update the image tag or replica count) so that Piped detects a new change to deploy.

### 3. Push and watch

1. Commit and push the changes to remote.

```sh
git add .
git commit -m "Add pipeline stages"
git push origin main
```

2. Go to the deployments page. [http://localhost:8080/deployments](http://localhost:8080/deployments)

3. A new deployment will start in a few minutes. You will see the pipeline stages in the deployment details.

4. When the pipeline reaches the `WAIT_APPROVAL` stage, click `APPROVE` on the console to continue.

5. After approval, the remaining stages will execute automatically.

## See Also

- [Configuring Deployment Pipeline](https://pipecd.dev/docs/user-guide/managing-application/customizing-deployment/)
- [Pipeline Stages Reference](https://pipecd.dev/docs/user-guide/managing-application/customizing-deployment/)

---

[Next: Congratulations! >](../../tutorial/next-step/)

[< Previous: Deploy Simply](../deploy-simply/)
21 changes: 21 additions & 0 deletions docs/content/en/docs-v0.50.x/tutorial/install/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Install"
linkTitle: "Install"
weight: 3
description: >
Install PipeCD Control Plane and Piped on your local environment.
---

In this chapter, you will run a Control Plane and a Piped locally.

The installation consists of 3 steps:

1. [Setup Git Repository](./setup-git-repository/)
2. [Install Control Plane](./install-control-plane/)
3. [Install Piped](./install-piped/)

---

[Next: 1. Setup Git Repository >](./setup-git-repository/)

[< Previous: Prerequisites](../prerequisites/)
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: "2. Install Control Plane"
linkTitle: "2. Install Control Plane"
weight: 2
description: >
Install a Control Plane on local by docker-compose.
---

# 2. Install Control Plane

In this page, you will install a Control Plane on local by `docker-compose`.

## Installation

1. Execute the following command on your `src/install/control-plane/docker-compose.yaml`.
```sh
docker-compose up
```

After the command, you will see logs as below.
```log
pipecd-server-1 | successfully loaded control-plane configuration
pipecd-server-1 | successfully connected to file store
pipecd-server-1 | successfully connected to data store
pipecd-server-1 | grpc server will be run without tls
pipecd-server-1 | grpc server will be run without tls
pipecd-server-1 | grpc server is running on [::]:9080
pipecd-server-1 | grpc server is running on [::]:9083
pipecd-server-1 | grpc server will be run without tls
pipecd-server-1 | admin server is running on 9085
pipecd-server-1 | grpc server is running on [::]:9081
pipecd-server-1 | start running http server on :9082
```

## Confirmation

1. Access the console running on [http://localhost:8080](http://localhost:8080)
2. Enter the following value and click `CONTINUE`.
- `Project Name`: `tutorial`

![signin-project](/images/tutorial/install/signin-project.png)

3. Enter the following values and click `LOGIN`.
- `Username`: `hello-pipecd`
- `Password`: `hello-pipecd`

![signin-user](/images/tutorial/install/signin-user.png)

4. If successful, the following page will appear.

![applications-page](/images/tutorial/install/applications.png)


## See Also

- [Architecture Overview](https://pipecd.dev/docs/user-guide/managing-controlplane/architecture-overview/)
- [Managing Control Plane](https://pipecd.dev/docs/user-guide/managing-controlplane/)
- [Installing Control Plane on Kubernetes](https://pipecd.dev/docs/installation/install-control-plane/installing-controlplane-on-k8s/)

---

[Next: 3. Install Piped >](../install-piped/)

[< Previous: 1. Setup Git Repository](../setup-git-repository/)
Loading
Loading