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

Update docs v1.10 #1346

Merged
merged 3 commits into from
Feb 15, 2025
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.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
145 changes: 145 additions & 0 deletions docs/end-user/definition-version-control.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
title: Definition Version Control
---

## Introduction
KubeVela supports Semantic Versioning for all types of [Definitions](../getting-started/definition), providing control over which versions of Definitions are used in Applications. This feature enables to specify exact version or version range for Definitions, enforce Semantic Versioning, and manage automatic upgrades of Definitions within KubeVela Applications.

## Feature Overview
1. Semantic Versioning for Definition

Definition versions are defined using Semantic Versioning, which follows the format MAJOR.MINOR.PATCH. This ensures control over how components evolve.

2. Auto-Upgrade Control

KubeVela allows control over whether Applications automatically upgrade to newer Definition versions when they are available. The `app.oam.dev/autoUpdate` annotation is used to enable or disable auto-upgrade behavior.

- Auto-update enabled: The application automatically uses the latest compatible version of a Definition.
- Auto-update disabled: The application sticks to the specified version even if a new version of the Definition is released.

3. Version Range Control

You can specify either an exact version or a version range for Definition in your application. If a version range is used, KubeVela will select the latest version that fits within the range.

```
Note: If `app.oam.dev/autoUpdate annotation` is set to `false` or not specified in application, the application will use explicitly specified specified or latest component version.
```

## User Guide
1. Create a `configmap-component` ComponentDefinition with `1.2.5` version
```
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
name: configmap-component
namespace: vela-system
spec:
version: 1.2.5 # Specify the component version using Semantic Versioning
schematic:
cue:
template: |
output: {
apiVersion: "v1"
kind: "ConfigMap"
metadata: {
name: "comptest"
}
data: {
version: "125"
}
}

workload:
definition:
apiVersion: v1
kind: ConfigMap
```

2. Create a `configmap-component` ComponentDefinition with `2.0.5` version
```apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
name: configmap-component
namespace: vela-system
spec:
version: 2.5.0 # Specify the component version using Semantic Versioning
schematic:
cue:
template: |
output: {
apiVersion: "v1"
kind: "ConfigMap"
metadata: {
name: "comptest"
}
data: {
version: "250"
}
}

workload:
definition:
apiVersion: v1
kind: ConfigMap
```
3. List the DefinitionRevisions.
```
kubectl get definitionrevision -n vela-system | grep -i my-component
my-component-v1.2.5 1 1a4f3ac77e4fcfef Component
my-component-v2.5.0 2 e61e9b5e55b01c2b Component
```

4. Create Application using `[email protected]` version and enable the Auto Update using `app.oam.dev/autoUpdate` annotation.
```apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: test-app
namespace: test
annotations:
app.oam.dev/autoUpdate: "true" # Enable automatic upgrades
spec:
components:
- name: test-configmap
type: my-component@v1 # Use the latest version in the 'v1' range
```

Expected Behavior:
- Application will use `[email protected]`, as `1.2.5` is highest version in specified range(`1`).

6. Create a `configmap-component` ComponentDefinition with `1.2.7` version
```
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
name: configmap-component
namespace: vela-system
spec:
version: 1.2.7 # Specify the component version using Semantic Versioning
schematic:
cue:
template: |
output: {
apiVersion: "v1"
kind: "ConfigMap"
metadata: {
name: "comptest"
}
data: {
version: "127"
}
}

workload:
definition:
apiVersion: v1
kind: ConfigMap
```
Expected Behavior:
- After the Application is reconciled, it will use `[email protected]`, as `1.2.7` is the latest version within the specified range (1).

7. List the DefinitionRevisions.
```kubectl get definitionrevision -n vela-system | grep -i my-component
my-component-v1.2.5 1 1a4f3ac77e4fcfef Component
my-component-v1.2.7 3 86d7fb1a36566dea Component
my-component-v2.5.0 2 e61e9b5e55b01c2b Component
````
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
id: 'start',
content:
'<div class="header-item">⭐️ If you like KubeVela, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/kubevela/kubevela">GitHub</a>!⭐️</div>' +
'<div class="header-item"><span>KubeVela v1.9.0 is now available.(2023-06-15)</span> <a target="_blank" style="color: var(--ifm-color-primary)" rel="noopener noreferrer" href="https://github.com/kubevela/kubevela/releases/tag/v1.9.0">Read Release Note</a></div>',
'<div class="header-item"><span>KubeVela v1.10.0 is now available.(2025-02-06)</span> <a target="_blank" style="color: var(--ifm-color-primary)" rel="noopener noreferrer" href="https://github.com/kubevela/kubevela/releases/tag/v1.10.0">Read Release Note</a></div>',
},
algolia: {
appId: 'PXMFHFWUGZ',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Source code of this addon are all here: https://github.com/kubevela/catalog/tree

* [Prometheus Server](../../platform-engineers/operations/observability.md): Collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.
* [Node Exporter](../../platform-engineers/operations/observability.md): Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written in Go with pluggable metric collectors.
* [Mysql Exporter](./mysql-exporter): Prometheus exporter for MySQL server metrics.
* [Mysql Exporter](../../../../../../docs/reference/addons/mysql-exporter): Prometheus exporter for MySQL server metrics.
* [Grafana](../../platform-engineers/operations/observability.md): Grafana is an open source, feature rich metrics dashboard and graph editor for Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.
* [Loki](../../platform-engineers/operations/o11y/logging.md): A log aggregation system designed to store and query logs from all your applications and infrastructure.
* [Kube State Metrics](../../platform-engineers/operations/observability.md): A simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.
Expand Down Expand Up @@ -62,11 +62,11 @@ Source code of this addon are all here: https://github.com/kubevela/catalog/tree

## Storage

* [ChartMuseum](./chartmuseum): An open-source and easy to deploy Helm Chart Repository server.
* [ChartMuseum](../../../../../../docs/reference/addons/chartmuseum): An open-source and easy to deploy Helm Chart Repository server.

## SaaS Workload

* [netlify](./netlify): Netlify is a SaaS platform that can serve website especially for frontend service, it provides free allowances that was pretty cool to be used for demo and test.
* [netlify](../../../../../../docs/reference/addons/netlify): Netlify is a SaaS platform that can serve website especially for frontend service, it provides free allowances that was pretty cool to be used for demo and test.

## Developer Tools

Expand Down
Loading