Skip to content

Commit c0f7425

Browse files
authored
[apps] Use cozyvalues-gen with packages/apps/* (#1321)
- clickhouse - ferretdb - http-cache - kafka - kubernetes - mysql - nats - rabbitmq - redis - tcp-balancer - vm-disk - vm-instance - vpn Signed-off-by: Nick Volynkin <[email protected]> <!-- Thank you for making a contribution! Here are some tips for you: - Start the PR title with the [label] of Cozystack component: - For system components: [platform], [system], [linstor], [cilium], [kube-ovn], [dashboard], [cluster-api], etc. - For managed apps: [apps], [tenant], [kubernetes], [postgres], [virtual-machine] etc. - For development and maintenance: [tests], [ci], [docs], [maintenance]. - If it's a work in progress, consider creating this PR as a draft. - Don't hesistate to ask for opinion and review in the community chats, even if it's still a draft. - Add the label `backport` if it's a bugfix that needs to be backported to a previous version. --> ## What this PR does ### Release note <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same [label] as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note [] ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Many apps now present structured, typed configuration blocks (backup, keeper/quorum, JetStream, HAProxy/Nginx/httpAndHttps, nodeGroups/addons, topics, users, etc.) for clearer per-field types and presets. * **Documentation** * README, values.yaml and JSON schemas updated with Type columns, enums, validation, nested fields and examples; some backup schema requirements relaxed. * **Chores** * Generation consolidated to cozyvalues-gen (v0.8.5); CI matrix set to not fail-fast; e2e VM data disk size increased. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 39fb4ec + 168a24f commit c0f7425

70 files changed

Lines changed: 2913 additions & 1398 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/pre-commit.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ jobs:
2828

2929
- name: Install generate
3030
run: |
31-
curl -sSL https://github.com/cozystack/readme-generator-for-helm/releases/download/v1.0.0/readme-generator-for-helm-linux-amd64.tar.gz | tar -xzvf- -C /usr/local/bin/ readme-generator-for-helm
32-
curl -sSL https://github.com/cozystack/cozyvalues-gen/releases/download/v0.8.1/cozyvalues-gen-linux-amd64.tar.gz | tar -xzvf- -C /usr/local/bin/ cozyvalues-gen
31+
curl -sSL https://github.com/cozystack/cozyvalues-gen/releases/download/v0.8.5/cozyvalues-gen-linux-amd64.tar.gz | tar -xzvf- -C /usr/local/bin/ cozyvalues-gen
3332
3433
- name: Run pre-commit hooks
3534
run: |

‎.github/workflows/pull-requests.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ jobs:
269269
270270
test_apps:
271271
strategy:
272+
fail-fast: false
272273
matrix: ${{ fromJson(needs.detect_test_matrix.outputs.matrix) }}
273274
name: Test ${{ matrix.app }}
274275
runs-on: [self-hosted]

‎hack/cozytest.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ run_one() {
2424

2525
echo "╭ » Run test: $title"
2626
START=$(date +%s)
27-
skip_next="+ $fn" # первую строку трассировки с именем функции пропустим
27+
skip_next="+ $fn"
2828

2929
{
3030
(
@@ -83,11 +83,11 @@ awk '
8383
}
8484
printf("### %s\n", title)
8585
printf("%s() {\n", fname)
86-
print " set -e" # ошибка → падение теста
86+
print " set -e"
8787
next
8888
}
8989
/^}$/ {
90-
print " return 0" # если автор не сделал exit 1 — тест ОК
90+
print " return 0"
9191
print "}"
9292
next
9393
}

‎hack/e2e-apps/run-kubernetes.sh‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ spec:
5757
instanceType: u1.medium
5858
maxReplicas: 10
5959
minReplicas: 0
60-
resources:
61-
cpu: ""
62-
memory: ""
6360
roles:
6461
- ingress-nginx
6562
storageClass: replicated

‎hack/e2e-apps/vminstance.bats‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ spec:
4242
disks:
4343
- name: $diskName
4444
gpus: []
45-
resources:
46-
cpu: ""
47-
memory: ""
4845
sshKeys:
4946
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPht0dPk5qQ+54g1hSX7A6AUxXJW5T6n/3d7Ga2F8gTF
5047
test@test

‎hack/e2e-prepare-cluster.bats‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ EOF
8282
for i in 1 2 3; do
8383
cp nocloud-amd64.raw srv${i}/system.img
8484
qemu-img resize srv${i}/system.img 50G
85-
qemu-img create srv${i}/data.img 100G
85+
qemu-img create srv${i}/data.img 200G
8686
done
8787
}
8888

‎packages/apps/bucket/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
include ../../../scripts/package.mk
22

33
generate:
4-
readme-generator-for-helm -v values.yaml -s values.schema.json -r README.md
4+
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
5+
yq -o json -i '.properties = {}' values.schema.json
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"properties": {},
3-
"title": "Chart Values",
4-
"type": "object"
5-
}
2+
"title": "Chart Values",
3+
"type": "object",
4+
"properties": {}
5+
}

‎packages/apps/clickhouse/Makefile‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
CLICKHOUSE_BACKUP_TAG = $(shell awk '$$0 ~ /^version:/ {print $$2}' Chart.yaml)
2-
PRESET_ENUM := ["nano","micro","small","medium","large","xlarge","2xlarge"]
32

43
include ../../../scripts/common-envs.mk
54
include ../../../scripts/package.mk
65

76
generate:
8-
readme-generator-for-helm -v values.yaml -s values.schema.json -r README.md
9-
yq -i -o json --indent 4 '.properties.resourcesPreset.enum = $(PRESET_ENUM)' values.schema.json
10-
yq -i -o json --indent 4 '.properties.clickhouseKeeper.resourcesPreset.enum = $(PRESET_ENUM)' values.schema.json
7+
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
118

129
image:
1310
docker buildx build images/clickhouse-backup \

‎packages/apps/clickhouse/README.md‎

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,54 @@ For more details, read [Restic: Effective Backup from Stdin](https://blog.aenix.
2323

2424
### Common parameters
2525

26-
| Name | Description | Value |
27-
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------- |
28-
| `replicas` | Number of Clickhouse replicas | `2` |
29-
| `shards` | Number of Clickhouse shards | `1` |
30-
| `resources` | Explicit CPU and memory configuration for each ClickHouse replica. When left empty, the preset defined in `resourcesPreset` is applied. | `{}` |
31-
| `resourcesPreset` | Default sizing preset used when `resources` is omitted. Allowed values: nano, micro, small, medium, large, xlarge, 2xlarge. | `small` |
32-
| `size` | Persistent Volume Claim size, available for application data | `10Gi` |
33-
| `storageClass` | StorageClass used to store the application data | `""` |
26+
| Name | Description | Type | Value |
27+
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ------- |
28+
| `replicas` | Number of Clickhouse replicas | `int` | `2` |
29+
| `shards` | Number of Clickhouse shards | `int` | `1` |
30+
| `resources` | Explicit CPU and memory configuration for each Clickhouse replica. When left empty, the preset defined in `resourcesPreset` is applied. | `*object` | `{}` |
31+
| `resources.cpu` | CPU | `*quantity` | `null` |
32+
| `resources.memory` | Memory | `*quantity` | `null` |
33+
| `resourcesPreset` | Default sizing preset used when `resources` is omitted. Allowed values: `nano`, `micro`, `small`, `medium`, `large`, `xlarge`, `2xlarge`. | `string` | `small` |
34+
| `size` | Persistent Volume Claim size, available for application data | `quantity` | `10Gi` |
35+
| `storageClass` | StorageClass used to store the data | `string` | `""` |
36+
3437

3538
### Application-specific parameters
3639

37-
| Name | Description | Value |
38-
| ---------------- | -------------------------------------------------------- | ----- |
39-
| `logStorageSize` | Size of Persistent Volume for logs | `2Gi` |
40-
| `logTTL` | TTL (expiration time) for query_log and query_thread_log | `15` |
41-
| `users` | Users configuration | `{}` |
40+
| Name | Description | Type | Value |
41+
| ---------------------- | ------------------------------------------------------------ | ------------------- | ------- |
42+
| `logStorageSize` | Size of Persistent Volume for logs | `quantity` | `2Gi` |
43+
| `logTTL` | TTL (expiration time) for `query_log` and `query_thread_log` | `int` | `15` |
44+
| `users` | Users configuration | `map[string]object` | `{...}` |
45+
| `users[name].password` | Password for the user | `*string` | `null` |
46+
| `users[name].readonly` | User is `readonly`, default is `false`. | `*bool` | `null` |
47+
4248

4349
### Backup parameters
4450

45-
| Name | Description | Value |
46-
| ------------------------ | ---------------------------------------------- | ------------------------------------------------------ |
47-
| `backup.enabled` | Enable periodic backups | `false` |
48-
| `backup.s3Region` | AWS S3 region where backups are stored | `us-east-1` |
49-
| `backup.s3Bucket` | S3 bucket used for storing backups | `s3.example.org/clickhouse-backups` |
50-
| `backup.schedule` | Cron schedule for automated backups | `0 2 * * *` |
51-
| `backup.cleanupStrategy` | Retention strategy for cleaning up old backups | `--keep-last=3 --keep-daily=3 --keep-within-weekly=1m` |
52-
| `backup.s3AccessKey` | Access key for S3, used for authentication | `oobaiRus9pah8PhohL1ThaeTa4UVa7gu` |
53-
| `backup.s3SecretKey` | Secret key for S3, used for authentication | `ju3eum4dekeich9ahM1te8waeGai0oog` |
54-
| `backup.resticPassword` | Password for Restic backup encryption | `ChaXoveekoh6eigh4siesheeda2quai0` |
55-
56-
### clickhouseKeeper parameters
57-
58-
| Name | Description | Value |
59-
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------- |
60-
| `clickhouseKeeper.enabled` | Deploy ClickHouse Keeper for cluster coordination | `true` |
61-
| `clickhouseKeeper.size` | Persistent Volume Claim size, available for application data | `1Gi` |
62-
| `clickhouseKeeper.resourcesPreset` | Default sizing preset used when `resources` is omitted. Allowed values: nano, micro, small, medium, large, xlarge, 2xlarge. | `micro` |
63-
| `clickhouseKeeper.replicas` | Number of keeper replicas | `3` |
51+
| Name | Description | Type | Value |
52+
| ------------------------ | ---------------------------------------------- | -------- | ------------------------------------------------------ |
53+
| `backup` | Backup configuration | `object` | `{}` |
54+
| `backup.enabled` | Enable regular backups, default is `false` | `bool` | `false` |
55+
| `backup.s3Region` | AWS S3 region where backups are stored | `string` | `us-east-1` |
56+
| `backup.s3Bucket` | S3 bucket used for storing backups | `string` | `s3.example.org/clickhouse-backups` |
57+
| `backup.schedule` | Cron schedule for automated backups | `string` | `0 2 * * *` |
58+
| `backup.cleanupStrategy` | Retention strategy for cleaning up old backups | `string` | `--keep-last=3 --keep-daily=3 --keep-within-weekly=1m` |
59+
| `backup.s3AccessKey` | Access key for S3, used for authentication | `string` | `oobaiRus9pah8PhohL1ThaeTa4UVa7gu` |
60+
| `backup.s3SecretKey` | Secret key for S3, used for authentication | `string` | `ju3eum4dekeich9ahM1te8waeGai0oog` |
61+
| `backup.resticPassword` | Password for Restic backup encryption | `string` | `ChaXoveekoh6eigh4siesheeda2quai0` |
62+
63+
64+
### Clickhouse Keeper parameters
65+
66+
| Name | Description | Type | Value |
67+
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ----------- | ------- |
68+
| `clickhouseKeeper` | Clickhouse Keeper configuration | `*object` | `{}` |
69+
| `clickhouseKeeper.enabled` | Deploy ClickHouse Keeper for cluster coordination | `*bool` | `true` |
70+
| `clickhouseKeeper.size` | Persistent Volume Claim size, available for application data | `*quantity` | `1Gi` |
71+
| `clickhouseKeeper.resourcesPreset` | Default sizing preset used when `resources` is omitted. Allowed values: nano, micro, small, medium, large, xlarge, 2xlarge. | `string` | `micro` |
72+
| `clickhouseKeeper.replicas` | Number of keeper replicas | `*int` | `3` |
73+
6474

6575
## Parameter examples and reference
6676

0 commit comments

Comments
 (0)