Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc for quickstart #738

Merged
merged 7 commits into from Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
106 changes: 91 additions & 15 deletions docs/content/en/docs/quickstart/_index.md
Expand Up @@ -8,30 +8,106 @@ description: >

This guides you to install PipeCD in your kubernetes and deploy a `helloworld` application to that Kubernetes cluster.

### 1. Installing control plane
### Prerequisites
- Having a Kubernetes cluster
- Installed [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- Installed [helm3](https://helm.sh/docs/intro/install/)
- Forked the [Examples](https://github.com/pipe-cd/examples) repository

### 1. Cloning pipe-cd/manifests repository

Navigate to the root of the repository once cloned.

```bash
git clone https://github.com/pipe-cd/manifests.git
cd manifests
```

### 2. Installing control plane

```bash
helm install pipecd ./manifests/pipecd --values ./quickstart/values-control-plane.yaml
```

### 3. Accessing the PipeCD web
PipeCD comes with an embedded web-based UI.
First up, using kubectl port-forward to expose the installed control-plane on your localhost:

```bash
kubectl port-forward svc/pipecd 8080:443
```

Point your web browser to [http://localhost:8080](http://localhost:8080) to login with the configured static admin account.

![](/images/quickstart-login.png)

Enter the project name, username and password. Be sure to give the following:
- Project Name: `quickstart`
- Username: `hello-pipecd`
- Password: `hello-pipecd`

### 4. Adding an environment
Go to the `Environment` tab at `Settings` page and click on the `Add` button to add a new [Environment](http://localhost:1313/docs/concepts/#environment) to the project.

Then you give the environment name and its description as shown below:

![](/images/quickstart-adding-environment.png)


### 5. Installing a `piped`
Before running a piped, you have to register it on the web and take the generated ID and Key strings.

Navigate to the `Piped` tab on the same page as before, click on the `Add` button. Then you enter as:

![](/images/quickstart-adding-piped.png)

Click on the `Save` button, and then you can see the piped-id and secret-key.
Be sure to keep a copy for later use.

![](/images/quickstart-piped-registered.png)



Open [`./quickstart/values-piped.yaml`](https://github.com/pipe-cd/manifests/blob/master/quickstart/values-piped.yaml) with your editor and:
- replace `FORKED_REPO_URL` with forked repository of [Examples](https://github.com/pipe-cd/examples), such as `https://github.com/YOUR_ORG/examples.git`
- replace `YOUR_PIPED_ID` with the piped-id you have copied before

You can complete the installation by running the following after replacing `YOUR_PIPED_SECRET_KEY` with what you just got:

```bash
helm install pipecd pipecd/pipecd --version=VERSION \
--set quickstart=true \
--set-file config.data=./quickstart/control-plane-config.yaml \
--set-file secret.minioAccessKey.data=./quickstart/credentials/minio-access-key
--set-file secret.minioSecretKey.data=./quickstart/credentials/minio-secret-key
helm install piped ./manifests/piped \
--values ./quickstart/values-piped.yaml \
--set secret.pipedKey.data=YOUR_PIPED_SECRET_KEY
```

### 2. Adding an environment
### 6. Configuring a kubernetes application
Navigate to the `Application` page, click on the `Add` button. Then give as:

![](/images/quickstart-adding-application.png)
nakabonne marked this conversation as resolved.
Show resolved Hide resolved

Go to the `Environment` tab at `Settings` page and click on `Add` button to add a new environment to the project.
While you can see the select box for the deployment config template, skip it at this point.

> TBA
After a bit, the first deployment would be complete automatically to sync the application to the state specified in the current Git commit.

### 3. Registering and installing a `piped`
![](/images/quickstart-first-deployment.png)

> TBA
### 7. Let's deploy!
Let's get started with deployment! All you have to do is to make a PR to update the image tag, scale the replicas, or change the manifests.

### 4. Configuring a kubernetes application
For instance, open the `kubernetes/canary/deployment.yaml` under the forked examples repository, then change the tag from `v0.1.0` to `v0.2.0`.

> TBA
![](/images/quickstart-update-image-tag.png)

### 5. Let's deploy!
After a short wait, a new deployment will be started to update to `v0.2.0`.

> TBA
![](/images/quickstart-deploying.png)

### 8. Cleanup
When you’re finished experimenting with PipeCD, you can uninstall with:

```bash
helm uninstall piped
helm uninstall pipecd
kubectl delete deploy canary
kubectl delete svc canary
```
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/images/quickstart-adding-piped.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/images/quickstart-deploying.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/images/quickstart-login.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions manifests/piped/templates/deployment.yaml
Expand Up @@ -30,6 +30,7 @@ spec:
- --control-plane-address={{ .Values.args.address }}
- --use-fake-api-client={{ .Values.args.useFakeAPI }}
- --enable-default-kubernetes-cloud-provider={{ .Values.args.enableDefaultKubernetesCloudProvider }}
- --insecure={{ .Values.args.insecure }}
ports:
- name: admin
containerPort: 9085
Expand Down
1 change: 1 addition & 0 deletions manifests/piped/values.yaml
Expand Up @@ -3,6 +3,7 @@ args:
metrics: true
useFakeAPI: false
enableDefaultKubernetesCloudProvider: true
insecure: false

service:
enabled: true
Expand Down
12 changes: 0 additions & 12 deletions quickstart/piped-config.yaml

This file was deleted.

Expand Up @@ -18,7 +18,7 @@ config:
accessKeyFile: /etc/pipecd-secret/minio-access-key
secretKeyFile: /etc/pipecd-secret/minio-secret-key
projects:
quickstart:
- id: quickstart
staticAdmin:
username: hello-pipecd
passwordHash: "$2a$10$ye96mUqUqTnjUqgwQJbJzel/LJibRhUnmzyypACkvrTSnQpVFZ7qK" # bcrypt value of "hello-pipecd"
Expand Down
17 changes: 17 additions & 0 deletions quickstart/values-piped.yaml
@@ -0,0 +1,17 @@
args:
insecure: true

config:
data: |
apiVersion: pipecd.dev/v1beta1
kind: Piped
spec:
projectID: quickstart
pipedID: YOUR_PIPED_ID
pipedKeyFile: /etc/piped-secret/piped-key
syncInterval: 1m
repositories:
- repoId: examples
remote: FORKED_REPO_URL
branch: master