-
Notifications
You must be signed in to change notification settings - Fork 124
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 Karmada x PipeCD guideline #680
Merged
karmada-bot
merged 1 commit into
karmada-io:main
from
khanhtc1202:add-pipecd-colab-docs
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
--- | ||
title: Working with PipeCD | ||
--- | ||
|
||
This topic walks you through how to use the [PipeCD](https://github.com/pipe-cd/pipecd/) to manage your workload | ||
`across clusters` with `Karmada`. | ||
|
||
## Prerequisites | ||
### PipeCD Installation | ||
|
||
For the purpose of this example, you can install PipeCD follow the [Quickstart](https://pipecd.dev/docs/quickstart/) instructions. | ||
|
||
You can access to `localhost:8080`, login and get the following UI to confirm PipeCD is ready. | ||
|
||
![](../../resources/userguide/cicd/pipecd/pipecd-ready-page.png) | ||
|
||
### Karmada Installation | ||
In this example, we are using a Karmada environment with at least `3` member clusters joined. | ||
|
||
You can set up the environment by `hack/local-up-karmada.sh`, which is also used to run our E2E cases. | ||
|
||
```bash | ||
$ kubectl get clusters | ||
NAME VERSION MODE READY AGE | ||
member1 v1.19.1 Push True 18h | ||
member2 v1.19.1 Push True 18h | ||
member3 v1.19.1 Pull True 17h | ||
``` | ||
|
||
## Install and configure PipeCD agent (piped) to make it works with Karmada | ||
|
||
This step install the PipeCD agent `piped` and configure it to connect the Karmada API server. | ||
|
||
In this example, for simplicity we follow the instruction at [Install piped on a single machine](https://pipecd.dev/docs/installation/install-piped/installing-on-single-machine/). The piped will be installed in your local machine, and use the `karmada-apiserver` context to connect with the Karmada control plane. | ||
|
||
Access [localhost:8080/settings/piped?project=quickstart](http://localhost:8080/settings/piped?project=quickstart) from your browser, and register information for a new piped. | ||
|
||
Prepare piped configuration yaml as below and save it as `piped-config.yaml` | ||
|
||
```yaml | ||
apiVersion: pipecd.dev/v1beta1 | ||
kind: Piped | ||
spec: | ||
projectID: quickstart | ||
pipedID: <YOUR_PIPED_ID> | ||
pipedKeyData: <YOUR_PIPED_KEY_DATA> | ||
apiAddress: localhost:8080 | ||
syncInterval: 1m | ||
repositories: | ||
- repoId: examples | ||
remote: <YOUR_MANIFEST_REPO_URL> | ||
branch: master | ||
platformProviders: | ||
- name: karmada-dev | ||
type: KUBERNETES | ||
config: | ||
kubeConfigPath: $HOME/.kube/karmada.config | ||
appStateInformer: | ||
includeResources: | ||
- apiVersion: policy.karmada.io/v1alpha1 | ||
kind: PropagationPolicy | ||
- apiVersion: work.karmada.io/v1alpha2 | ||
kind: ResourceBinding | ||
- apiVersion: work.karmada.io/v1alpha1 | ||
kind: Work | ||
``` | ||
|
||
For `<YOUR_PIPED_ID>` and `<YOUR_PIPED_KEY_DATA>`, please refer to [installing piped](https://pipecd.dev/docs-v0.48.x/quickstart/#12-installing-piped) docs. | ||
|
||
For the `<YOUR_MANIFEST_REPO_URL>` you can fork from [the PipeCD examples repo](https://github.com/pipe-cd/examples). | ||
|
||
Next, download the piped binary from the PipeCD official GitHub repo | ||
|
||
```bash | ||
# OS="darwin" or "linux" | ||
$ curl -Lo ./piped https://github.com/pipe-cd/pipecd/releases/download/v0.48.8/piped_v0.48.8_{OS}_amd64 | ||
$ chmod +x piped | ||
``` | ||
|
||
Then you can start running your piped agent on your machine, which can connect to the PipeCD control plane dashboard and delivery your application to the Karmada fleet clusters. | ||
|
||
```bash | ||
$ ./piped piped --config-file=piped-config.yaml --insecure=true | ||
``` | ||
|
||
Note: The `--insecure=true` is required since we connect to the PipeCD control plane without SSL in the quickstart mode. | ||
|
||
Once, your piped is ready, you can see its status in the [localhost:8080/settings/piped?project=quickstart](http://localhost:8080/settings/piped?project=quickstart) page as below | ||
|
||
![](../../resources/userguide/cicd/pipecd/piped-ready-status.png) | ||
|
||
## Creating Apps Via UI | ||
|
||
### Preparing Apps | ||
|
||
In the previous step, suppose you prepared a manifest repository under `<YOUR_MANIFEST_REPO_URL>`. | ||
|
||
Next, you have to prepare a directory contains manifests for your application like this [canary-multicluster-karmada](https://github.com/khanhtc1202/pipecd-examples/tree/master/kubernetes/canary-multicluster-karmada) directory. | ||
|
||
This directory includes: | ||
- `app.pipecd.yaml`: configuration used by piped to perform deploy tasks | ||
- `propagationpolicy.yaml`: configuration used by Karmada to delivery your app resources to member clusters | ||
- `deployment and service`: raw Kubernetes manifests | ||
|
||
### Creating Apps | ||
|
||
Access [localhost:8080/applications?project=quickstart](http://localhost:8080/applications?project=quickstart) to create a new application. | ||
|
||
Click the `+App` button as shown below: | ||
|
||
![](../../resources/userguide/cicd/pipecd/pipecd-add-new-app.png) | ||
|
||
From the `ADD FROM SUGGESTIONS` form, select value from selection box to register your application information as show in the picture | ||
|
||
|
||
![](../../resources/userguide/cicd/pipecd/pipecd-new-app-info.png) | ||
|
||
Click `Save` in the form and confirmation box, and your app will be registered successfully and ready to go. | ||
|
||
![](../../resources/userguide/cicd/pipecd/pipecd-add-app-done.png) | ||
|
||
### Syncing Apps | ||
|
||
You don't need to do anything! After registered the application, PipeCD will automatically trigger the first deployment for it under Quick Sync strategy (for more about PipeCD sync strategy, refer to [docs](https://pipecd.dev/docs-v0.48.x/concepts/#sync-strategy)). | ||
|
||
![](../../resources/userguide/cicd/pipecd/pipecd-app-first-sync.png) | ||
|
||
You can check the detailed log of the deployment by access [localhost:8080/deployments?project=quickstart](http://localhost:8080/deployments?project=quickstart), then navigate to your application deployment detail page. | ||
|
||
![](../../resources/userguide/cicd/pipecd/pipecd-app-first-deploy.png) | ||
|
||
PipeCD supports many approach to trigger new deployment for your application, please refer to [trigger deployment docs](https://pipecd.dev/docs/user-guide/managing-application/triggering-a-deployment/). | ||
|
||
### Check detailed status | ||
|
||
Via the PipeCD control plane application detailed page, you can check the application resources status. | ||
|
||
Access [localhost:8080/applications?project=quickstart](http://localhost:8080/applications?project=quickstart) and navigate to your application page for detail. | ||
|
||
![](../../resources/userguide/cicd/pipecd/pipecd-app-detail-page.png) | ||
|
||
That's all! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to explain how to set the
YOUR_PIPED_ID
andYOUR_PIPED_KEY_DATA
a little bit?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I referenced the quickstart docs for pipecd installation in the previous section already, so I think users are already know with it us up to this place. wdyt? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just update it to
test
as you give an example with that ID.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since that place requires not the piped name but the piped ID, which is different depending on users in the registered time, I think it could be less confusing if we keep it as is instead of mentioning the
test
piped name here. Users would also know that they need to find their<YOUR_PIPED_ID>
and<YOUR_PIPED_KEY_DATA>
, which could be found if they follow the quickstart docs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if you still think it could be less confusing with the explanation, I can add something like
WDYT? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better now. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed by 0fdbb78 🙏