Skip to content

[K8s plugin] Add README for k8s plugin#5934

Merged
ffjlabo merged 7 commits into
masterfrom
add-readme-for-k8s-plugin
Jun 10, 2025
Merged

[K8s plugin] Add README for k8s plugin#5934
ffjlabo merged 7 commits into
masterfrom
add-readme-for-k8s-plugin

Conversation

@ffjlabo
Copy link
Copy Markdown
Member

@ffjlabo ffjlabo commented Jun 10, 2025

What this PR does:

as title

Why we need it:

We want to clarify what this plugin is.

Which issue(s) this PR fixes:

Part of #5764

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

ffjlabo added 2 commits June 9, 2025 19:27
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.46%. Comparing base (a19732a) to head (e9792b8).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5934      +/-   ##
==========================================
- Coverage   28.47%   28.46%   -0.01%     
==========================================
  Files         520      520              
  Lines       56408    56419      +11     
==========================================
  Hits        16061    16061              
- Misses      39081    39092      +11     
  Partials     1266     1266              
Flag Coverage Δ
. 23.74% <ø> (-0.01%) ⬇️
.-pkg-app-pipedv1-plugin-example 0.00% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes 66.42% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 67.51% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait 35.51% <ø> (ø)
.-pkg-plugin-sdk 49.14% <ø> (-0.28%) ⬇️
.-tool-actions-gh-release 19.23% <ø> (ø)
.-tool-actions-plan-preview 25.30% <ø> (ø)
.-tool-codegen-protoc-gen-auth 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@ffjlabo ffjlabo marked this pull request as ready for review June 10, 2025 01:38
@ffjlabo ffjlabo requested a review from a team as a code owner June 10, 2025 01:38
Comment on lines +10 to +56
### Quick sync

Quick sync is a fast way to sync application to the state specified in the target Git commit without any progressive strategy. It just applies all the defined manifiests to sync the application.
The quick sync will be planned in one of the following cases:
- no pipeline was specified in the application configuration file
- [pipeline](#pipeline) was specified but the PR did not make any changes on workload (e.g. Deployment's pod template) or config (e.g. ConfigMap, Secret)

For example, the application configuration as below is missing the pipeline field. This means any pull request touches the application will trigger a quick sync deployment.

``` yaml
apiVersion: pipecd.dev/v1beta1
kind: KubernetesApp
spec:
input:
helmChart:
repository: pipecd
name: helloworld
version: v0.3.0
```

In another case, even when the pipeline was specified, a PR that just changes the Deployment's replicas number for scaling will also trigger a quick sync deployment.

### Pipeline sync

The `pipeline` field in the application configuration is used to customize the way to do deployment by specifying and configuring the execution stages. You may want to configure those stages to enable a progressive deployment with a strategy like canary, blue-green, a manual approval, an analysis stage.

To enable customization, PipeCD defines three variants for each Kubernetes application: primary (aka stable), baseline and canary.
- `primary` runs the current version of code and configuration.
- `baseline` runs the same version of code and configuration as the primary variant. (Creating a brand-new baseline workload ensures that the metrics produced are free of any effects caused by long-running processes.)
- `canary` runs the proposed change of code or configuration.

Depending on the configured pipeline, any variants can exist and receive the traffic during the deployment process but once the deployment is completed, only the `primary` variant should be remained.

These are the provided stages for Kubernetes application you can use to build your pipeline:

- `K8S_SYNC`
- sync application to the state specified in the target Git commit without any progressive strategy
- `K8S_PRIMARY_ROLLOUT`
- update the primary resources to the state defined in the target commit
- `K8S_CANARY_ROLLOUT`
- generate canary resources based on the definition of the primary resource in the target commit and apply them
- `K8S_CANARY_CLEAN`
- remove all canary resources
- `K8S_BASELINE_ROLLOUT`
- generate baseline resources based on the definition of the primary resource in the target commit and apply them
- `K8S_BASELINE_CLEAN`
- remove all baseline resources
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| Field | Type | Description | Required |
|-|-|-|-|
| input | [KubernetesDeploymentInput](#kubernetesdeploymentinput) | Input for Kubernetes deployment such as kubectl version, helm version, manifests filter... | No |
| pipeline | [Pipeline](#pipeline) | Pipeline for deploying progressively. | No |
Copy link
Copy Markdown
Member

@t-kikuc t-kikuc Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pipeline not exist

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@t-kikuc
Thank you, fixed on f17cc04

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@ffjlabo ffjlabo requested a review from t-kikuc June 10, 2025 02:00
Quick sync is a fast way to sync application to the state specified in the target Git commit without any progressive strategy. It just applies all the defined manifiests to sync the application.
The quick sync will be planned in one of the following cases:
- no pipeline was specified in the application configuration file
- [pipeline](#pipeline) was specified but the PR did not make any changes on workload (e.g. Deployment's pod template) or config (e.g. ConfigMap, Secret)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this #pipeline link too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed b6a0fcb

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@ffjlabo ffjlabo requested a review from t-kikuc June 10, 2025 02:10
Comment on lines +19 to +29
``` yaml
apiVersion: pipecd.dev/v1beta1
kind: KubernetesApp
spec:
input:
helmChart:
repository: pipecd
name: helloworld
version: v0.3.0
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems v0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@t-kikuc
Thanks. I fixed it, as well as the other mistake in the example.
Also, fixed the overview sentence.
eddc9df

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@ffjlabo ffjlabo requested a review from t-kikuc June 10, 2025 02:38
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Copy link
Copy Markdown
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ffjlabo ffjlabo enabled auto-merge (squash) June 10, 2025 02:56
Copy link
Copy Markdown
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you go 👍

@ffjlabo ffjlabo merged commit 936f512 into master Jun 10, 2025
39 of 40 checks passed
@ffjlabo ffjlabo deleted the add-readme-for-k8s-plugin branch June 10, 2025 15:44
@github-actions github-actions Bot mentioned this pull request Jul 14, 2025
@github-actions github-actions Bot mentioned this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants