Working with PipeCD

This topic walks you through how to use the 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 instructions.

You can access to localhost:8080, login and get the following UI to confirm PipeCD is ready.

Working with PipeCD - 图1

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.

  1. $ kubectl get clusters
  2. NAME VERSION MODE READY AGE
  3. member1 v1.19.1 Push True 18h
  4. member2 v1.19.1 Push True 18h
  5. 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. 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 from your browser, and register information for a new piped.

Prepare piped configuration yaml as below and save it as piped-config.yaml

  1. apiVersion: pipecd.dev/v1beta1
  2. kind: Piped
  3. spec:
  4. projectID: quickstart
  5. pipedID: <YOUR_PIPED_ID>
  6. pipedKeyData: <YOUR_PIPED_KEY_DATA>
  7. apiAddress: localhost:8080
  8. syncInterval: 1m
  9. repositories:
  10. - repoId: examples
  11. remote: <YOUR_MANIFEST_REPO_URL>
  12. branch: master
  13. platformProviders:
  14. - name: karmada-dev
  15. type: KUBERNETES
  16. config:
  17. kubeConfigPath: $HOME/.kube/karmada.config
  18. appStateInformer:
  19. includeResources:
  20. - apiVersion: policy.karmada.io/v1alpha1
  21. kind: PropagationPolicy
  22. - apiVersion: work.karmada.io/v1alpha2
  23. kind: ResourceBinding
  24. - apiVersion: work.karmada.io/v1alpha1
  25. kind: Work

For <YOUR_PIPED_ID> and <YOUR_PIPED_KEY_DATA>, please refer to installing piped docs.

For the <YOUR_MANIFEST_REPO_URL> you can fork from the PipeCD examples repo.

Next, download the piped binary from the PipeCD official GitHub repo

  1. # OS="darwin" or "linux"
  2. $ curl -Lo ./piped https://github.com/pipe-cd/pipecd/releases/download/v0.48.8/piped_v0.48.8_{OS}_amd64
  3. $ 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.

  1. $ ./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 page as below

Working with PipeCD - 图2

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 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 to create a new application.

Click the +ADD button as shown below:

Working with PipeCD - 图3

From the ADD FROM SUGGESTIONS form, select value from selection box to register your application information as show in the picture

Working with PipeCD - 图4

Click SAVE in the form and confirmation box, and your app will be registered successfully and ready to go.

Working with PipeCD - 图5

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).

Working with PipeCD - 图6

You can check the detailed log of the deployment by access localhost:8080/deployments?project=quickstart, then navigate to your application deployment detail page.

Working with PipeCD - 图7

PipeCD supports many approach to trigger new deployment for your application, please refer to trigger deployment docs.

Check detailed status

Via the PipeCD control plane application detailed page, you can check the application resources status.

Access localhost:8080/applications?project=quickstart and navigate to your application page for detail.

Working with PipeCD - 图8

That’s all!