mirror of
https://github.com/cozystack/cozystack.git
synced 2026-03-14 02:48:57 +00:00
Compare commits
3 Commits
main
...
feat/expos
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6acf7a419a | ||
|
|
5f2b7d8ca8 | ||
|
|
395b6d828d |
85
.github/workflows/tags.yaml
vendored
85
.github/workflows/tags.yaml
vendored
@@ -123,6 +123,20 @@ jobs:
|
||||
git commit -m "Prepare release ${GITHUB_REF#refs/tags/}" -s || echo "No changes to commit"
|
||||
git push origin HEAD || true
|
||||
|
||||
# Tag the api/apps/v1alpha1 submodule for pkg.go.dev
|
||||
- name: Tag API submodule
|
||||
if: steps.check_release.outputs.skip == 'false'
|
||||
env:
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
run: |
|
||||
VTAG="${{ steps.tag.outputs.tag }}"
|
||||
SUBTAG="api/apps/v1alpha1/${VTAG}"
|
||||
git config user.name "cozystack-bot"
|
||||
git config user.email "217169706+cozystack-bot@users.noreply.github.com"
|
||||
git remote set-url origin https://cozystack-bot:${GH_PAT}@github.com/${GITHUB_REPOSITORY}
|
||||
git tag "${SUBTAG}" "${VTAG}^{}" 2>/dev/null || git tag "${SUBTAG}" HEAD
|
||||
git push origin "${SUBTAG}" || true
|
||||
|
||||
# Create or reuse draft release
|
||||
- name: Create / reuse draft release
|
||||
if: steps.check_release.outputs.skip == 'false'
|
||||
@@ -370,3 +384,74 @@ jobs:
|
||||
|
||||
console.log(`Created PR #${pr.data.number} for changelog`);
|
||||
}
|
||||
|
||||
update-website-docs:
|
||||
name: Update Website Docs
|
||||
runs-on: [self-hosted]
|
||||
needs: [generate-changelog]
|
||||
if: needs.generate-changelog.result == 'success'
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Parse tag
|
||||
id: tag
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const ref = context.ref.replace('refs/tags/', '');
|
||||
const m = ref.match(/^v(\d+\.\d+\.\d+)(-(?:alpha|beta|rc)\.\d+)?$/);
|
||||
if (!m) {
|
||||
core.setFailed(`❌ tag '${ref}' must match 'vX.Y.Z' or 'vX.Y.Z-(alpha|beta|rc).N'`);
|
||||
return;
|
||||
}
|
||||
const version = m[1] + (m[2] ?? '');
|
||||
core.setOutput('tag', ref); // v0.22.0
|
||||
core.setOutput('version', version); // 0.22.0
|
||||
|
||||
- name: Checkout website repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: cozystack/website
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
ref: main
|
||||
|
||||
- name: Update docs from release branch
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_PAT }}
|
||||
run: make update-all BRANCH=release-${{ steps.tag.outputs.version }} RELEASE_TAG=${{ steps.tag.outputs.tag }}
|
||||
|
||||
- name: Commit and push
|
||||
id: commit
|
||||
run: |
|
||||
git config user.name "cozystack-bot"
|
||||
git config user.email "217169706+cozystack-bot@users.noreply.github.com"
|
||||
git add content
|
||||
if git diff --cached --quiet; then
|
||||
echo "No changes to commit"
|
||||
echo "changed=false" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
BRANCH="update-docs-v${{ steps.tag.outputs.version }}"
|
||||
git branch -D "$BRANCH" 2>/dev/null || true
|
||||
git checkout -b "$BRANCH"
|
||||
git commit --signoff -m "[docs] Update managed apps reference for v${{ steps.tag.outputs.version }}"
|
||||
git push --force --set-upstream origin "$BRANCH"
|
||||
echo "changed=true" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Open pull request
|
||||
if: steps.commit.outputs.changed == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_PAT }}
|
||||
run: |
|
||||
BRANCH="update-docs-v${{ steps.tag.outputs.version }}"
|
||||
pr_state=$(gh pr view "$BRANCH" --repo cozystack/website --json state --jq .state 2>/dev/null || echo "")
|
||||
if [[ "$pr_state" == "OPEN" ]]; then
|
||||
echo "PR already open, skipping creation."
|
||||
else
|
||||
gh pr create \
|
||||
--repo cozystack/website \
|
||||
--title "[docs] Update managed apps reference for v${{ steps.tag.outputs.version }}" \
|
||||
--body "Automated docs update for release \`v${{ steps.tag.outputs.version }}\`." \
|
||||
--head "update-docs-v${{ steps.tag.outputs.version }}" \
|
||||
--base main
|
||||
fi
|
||||
|
||||
6
Makefile
6
Makefile
@@ -58,7 +58,11 @@ manifests:
|
||||
cozypkg:
|
||||
go build -ldflags "-X github.com/cozystack/cozystack/cmd/cozypkg/cmd.Version=v$(COZYSTACK_VERSION)" -o _out/bin/cozypkg ./cmd/cozypkg
|
||||
|
||||
assets: assets-talos assets-cozypkg
|
||||
assets: assets-talos assets-cozypkg openapi-json
|
||||
|
||||
openapi-json:
|
||||
mkdir -p _out/assets
|
||||
VERSION=$(shell git describe --tags --always 2>/dev/null || echo dev) go run ./tools/openapi-gen/ > _out/assets/openapi.json
|
||||
|
||||
assets-talos:
|
||||
make -C packages/core/talos assets
|
||||
|
||||
35
api/apps/v1alpha1/bucket/types.go
Normal file
35
api/apps/v1alpha1/bucket/types.go
Normal file
@@ -0,0 +1,35 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package bucket
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Provisions bucket from the `-lock` BucketClass (with object lock enabled).
|
||||
// +kubebuilder:default:=false
|
||||
Locking bool `json:"locking"`
|
||||
// Selects a specific BucketClass by storage pool name.
|
||||
// +kubebuilder:default:=""
|
||||
StoragePool string `json:"storagePool,omitempty"`
|
||||
// Users configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Users map[string]User `json:"users,omitempty"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
// Whether the user has read-only access.
|
||||
Readonly bool `json:"readonly,omitempty"`
|
||||
}
|
||||
114
api/apps/v1alpha1/clickhouse/types.go
Normal file
114
api/apps/v1alpha1/clickhouse/types.go
Normal file
@@ -0,0 +1,114 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package clickhouse
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Backup configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Backup Backup `json:"backup"`
|
||||
// ClickHouse Keeper configuration.
|
||||
// +kubebuilder:default:={}
|
||||
ClickhouseKeeper ClickHouseKeeper `json:"clickhouseKeeper"`
|
||||
// Size of Persistent Volume for logs.
|
||||
// +kubebuilder:default:="2Gi"
|
||||
LogStorageSize resource.Quantity `json:"logStorageSize"`
|
||||
// TTL (expiration time) for `query_log` and `query_thread_log`.
|
||||
// +kubebuilder:default:=15
|
||||
LogTTL int `json:"logTTL"`
|
||||
// Number of ClickHouse replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each ClickHouse replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="small"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Number of ClickHouse shards.
|
||||
// +kubebuilder:default:=1
|
||||
Shards int `json:"shards"`
|
||||
// Persistent Volume Claim size available for application data.
|
||||
// +kubebuilder:default:="10Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
// Users configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Users map[string]User `json:"users,omitempty"`
|
||||
}
|
||||
|
||||
type ClickHouseKeeper struct {
|
||||
// Deploy ClickHouse Keeper for cluster coordination.
|
||||
// +kubebuilder:default:=true
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
// Number of Keeper replicas.
|
||||
// +kubebuilder:default:=3
|
||||
Replicas int `json:"replicas,omitempty"`
|
||||
// Default sizing preset.
|
||||
// +kubebuilder:default:="micro"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset,omitempty"`
|
||||
// Persistent Volume Claim size available for application data.
|
||||
// +kubebuilder:default:="1Gi"
|
||||
Size resource.Quantity `json:"size,omitempty"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
// Password for the user.
|
||||
Password string `json:"password,omitempty"`
|
||||
// User is readonly (default: false).
|
||||
Readonly bool `json:"readonly,omitempty"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type Backup struct {
|
||||
// Retention strategy for cleaning up old backups.
|
||||
// +kubebuilder:default:="--keep-last=3 --keep-daily=3 --keep-within-weekly=1m"
|
||||
CleanupStrategy string `json:"cleanupStrategy"`
|
||||
// Enable regular backups (default: false).
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Password for Restic backup encryption.
|
||||
// +kubebuilder:default:="<password>"
|
||||
ResticPassword string `json:"resticPassword"`
|
||||
// Access key for S3 authentication.
|
||||
// +kubebuilder:default:="<your-access-key>"
|
||||
S3AccessKey string `json:"s3AccessKey"`
|
||||
// S3 bucket used for storing backups.
|
||||
// +kubebuilder:default:="s3.example.org/clickhouse-backups"
|
||||
S3Bucket string `json:"s3Bucket"`
|
||||
// AWS S3 region where backups are stored.
|
||||
// +kubebuilder:default:="us-east-1"
|
||||
S3Region string `json:"s3Region"`
|
||||
// Secret key for S3 authentication.
|
||||
// +kubebuilder:default:="<your-secret-key>"
|
||||
S3SecretKey string `json:"s3SecretKey"`
|
||||
// Cron schedule for automated backups.
|
||||
// +kubebuilder:default:="0 2 * * *"
|
||||
Schedule string `json:"schedule"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
164
api/apps/v1alpha1/foundationdb/types.go
Normal file
164
api/apps/v1alpha1/foundationdb/types.go
Normal file
@@ -0,0 +1,164 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package foundationdb
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Enable automatic pod replacements.
|
||||
// +kubebuilder:default:=true
|
||||
AutomaticReplacements bool `json:"automaticReplacements"`
|
||||
// Backup configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Backup Backup `json:"backup"`
|
||||
// Cluster configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Cluster Cluster `json:"cluster"`
|
||||
// Custom parameters to pass to FoundationDB.
|
||||
// +kubebuilder:default:={}
|
||||
CustomParameters []string `json:"customParameters,omitempty"`
|
||||
// Container image deployment type.
|
||||
// +kubebuilder:default:="unified"
|
||||
ImageType ImageType `json:"imageType"`
|
||||
// Monitoring configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Monitoring Monitoring `json:"monitoring"`
|
||||
// Explicit CPU and memory configuration for each FoundationDB instance. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="medium"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Security context for containers.
|
||||
// +kubebuilder:default:={}
|
||||
SecurityContext SecurityContext `json:"securityContext"`
|
||||
// Storage configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Storage Storage `json:"storage"`
|
||||
}
|
||||
|
||||
type Cluster struct {
|
||||
// Fault domain configuration.
|
||||
// +kubebuilder:default:={}
|
||||
FaultDomain ClusterFaultDomain `json:"faultDomain"`
|
||||
// Process counts for different roles.
|
||||
// +kubebuilder:default:={}
|
||||
ProcessCounts ClusterProcessCounts `json:"processCounts"`
|
||||
// Database redundancy mode (single, double, triple, three_datacenter, three_datacenter_fallback).
|
||||
// +kubebuilder:default:="double"
|
||||
RedundancyMode string `json:"redundancyMode"`
|
||||
// Storage engine (ssd-2, ssd-redwood-v1, ssd-rocksdb-v1, memory).
|
||||
// +kubebuilder:default:="ssd-2"
|
||||
StorageEngine string `json:"storageEngine"`
|
||||
// Version of FoundationDB to use.
|
||||
// +kubebuilder:default:="7.3.63"
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
type BackupS3Credentials struct {
|
||||
// S3 access key ID.
|
||||
// +kubebuilder:default:=""
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// S3 secret access key.
|
||||
// +kubebuilder:default:=""
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
}
|
||||
|
||||
type BackupS3 struct {
|
||||
// S3 bucket name.
|
||||
// +kubebuilder:default:=""
|
||||
Bucket string `json:"bucket"`
|
||||
// S3 credentials.
|
||||
// +kubebuilder:default:={}
|
||||
Credentials BackupS3Credentials `json:"credentials"`
|
||||
// S3 endpoint URL.
|
||||
// +kubebuilder:default:=""
|
||||
Endpoint string `json:"endpoint"`
|
||||
// S3 region.
|
||||
// +kubebuilder:default:="us-east-1"
|
||||
Region string `json:"region"`
|
||||
}
|
||||
|
||||
type SecurityContext struct {
|
||||
// Group ID to run the container.
|
||||
// +kubebuilder:default:=4059
|
||||
RunAsGroup int `json:"runAsGroup"`
|
||||
// User ID to run the container.
|
||||
// +kubebuilder:default:=4059
|
||||
RunAsUser int `json:"runAsUser"`
|
||||
}
|
||||
|
||||
type ClusterFaultDomain struct {
|
||||
// Fault domain key.
|
||||
// +kubebuilder:default:="kubernetes.io/hostname"
|
||||
Key string `json:"key"`
|
||||
// Fault domain value source.
|
||||
// +kubebuilder:default:="spec.nodeName"
|
||||
ValueFrom string `json:"valueFrom"`
|
||||
}
|
||||
|
||||
type Storage struct {
|
||||
// Size of persistent volumes for each instance.
|
||||
// +kubebuilder:default:="16Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// Storage class (if not set, uses cluster default).
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each instance.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each instance.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type Backup struct {
|
||||
// Enable backups.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Retention policy for backups.
|
||||
// +kubebuilder:default:="7d"
|
||||
RetentionPolicy string `json:"retentionPolicy"`
|
||||
// S3 configuration for backups.
|
||||
// +kubebuilder:default:={}
|
||||
S3 BackupS3 `json:"s3"`
|
||||
}
|
||||
|
||||
type ClusterProcessCounts struct {
|
||||
// Number of cluster controller processes.
|
||||
// +kubebuilder:default:=1
|
||||
ClusterController int `json:"cluster_controller"`
|
||||
// Number of stateless processes (-1 for automatic).
|
||||
// +kubebuilder:default:=-1
|
||||
Stateless int `json:"stateless"`
|
||||
// Number of storage processes (determines cluster size).
|
||||
// +kubebuilder:default:=3
|
||||
Storage int `json:"storage"`
|
||||
}
|
||||
|
||||
type Monitoring struct {
|
||||
// Enable WorkloadMonitor integration.
|
||||
// +kubebuilder:default:=true
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="unified";"split"
|
||||
type ImageType string
|
||||
|
||||
// +kubebuilder:validation:Enum="small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
24
api/apps/v1alpha1/go.mod
Normal file
24
api/apps/v1alpha1/go.mod
Normal file
@@ -0,0 +1,24 @@
|
||||
module github.com/cozystack/cozystack/api/apps/v1alpha1
|
||||
|
||||
go 1.25.0
|
||||
|
||||
require k8s.io/apimachinery v0.35.2
|
||||
|
||||
require (
|
||||
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
||||
golang.org/x/net v0.47.0 // indirect
|
||||
golang.org/x/text v0.31.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
|
||||
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
|
||||
)
|
||||
56
api/apps/v1alpha1/go.sum
Normal file
56
api/apps/v1alpha1/go.sum
Normal file
@@ -0,0 +1,56 @@
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
|
||||
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
|
||||
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
|
||||
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
|
||||
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
|
||||
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
|
||||
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
|
||||
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/apimachinery v0.35.2 h1:NqsM/mmZA7sHW02JZ9RTtk3wInRgbVxL8MPfzSANAK8=
|
||||
k8s.io/apimachinery v0.35.2/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE=
|
||||
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ=
|
||||
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
|
||||
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
|
||||
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
|
||||
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco=
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
|
||||
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
|
||||
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
|
||||
116
api/apps/v1alpha1/harbor/types.go
Normal file
116
api/apps/v1alpha1/harbor/types.go
Normal file
@@ -0,0 +1,116 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package harbor
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Core API server configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Core Core `json:"core"`
|
||||
// PostgreSQL database configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Database Database `json:"database"`
|
||||
// Hostname for external access to Harbor (defaults to 'harbor' subdomain for the tenant host).
|
||||
// +kubebuilder:default:=""
|
||||
Host string `json:"host,omitempty"`
|
||||
// Background job service configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Jobservice Jobservice `json:"jobservice"`
|
||||
// Redis cache configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Redis Redis `json:"redis"`
|
||||
// Container image registry configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Registry Registry `json:"registry"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
// Trivy vulnerability scanner configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Trivy Trivy `json:"trivy"`
|
||||
}
|
||||
|
||||
type Trivy struct {
|
||||
// Enable or disable the vulnerability scanner.
|
||||
// +kubebuilder:default:=true
|
||||
Enabled bool `json:"enabled"`
|
||||
// Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="nano"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset,omitempty"`
|
||||
// Persistent Volume size for vulnerability database cache.
|
||||
// +kubebuilder:default:="5Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
}
|
||||
|
||||
type Jobservice struct {
|
||||
// Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="nano"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset,omitempty"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// Number of CPU cores allocated.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Amount of memory allocated.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type Database struct {
|
||||
// Number of database instances.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Persistent Volume size for database storage.
|
||||
// +kubebuilder:default:="5Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
}
|
||||
|
||||
type Redis struct {
|
||||
// Number of Redis replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Persistent Volume size for cache storage.
|
||||
// +kubebuilder:default:="1Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
}
|
||||
|
||||
type Core struct {
|
||||
// Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="small"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset,omitempty"`
|
||||
}
|
||||
|
||||
type Registry struct {
|
||||
// Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="small"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
74
api/apps/v1alpha1/httpcache/types.go
Normal file
74
api/apps/v1alpha1/httpcache/types.go
Normal file
@@ -0,0 +1,74 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package httpcache
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Endpoints configuration, as a list of <ip:port>.
|
||||
// +kubebuilder:default:={}
|
||||
Endpoints []string `json:"endpoints,omitempty"`
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// HAProxy configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Haproxy HAProxy `json:"haproxy"`
|
||||
// Nginx configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Nginx Nginx `json:"nginx"`
|
||||
// Persistent Volume Claim size available for application data.
|
||||
// +kubebuilder:default:="10Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type HAProxy struct {
|
||||
// Number of HAProxy replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="nano"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
}
|
||||
|
||||
type Nginx struct {
|
||||
// Number of Nginx replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="nano"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
92
api/apps/v1alpha1/kafka/types.go
Normal file
92
api/apps/v1alpha1/kafka/types.go
Normal file
@@ -0,0 +1,92 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package kafka
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
k8sRuntime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// Kafka configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Kafka Kafka `json:"kafka"`
|
||||
// Topics configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Topics []Topic `json:"topics,omitempty"`
|
||||
// ZooKeeper configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Zookeeper ZooKeeper `json:"zookeeper"`
|
||||
}
|
||||
|
||||
type ZooKeeper struct {
|
||||
// Number of ZooKeeper replicas.
|
||||
// +kubebuilder:default:=3
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="small"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Persistent Volume size for ZooKeeper.
|
||||
// +kubebuilder:default:="5Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the ZooKeeper data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
}
|
||||
|
||||
type Topic struct {
|
||||
// Topic configuration.
|
||||
Config k8sRuntime.RawExtension `json:"config"`
|
||||
// Topic name.
|
||||
Name string `json:"name"`
|
||||
// Number of partitions.
|
||||
Partitions int `json:"partitions"`
|
||||
// Number of replicas.
|
||||
Replicas int `json:"replicas"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type Kafka struct {
|
||||
// Number of Kafka replicas.
|
||||
// +kubebuilder:default:=3
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="small"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Persistent Volume size for Kafka.
|
||||
// +kubebuilder:default:="10Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the Kafka data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
260
api/apps/v1alpha1/kubernetes/types.go
Normal file
260
api/apps/v1alpha1/kubernetes/types.go
Normal file
@@ -0,0 +1,260 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package kubernetes
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
k8sRuntime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Cluster addons configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Addons Addons `json:"addons"`
|
||||
// Kubernetes control-plane configuration.
|
||||
// +kubebuilder:default:={}
|
||||
ControlPlane ControlPlane `json:"controlPlane"`
|
||||
// External hostname for Kubernetes cluster. Defaults to `<cluster-name>.<tenant-host>` if empty.
|
||||
// +kubebuilder:default:=""
|
||||
Host string `json:"host"`
|
||||
// Worker nodes configuration map.
|
||||
// +kubebuilder:default:={"md0":{"ephemeralStorage":"20Gi","gpus":{},"instanceType":"u1.medium","maxReplicas":10,"minReplicas":0,"resources":{},"roles":{"ingress-nginx"}}}
|
||||
NodeGroups map[string]NodeGroup `json:"nodeGroups,omitempty"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:="replicated"
|
||||
StorageClass string `json:"storageClass"`
|
||||
// Kubernetes major.minor version to deploy
|
||||
// +kubebuilder:default:="v1.35"
|
||||
Version Version `json:"version"`
|
||||
}
|
||||
|
||||
type VeleroAddon struct {
|
||||
// Enable Velero.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Custom Helm values overrides.
|
||||
// +kubebuilder:default:={}
|
||||
ValuesOverride k8sRuntime.RawExtension `json:"valuesOverride"`
|
||||
}
|
||||
|
||||
type KonnectivityServer struct {
|
||||
// CPU and memory resources for Konnectivity.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources"`
|
||||
// Preset if `resources` omitted.
|
||||
// +kubebuilder:default:="micro"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
}
|
||||
|
||||
type IngressNginxAddon struct {
|
||||
// Enable the controller (requires nodes labeled `ingress-nginx`).
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Method to expose the controller. Allowed values: `Proxied`, `LoadBalancer`.
|
||||
// +kubebuilder:default:="Proxied"
|
||||
ExposeMethod IngressNginxExposeMethod `json:"exposeMethod"`
|
||||
// Domains routed to this tenant cluster when `exposeMethod` is `Proxied`.
|
||||
// +kubebuilder:default:={}
|
||||
Hosts []string `json:"hosts,omitempty"`
|
||||
// Custom Helm values overrides.
|
||||
// +kubebuilder:default:={}
|
||||
ValuesOverride k8sRuntime.RawExtension `json:"valuesOverride"`
|
||||
}
|
||||
|
||||
type FluxCDAddon struct {
|
||||
// Enable FluxCD.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Custom Helm values overrides.
|
||||
// +kubebuilder:default:={}
|
||||
ValuesOverride k8sRuntime.RawExtension `json:"valuesOverride"`
|
||||
}
|
||||
|
||||
type APIServer struct {
|
||||
// CPU and memory resources for API Server.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources"`
|
||||
// Preset if `resources` omitted.
|
||||
// +kubebuilder:default:="large"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type CoreDNSAddon struct {
|
||||
// Custom Helm values overrides.
|
||||
// +kubebuilder:default:={}
|
||||
ValuesOverride k8sRuntime.RawExtension `json:"valuesOverride"`
|
||||
}
|
||||
|
||||
type Konnectivity struct {
|
||||
// Konnectivity Server configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Server KonnectivityServer `json:"server"`
|
||||
}
|
||||
|
||||
type ControlPlane struct {
|
||||
// API Server configuration.
|
||||
// +kubebuilder:default:={}
|
||||
ApiServer APIServer `json:"apiServer"`
|
||||
// Controller Manager configuration.
|
||||
// +kubebuilder:default:={}
|
||||
ControllerManager ControllerManager `json:"controllerManager"`
|
||||
// Konnectivity configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Konnectivity Konnectivity `json:"konnectivity"`
|
||||
// Number of control-plane replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Scheduler configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Scheduler Scheduler `json:"scheduler"`
|
||||
}
|
||||
|
||||
type GPUOperatorAddon struct {
|
||||
// Enable GPU Operator.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Custom Helm values overrides.
|
||||
// +kubebuilder:default:={}
|
||||
ValuesOverride k8sRuntime.RawExtension `json:"valuesOverride"`
|
||||
}
|
||||
|
||||
type Addons struct {
|
||||
// Cert-manager addon.
|
||||
// +kubebuilder:default:={}
|
||||
CertManager CertManagerAddon `json:"certManager"`
|
||||
// Cilium CNI plugin.
|
||||
// +kubebuilder:default:={}
|
||||
Cilium CiliumAddon `json:"cilium"`
|
||||
// CoreDNS addon.
|
||||
// +kubebuilder:default:={}
|
||||
Coredns CoreDNSAddon `json:"coredns"`
|
||||
// FluxCD GitOps operator.
|
||||
// +kubebuilder:default:={}
|
||||
Fluxcd FluxCDAddon `json:"fluxcd"`
|
||||
// Gateway API addon.
|
||||
// +kubebuilder:default:={}
|
||||
GatewayAPI GatewayAPIAddon `json:"gatewayAPI"`
|
||||
// NVIDIA GPU Operator.
|
||||
// +kubebuilder:default:={}
|
||||
GpuOperator GPUOperatorAddon `json:"gpuOperator"`
|
||||
// Ingress-NGINX controller.
|
||||
// +kubebuilder:default:={}
|
||||
IngressNginx IngressNginxAddon `json:"ingressNginx"`
|
||||
// Monitoring agents.
|
||||
// +kubebuilder:default:={}
|
||||
MonitoringAgents MonitoringAgentsAddon `json:"monitoringAgents"`
|
||||
// Velero backup/restore addon.
|
||||
// +kubebuilder:default:={}
|
||||
Velero VeleroAddon `json:"velero"`
|
||||
// Vertical Pod Autoscaler.
|
||||
// +kubebuilder:default:={}
|
||||
VerticalPodAutoscaler VerticalPodAutoscalerAddon `json:"verticalPodAutoscaler"`
|
||||
}
|
||||
|
||||
type Scheduler struct {
|
||||
// CPU and memory resources for Scheduler.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources"`
|
||||
// Preset if `resources` omitted.
|
||||
// +kubebuilder:default:="micro"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
}
|
||||
|
||||
type CertManagerAddon struct {
|
||||
// Enable cert-manager.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Custom Helm values overrides.
|
||||
// +kubebuilder:default:={}
|
||||
ValuesOverride k8sRuntime.RawExtension `json:"valuesOverride"`
|
||||
}
|
||||
|
||||
type MonitoringAgentsAddon struct {
|
||||
// Enable monitoring agents.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Custom Helm values overrides.
|
||||
// +kubebuilder:default:={}
|
||||
ValuesOverride k8sRuntime.RawExtension `json:"valuesOverride"`
|
||||
}
|
||||
|
||||
type GPU struct {
|
||||
// Name of GPU, such as "nvidia.com/AD102GL_L40S".
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type GatewayAPIAddon struct {
|
||||
// Enable Gateway API.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
type VerticalPodAutoscalerAddon struct {
|
||||
// Custom Helm values overrides.
|
||||
// +kubebuilder:default:={}
|
||||
ValuesOverride k8sRuntime.RawExtension `json:"valuesOverride"`
|
||||
}
|
||||
|
||||
type ControllerManager struct {
|
||||
// CPU and memory resources for Controller Manager.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources"`
|
||||
// Preset if `resources` omitted.
|
||||
// +kubebuilder:default:="micro"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
}
|
||||
|
||||
type NodeGroup struct {
|
||||
// Ephemeral storage size.
|
||||
// +kubebuilder:default:="20Gi"
|
||||
EphemeralStorage resource.Quantity `json:"ephemeralStorage"`
|
||||
// List of GPUs to attach (NVIDIA driver requires at least 4 GiB RAM).
|
||||
Gpus []GPU `json:"gpus,omitempty"`
|
||||
// Virtual machine instance type.
|
||||
// +kubebuilder:default:="u1.medium"
|
||||
InstanceType string `json:"instanceType"`
|
||||
// Maximum number of replicas.
|
||||
// +kubebuilder:default:=10
|
||||
MaxReplicas int `json:"maxReplicas"`
|
||||
// Minimum number of replicas.
|
||||
// +kubebuilder:default:=0
|
||||
MinReplicas int `json:"minReplicas"`
|
||||
// CPU and memory resources for each worker node.
|
||||
Resources Resources `json:"resources"`
|
||||
// List of node roles.
|
||||
Roles []string `json:"roles,omitempty"`
|
||||
}
|
||||
|
||||
type CiliumAddon struct {
|
||||
// Custom Helm values overrides.
|
||||
// +kubebuilder:default:={}
|
||||
ValuesOverride k8sRuntime.RawExtension `json:"valuesOverride"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="v1.35";"v1.34";"v1.33";"v1.32";"v1.31";"v1.30"
|
||||
type Version string
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
|
||||
// +kubebuilder:validation:Enum="Proxied";"LoadBalancer"
|
||||
type IngressNginxExposeMethod string
|
||||
111
api/apps/v1alpha1/mariadb/types.go
Normal file
111
api/apps/v1alpha1/mariadb/types.go
Normal file
@@ -0,0 +1,111 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package mariadb
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Backup configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Backup Backup `json:"backup"`
|
||||
// Databases configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Databases map[string]Database `json:"databases,omitempty"`
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// Number of MariaDB replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each MariaDB replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="nano"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Persistent Volume Claim size available for application data.
|
||||
// +kubebuilder:default:="10Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
// Users configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Users map[string]User `json:"users,omitempty"`
|
||||
// MariaDB major.minor version to deploy
|
||||
// +kubebuilder:default:="v11.8"
|
||||
Version Version `json:"version"`
|
||||
}
|
||||
|
||||
type Backup struct {
|
||||
// Retention strategy for cleaning up old backups.
|
||||
// +kubebuilder:default:="--keep-last=3 --keep-daily=3 --keep-within-weekly=1m"
|
||||
CleanupStrategy string `json:"cleanupStrategy"`
|
||||
// Enable regular backups (default: false).
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Password for Restic backup encryption.
|
||||
// +kubebuilder:default:="<password>"
|
||||
ResticPassword string `json:"resticPassword"`
|
||||
// Access key for S3 authentication.
|
||||
// +kubebuilder:default:="<your-access-key>"
|
||||
S3AccessKey string `json:"s3AccessKey"`
|
||||
// S3 bucket used for storing backups.
|
||||
// +kubebuilder:default:="s3.example.org/mariadb-backups"
|
||||
S3Bucket string `json:"s3Bucket"`
|
||||
// AWS S3 region where backups are stored.
|
||||
// +kubebuilder:default:="us-east-1"
|
||||
S3Region string `json:"s3Region"`
|
||||
// Secret key for S3 authentication.
|
||||
// +kubebuilder:default:="<your-secret-key>"
|
||||
S3SecretKey string `json:"s3SecretKey"`
|
||||
// Cron schedule for automated backups.
|
||||
// +kubebuilder:default:="0 2 * * *"
|
||||
Schedule string `json:"schedule"`
|
||||
}
|
||||
|
||||
type Database struct {
|
||||
// Roles assigned to users.
|
||||
Roles DatabaseRoles `json:"roles,omitempty"`
|
||||
}
|
||||
|
||||
type DatabaseRoles struct {
|
||||
// List of users with admin privileges.
|
||||
Admin []string `json:"admin,omitempty"`
|
||||
// List of users with read-only privileges.
|
||||
Readonly []string `json:"readonly,omitempty"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
// Maximum number of connections.
|
||||
MaxUserConnections int `json:"maxUserConnections"`
|
||||
// Password for the user.
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
|
||||
// +kubebuilder:validation:Enum="v11.8";"v11.4";"v10.11";"v10.6"
|
||||
type Version string
|
||||
151
api/apps/v1alpha1/mongodb/types.go
Normal file
151
api/apps/v1alpha1/mongodb/types.go
Normal file
@@ -0,0 +1,151 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package mongodb
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Backup configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Backup Backup `json:"backup"`
|
||||
// Bootstrap configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Bootstrap Bootstrap `json:"bootstrap"`
|
||||
// Databases configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Databases map[string]Database `json:"databases,omitempty"`
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// Number of MongoDB replicas in replica set.
|
||||
// +kubebuilder:default:=3
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each MongoDB replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="small"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Enable sharded cluster mode. When disabled, deploys a replica set.
|
||||
// +kubebuilder:default:=false
|
||||
Sharding bool `json:"sharding"`
|
||||
// Configuration for sharded cluster mode.
|
||||
// +kubebuilder:default:={}
|
||||
ShardingConfig ShardingConfig `json:"shardingConfig"`
|
||||
// Persistent Volume Claim size available for application data.
|
||||
// +kubebuilder:default:="10Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
// Users configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Users map[string]User `json:"users,omitempty"`
|
||||
// MongoDB major version to deploy.
|
||||
// +kubebuilder:default:="v8"
|
||||
Version Version `json:"version"`
|
||||
}
|
||||
|
||||
type Shard struct {
|
||||
// Shard name.
|
||||
Name string `json:"name"`
|
||||
// Number of replicas in this shard.
|
||||
Replicas int `json:"replicas"`
|
||||
// PVC size for this shard.
|
||||
Size resource.Quantity `json:"size"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type DatabaseRoles struct {
|
||||
// List of users with admin privileges (readWrite + dbAdmin).
|
||||
Admin []string `json:"admin,omitempty"`
|
||||
// List of users with read-only privileges.
|
||||
Readonly []string `json:"readonly,omitempty"`
|
||||
}
|
||||
|
||||
type Backup struct {
|
||||
// Destination path for backups (e.g. s3://bucket/path/).
|
||||
// +kubebuilder:default:="s3://bucket/path/to/folder/"
|
||||
DestinationPath string `json:"destinationPath,omitempty"`
|
||||
// Enable regular backups.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// S3 endpoint URL for uploads.
|
||||
// +kubebuilder:default:="http://minio-gateway-service:9000"
|
||||
EndpointURL string `json:"endpointURL,omitempty"`
|
||||
// Retention policy (e.g. "30d").
|
||||
// +kubebuilder:default:="30d"
|
||||
RetentionPolicy string `json:"retentionPolicy,omitempty"`
|
||||
// Access key for S3 authentication.
|
||||
// +kubebuilder:default:=""
|
||||
S3AccessKey string `json:"s3AccessKey,omitempty"`
|
||||
// Secret key for S3 authentication.
|
||||
// +kubebuilder:default:=""
|
||||
S3SecretKey string `json:"s3SecretKey,omitempty"`
|
||||
// Cron schedule for automated backups.
|
||||
// +kubebuilder:default:="0 2 * * *"
|
||||
Schedule string `json:"schedule,omitempty"`
|
||||
}
|
||||
|
||||
type ShardingConfig struct {
|
||||
// PVC size for config servers.
|
||||
// +kubebuilder:default:="3Gi"
|
||||
ConfigServerSize resource.Quantity `json:"configServerSize"`
|
||||
// Number of config server replicas.
|
||||
// +kubebuilder:default:=3
|
||||
ConfigServers int `json:"configServers"`
|
||||
// Number of mongos router replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Mongos int `json:"mongos"`
|
||||
// List of shard configurations.
|
||||
// +kubebuilder:default:={{"name":"rs0","replicas":3,"size":"10Gi"}}
|
||||
Shards []Shard `json:"shards,omitempty"`
|
||||
}
|
||||
|
||||
type Bootstrap struct {
|
||||
// Name of backup to restore from.
|
||||
// +kubebuilder:default:=""
|
||||
BackupName string `json:"backupName"`
|
||||
// Whether to restore from a backup.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Timestamp for point-in-time recovery; empty means latest.
|
||||
// +kubebuilder:default:=""
|
||||
RecoveryTime string `json:"recoveryTime,omitempty"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
// Password for the user (auto-generated if omitted).
|
||||
Password string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
type Database struct {
|
||||
// Roles assigned to users.
|
||||
Roles DatabaseRoles `json:"roles,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="v8";"v7";"v6"
|
||||
type Version string
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
80
api/apps/v1alpha1/nats/types.go
Normal file
80
api/apps/v1alpha1/nats/types.go
Normal file
@@ -0,0 +1,80 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package nats
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
k8sRuntime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// NATS configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Config ValuesConfig `json:"config"`
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// Jetstream configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Jetstream Jetstream `json:"jetstream"`
|
||||
// Number of replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each NATS replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="nano"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
// Users configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Users map[string]User `json:"users,omitempty"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
// Password for the user.
|
||||
Password string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type Jetstream struct {
|
||||
// Enable or disable Jetstream for persistent messaging in NATS.
|
||||
// +kubebuilder:default:=true
|
||||
Enabled bool `json:"enabled"`
|
||||
// Jetstream persistent storage size.
|
||||
// +kubebuilder:default:="10Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
}
|
||||
|
||||
type ValuesConfig struct {
|
||||
// Additional configuration to merge into NATS config.
|
||||
// +kubebuilder:default:={}
|
||||
Merge *k8sRuntime.RawExtension `json:"merge,omitempty"`
|
||||
// Additional resolver configuration to merge into NATS config.
|
||||
// +kubebuilder:default:={}
|
||||
Resolver *k8sRuntime.RawExtension `json:"resolver,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
53
api/apps/v1alpha1/openbao/types.go
Normal file
53
api/apps/v1alpha1/openbao/types.go
Normal file
@@ -0,0 +1,53 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package openbao
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// Number of OpenBAO replicas. HA with Raft is automatically enabled when replicas > 1. Switching between standalone (file storage) and HA (Raft storage) modes requires data migration.
|
||||
// +kubebuilder:default:=1
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each OpenBAO replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="small"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Persistent Volume Claim size for data storage.
|
||||
// +kubebuilder:default:="10Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
// Enable the OpenBAO web UI.
|
||||
// +kubebuilder:default:=true
|
||||
Ui bool `json:"ui"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
152
api/apps/v1alpha1/postgresql/types.go
Normal file
152
api/apps/v1alpha1/postgresql/types.go
Normal file
@@ -0,0 +1,152 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package postgresql
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Backup configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Backup Backup `json:"backup"`
|
||||
// Bootstrap configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Bootstrap Bootstrap `json:"bootstrap"`
|
||||
// Databases configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Databases map[string]Database `json:"databases,omitempty"`
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// PostgreSQL server configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Postgresql PostgreSQL `json:"postgresql"`
|
||||
// Quorum configuration for synchronous replication.
|
||||
// +kubebuilder:default:={}
|
||||
Quorum Quorum `json:"quorum"`
|
||||
// Number of Postgres replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each PostgreSQL replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="micro"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Persistent Volume Claim size available for application data.
|
||||
// +kubebuilder:default:="10Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
// Users configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Users map[string]User `json:"users,omitempty"`
|
||||
// PostgreSQL major version to deploy
|
||||
// +kubebuilder:default:="v18"
|
||||
Version Version `json:"version"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
// Password for the user.
|
||||
Password string `json:"password,omitempty"`
|
||||
// Whether the user has replication privileges.
|
||||
Replication bool `json:"replication,omitempty"`
|
||||
}
|
||||
|
||||
type Bootstrap struct {
|
||||
// Whether to restore from a backup.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// Previous cluster name before deletion.
|
||||
// +kubebuilder:default:=""
|
||||
OldName string `json:"oldName"`
|
||||
// Timestamp (RFC3339) for point-in-time recovery; empty means latest.
|
||||
// +kubebuilder:default:=""
|
||||
RecoveryTime string `json:"recoveryTime,omitempty"`
|
||||
}
|
||||
|
||||
type Quorum struct {
|
||||
// Maximum number of synchronous replicas allowed (must be less than total replicas).
|
||||
// +kubebuilder:default:=0
|
||||
MaxSyncReplicas int `json:"maxSyncReplicas"`
|
||||
// Minimum number of synchronous replicas required for commit.
|
||||
// +kubebuilder:default:=0
|
||||
MinSyncReplicas int `json:"minSyncReplicas"`
|
||||
}
|
||||
|
||||
type DatabaseRoles struct {
|
||||
// List of users with admin privileges.
|
||||
Admin []string `json:"admin,omitempty"`
|
||||
// List of users with read-only privileges.
|
||||
Readonly []string `json:"readonly,omitempty"`
|
||||
}
|
||||
|
||||
type Database struct {
|
||||
// List of enabled PostgreSQL extensions.
|
||||
Extensions []string `json:"extensions,omitempty"`
|
||||
// Roles assigned to users.
|
||||
Roles DatabaseRoles `json:"roles,omitempty"`
|
||||
}
|
||||
|
||||
type Backup struct {
|
||||
// Destination path for backups (e.g. s3://bucket/path/).
|
||||
// +kubebuilder:default:="s3://bucket/path/to/folder/"
|
||||
DestinationPath string `json:"destinationPath,omitempty"`
|
||||
// Enable regular backups.
|
||||
// +kubebuilder:default:=false
|
||||
Enabled bool `json:"enabled"`
|
||||
// S3 endpoint URL for uploads.
|
||||
// +kubebuilder:default:="http://minio-gateway-service:9000"
|
||||
EndpointURL string `json:"endpointURL,omitempty"`
|
||||
// Retention policy (e.g. "30d").
|
||||
// +kubebuilder:default:="30d"
|
||||
RetentionPolicy string `json:"retentionPolicy,omitempty"`
|
||||
// Access key for S3 authentication.
|
||||
// +kubebuilder:default:="<your-access-key>"
|
||||
S3AccessKey string `json:"s3AccessKey,omitempty"`
|
||||
// Secret key for S3 authentication.
|
||||
// +kubebuilder:default:="<your-secret-key>"
|
||||
S3SecretKey string `json:"s3SecretKey,omitempty"`
|
||||
// Cron schedule for automated backups.
|
||||
// +kubebuilder:default:="0 2 * * * *"
|
||||
Schedule string `json:"schedule,omitempty"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type PostgreSQLParameters struct {
|
||||
// Maximum number of concurrent connections to the database server.
|
||||
// +kubebuilder:default:=100
|
||||
MaxConnections int `json:"max_connections,omitempty"`
|
||||
}
|
||||
|
||||
type PostgreSQL struct {
|
||||
// PostgreSQL server parameters.
|
||||
// +kubebuilder:default:={}
|
||||
Parameters PostgreSQLParameters `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
|
||||
// +kubebuilder:validation:Enum="v18";"v17";"v16";"v15";"v14";"v13"
|
||||
type Version string
|
||||
50
api/apps/v1alpha1/qdrant/types.go
Normal file
50
api/apps/v1alpha1/qdrant/types.go
Normal file
@@ -0,0 +1,50 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package qdrant
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// Number of Qdrant replicas. Cluster mode is automatically enabled when replicas > 1.
|
||||
// +kubebuilder:default:=1
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each Qdrant replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="small"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Persistent Volume Claim size available for vector data storage.
|
||||
// +kubebuilder:default:="10Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
79
api/apps/v1alpha1/rabbitmq/types.go
Normal file
79
api/apps/v1alpha1/rabbitmq/types.go
Normal file
@@ -0,0 +1,79 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package rabbitmq
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// Number of RabbitMQ replicas.
|
||||
// +kubebuilder:default:=3
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each RabbitMQ replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="nano"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Persistent Volume Claim size available for application data.
|
||||
// +kubebuilder:default:="10Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
// Users configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Users map[string]User `json:"users,omitempty"`
|
||||
// RabbitMQ major.minor version to deploy
|
||||
// +kubebuilder:default:="v4.2"
|
||||
Version Version `json:"version"`
|
||||
// Virtual hosts configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Vhosts map[string]Vhost `json:"vhosts,omitempty"`
|
||||
}
|
||||
|
||||
type Vhost struct {
|
||||
// Virtual host roles list.
|
||||
Roles Roles `json:"roles"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
// Password for the user.
|
||||
Password string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type Roles struct {
|
||||
// List of admin users.
|
||||
Admin []string `json:"admin,omitempty"`
|
||||
// List of readonly users.
|
||||
Readonly []string `json:"readonly,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
|
||||
// +kubebuilder:validation:Enum="v4.2";"v4.1";"v4.0";"v3.13"
|
||||
type Version string
|
||||
59
api/apps/v1alpha1/redis/types.go
Normal file
59
api/apps/v1alpha1/redis/types.go
Normal file
@@ -0,0 +1,59 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package redis
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Enable password generation.
|
||||
// +kubebuilder:default:=true
|
||||
AuthEnabled bool `json:"authEnabled"`
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// Number of Redis replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each Redis replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="nano"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Persistent Volume Claim size available for application data.
|
||||
// +kubebuilder:default:="1Gi"
|
||||
Size resource.Quantity `json:"size"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:=""
|
||||
StorageClass string `json:"storageClass"`
|
||||
// Redis major version to deploy
|
||||
// +kubebuilder:default:="v8"
|
||||
Version Version `json:"version"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
|
||||
// +kubebuilder:validation:Enum="v8";"v7"
|
||||
type Version string
|
||||
77
api/apps/v1alpha1/tcpbalancer/types.go
Normal file
77
api/apps/v1alpha1/tcpbalancer/types.go
Normal file
@@ -0,0 +1,77 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package tcpbalancer
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// HTTP and HTTPS configuration.
|
||||
// +kubebuilder:default:={}
|
||||
HttpAndHttps HttpAndHttps `json:"httpAndHttps"`
|
||||
// Number of HAProxy replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each TCP Balancer replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="nano"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// List of allowed client networks.
|
||||
// +kubebuilder:default:={}
|
||||
Whitelist []string `json:"whitelist,omitempty"`
|
||||
// Secure HTTP by whitelisting client networks (default: false).
|
||||
// +kubebuilder:default:=false
|
||||
WhitelistHTTP bool `json:"whitelistHTTP"`
|
||||
}
|
||||
|
||||
type TargetPorts struct {
|
||||
// HTTP port number.
|
||||
// +kubebuilder:default:=80
|
||||
Http int `json:"http"`
|
||||
// HTTPS port number.
|
||||
// +kubebuilder:default:=443
|
||||
Https int `json:"https"`
|
||||
}
|
||||
|
||||
type HttpAndHttps struct {
|
||||
// Endpoint addresses list.
|
||||
// +kubebuilder:default:={}
|
||||
Endpoints []string `json:"endpoints,omitempty"`
|
||||
// Mode for balancer.
|
||||
// +kubebuilder:default:="tcp"
|
||||
Mode Mode `json:"mode"`
|
||||
// Target ports configuration.
|
||||
// +kubebuilder:default:={}
|
||||
TargetPorts TargetPorts `json:"targetPorts"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
|
||||
// +kubebuilder:validation:Enum="tcp";"tcp-with-proxy"
|
||||
type Mode string
|
||||
40
api/apps/v1alpha1/tenant/types.go
Normal file
40
api/apps/v1alpha1/tenant/types.go
Normal file
@@ -0,0 +1,40 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package tenant
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Deploy own Etcd cluster.
|
||||
// +kubebuilder:default:=false
|
||||
Etcd bool `json:"etcd"`
|
||||
// The hostname used to access tenant services (defaults to using the tenant name as a subdomain for its parent tenant host).
|
||||
// +kubebuilder:default:=""
|
||||
Host string `json:"host,omitempty"`
|
||||
// Deploy own Ingress Controller.
|
||||
// +kubebuilder:default:=false
|
||||
Ingress bool `json:"ingress"`
|
||||
// Deploy own Monitoring Stack.
|
||||
// +kubebuilder:default:=false
|
||||
Monitoring bool `json:"monitoring"`
|
||||
// Define resource quotas for the tenant.
|
||||
// +kubebuilder:default:={}
|
||||
ResourceQuotas map[string]resource.Quantity `json:"resourceQuotas,omitempty"`
|
||||
// Deploy own SeaweedFS.
|
||||
// +kubebuilder:default:=false
|
||||
Seaweedfs bool `json:"seaweedfs"`
|
||||
}
|
||||
53
api/apps/v1alpha1/vmdisk/types.go
Normal file
53
api/apps/v1alpha1/vmdisk/types.go
Normal file
@@ -0,0 +1,53 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package vmdisk
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Defines if disk should be considered optical.
|
||||
// +kubebuilder:default:=false
|
||||
Optical bool `json:"optical"`
|
||||
// The source image location used to create a disk.
|
||||
// +kubebuilder:default:={}
|
||||
Source Source `json:"source"`
|
||||
// The size of the disk allocated for the virtual machine.
|
||||
// +kubebuilder:default:="5Gi"
|
||||
Storage resource.Quantity `json:"storage"`
|
||||
// StorageClass used to store the data.
|
||||
// +kubebuilder:default:="replicated"
|
||||
StorageClass string `json:"storageClass"`
|
||||
}
|
||||
|
||||
type SourceImage struct {
|
||||
// Name of the image to use (uploaded as "golden image" or from the list: `ubuntu`, `fedora`, `cirros`, `alpine`, `talos`).
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type SourceHTTP struct {
|
||||
// URL to download the image.
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
type Source struct {
|
||||
// Download image from an HTTP source.
|
||||
Http *SourceHTTP `json:"http,omitempty"`
|
||||
// Use image by name.
|
||||
Image *SourceImage `json:"image,omitempty"`
|
||||
// Upload local image.
|
||||
Upload *SourceUpload `json:"upload,omitempty"`
|
||||
}
|
||||
96
api/apps/v1alpha1/vminstance/types.go
Normal file
96
api/apps/v1alpha1/vminstance/types.go
Normal file
@@ -0,0 +1,96 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package vminstance
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Cloud-init user data.
|
||||
// +kubebuilder:default:=""
|
||||
CloudInit string `json:"cloudInit"`
|
||||
// Seed string to generate SMBIOS UUID for the VM.
|
||||
// +kubebuilder:default:=""
|
||||
CloudInitSeed string `json:"cloudInitSeed"`
|
||||
// Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map
|
||||
// +kubebuilder:default:=""
|
||||
CpuModel string `json:"cpuModel"`
|
||||
// List of disks to attach.
|
||||
// +kubebuilder:default:={}
|
||||
Disks []Disk `json:"disks,omitempty"`
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// Method to pass through traffic to the VM.
|
||||
// +kubebuilder:default:="PortList"
|
||||
ExternalMethod ExternalMethod `json:"externalMethod"`
|
||||
// Ports to forward from outside the cluster.
|
||||
// +kubebuilder:default:={22}
|
||||
ExternalPorts []int `json:"externalPorts,omitempty"`
|
||||
// List of GPUs to attach (NVIDIA driver requires at least 4 GiB RAM).
|
||||
// +kubebuilder:default:={}
|
||||
Gpus []GPU `json:"gpus,omitempty"`
|
||||
// Virtual Machine preferences profile.
|
||||
// +kubebuilder:default:="ubuntu"
|
||||
InstanceProfile string `json:"instanceProfile"`
|
||||
// Virtual Machine instance type.
|
||||
// +kubebuilder:default:="u1.medium"
|
||||
InstanceType string `json:"instanceType"`
|
||||
// Resource configuration for the virtual machine.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Requested running state of the VirtualMachineInstance
|
||||
// +kubebuilder:default:="Always"
|
||||
RunStrategy RunStrategy `json:"runStrategy"`
|
||||
// List of SSH public keys for authentication.
|
||||
// +kubebuilder:default:={}
|
||||
SshKeys []string `json:"sshKeys,omitempty"`
|
||||
// Additional subnets
|
||||
// +kubebuilder:default:={}
|
||||
Subnets []Subnet `json:"subnets,omitempty"`
|
||||
}
|
||||
|
||||
type Disk struct {
|
||||
// Disk bus type (e.g. "sata").
|
||||
Bus string `json:"bus,omitempty"`
|
||||
// Disk name.
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type Subnet struct {
|
||||
// Subnet name
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
type GPU struct {
|
||||
// The name of the GPU resource to attach.
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// Number of CPU cores allocated.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Amount of memory allocated.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
// Number of CPU sockets (vCPU topology).
|
||||
Sockets resource.Quantity `json:"sockets,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="Always";"Halted";"Manual";"RerunOnFailure";"Once"
|
||||
type RunStrategy string
|
||||
|
||||
// +kubebuilder:validation:Enum="PortList";"WholeIP"
|
||||
type ExternalMethod string
|
||||
31
api/apps/v1alpha1/vpc/types.go
Normal file
31
api/apps/v1alpha1/vpc/types.go
Normal file
@@ -0,0 +1,31 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package vpc
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Subnets of a VPC
|
||||
// +kubebuilder:default:={}
|
||||
Subnets []Subnet `json:"subnets,omitempty"`
|
||||
}
|
||||
|
||||
type Subnet struct {
|
||||
// IP address range
|
||||
Cidr string `json:"cidr,omitempty"`
|
||||
// Subnet name
|
||||
Name string `json:"name"`
|
||||
}
|
||||
58
api/apps/v1alpha1/vpn/types.go
Normal file
58
api/apps/v1alpha1/vpn/types.go
Normal file
@@ -0,0 +1,58 @@
|
||||
// +kubebuilder:object:generate=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +groupName=values.helm.io
|
||||
|
||||
// +versionName=v1alpha1
|
||||
|
||||
// Code generated by values-gen. DO NOT EDIT.
|
||||
package vpn
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
v1.TypeMeta `json:",inline"`
|
||||
v1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec ConfigSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
type ConfigSpec struct {
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// List of externalIPs for service. Optional. If not specified, will use LoadBalancer service by default.
|
||||
// +kubebuilder:default:={}
|
||||
ExternalIPs []string `json:"externalIPs,omitempty"`
|
||||
// Host used to substitute into generated URLs.
|
||||
// +kubebuilder:default:=""
|
||||
Host string `json:"host"`
|
||||
// Number of VPN server replicas.
|
||||
// +kubebuilder:default:=2
|
||||
Replicas int `json:"replicas"`
|
||||
// Explicit CPU and memory configuration for each VPN server replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
||||
// +kubebuilder:default:={}
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
// Default sizing preset used when `resources` is omitted.
|
||||
// +kubebuilder:default:="nano"
|
||||
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
|
||||
// Users configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Users map[string]User `json:"users,omitempty"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
// CPU available to each replica.
|
||||
Cpu resource.Quantity `json:"cpu,omitempty"`
|
||||
// Memory (RAM) available to each replica.
|
||||
Memory resource.Quantity `json:"memory,omitempty"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
// Password for the user (autogenerated if not provided).
|
||||
Password string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum="nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
|
||||
type ResourcesPreset string
|
||||
@@ -1,29 +0,0 @@
|
||||
<!--
|
||||
https://github.com/cozystack/cozystack/releases/tag/v1.0.5
|
||||
-->
|
||||
|
||||
## Fixes
|
||||
|
||||
* **[api] Fix spurious OpenAPI post-processing errors for non-apps group versions**: The API server no longer logs false errors while generating OpenAPI specs for core and other non-`apps.cozystack.io` group versions. The post-processor now exits early when the base `Application` schemas are absent, reducing noisy startup logs without affecting application schema generation ([**@kvaps**](https://github.com/kvaps) in #2212, #2216).
|
||||
|
||||
## Documentation
|
||||
|
||||
* **[website] Add `DependenciesNotReady` troubleshooting and correct packages management build target**: Added a troubleshooting guide for packages stuck in `DependenciesNotReady`, including how to inspect operator logs and identify missing dependencies, and fixed the outdated `make image-cozystack` command to `make image-packages` in the packages management guide ([**@kvaps**](https://github.com/kvaps) in cozystack/website#450).
|
||||
|
||||
* **[website] Clarify operator-first installation order**: Reordered the platform installation guide and tutorial so users install the Cozystack operator before preparing and applying the Platform Package, matching the rest of the installation docs and reducing setup confusion during fresh installs ([**@sircthulhu**](https://github.com/sircthulhu) in cozystack/website#449).
|
||||
|
||||
* **[website] Add automated installation guide for Ansible**: Added end-to-end documentation for deploying Cozystack with the `cozystack.installer` Ansible collection, including inventory examples, distro-specific playbooks, configuration reference, verification steps, and explicit version pinning guidance to help operators automate installs safely ([**@lexfrei**](https://github.com/lexfrei) in cozystack/website#442).
|
||||
|
||||
* **[website] Expand CA rotation operations guide**: Completed the CA rotation documentation with separate Talos and Kubernetes certificate rotation procedures, dry-run preview steps, and post-rotation guidance for fetching updated `talosconfig` and `kubeconfig` files after certificate changes ([**@kvaps**](https://github.com/kvaps) in cozystack/website#406).
|
||||
|
||||
* **[website] Improve backup operations documentation**: Enhanced the operator backup and recovery guide with clearer Velero enablement steps, concrete provider and bucket examples, and more useful commands for inspecting backups, schedules, restores, CRD status, and logs ([**@androndo**](https://github.com/androndo) in cozystack/website#440).
|
||||
|
||||
* **[website] Add custom metrics collection guide**: Added a monitoring guide showing how tenants can expose their own Prometheus exporters through `VMServiceScrape` and `VMPodScrape`, including namespace labeling requirements, example manifests, verification steps, and troubleshooting advice ([**@IvanHunters**](https://github.com/IvanHunters) in cozystack/website#444).
|
||||
|
||||
* **[website] Document PackageSource and Package architecture**: Added a Key Concepts reference covering `PackageSource` and `Package` reconciliation flow, dependency handling, update propagation, rollback behavior, FluxPlunger recovery, and the `cozypkg` CLI for package management ([**@IvanHunters**](https://github.com/IvanHunters) in cozystack/website#445).
|
||||
|
||||
* **[website] Refresh v1 application and platform documentation**: Fixed the documentation auto-update flow and published a broad v1 documentation refresh covering newly documented applications, updated naming and navigation, virtualization and platform content updates, and reorganized versioned docs pages ([**@myasnikovdaniil**](https://github.com/myasnikovdaniil) in cozystack/website#439).
|
||||
|
||||
---
|
||||
|
||||
**Full Changelog**: https://github.com/cozystack/cozystack/compare/v1.0.4...v1.0.5
|
||||
@@ -68,7 +68,7 @@ kube::codegen::gen_client \
|
||||
"${SCRIPT_ROOT}/pkg/apis"
|
||||
|
||||
$CONTROLLER_GEN object:headerFile="hack/boilerplate.go.txt" paths="./api/..."
|
||||
$CONTROLLER_GEN rbac:roleName=manager-role crd paths="./api/..." output:crd:artifacts:config=${TMPDIR}
|
||||
$CONTROLLER_GEN rbac:roleName=manager-role crd paths="./api/..." output:crd:artifacts:config=${TMPDIR}
|
||||
|
||||
mv ${TMPDIR}/cozystack.io_packages.yaml ${OPERATOR_CRDDIR}/cozystack.io_packages.yaml
|
||||
mv ${TMPDIR}/cozystack.io_packagesources.yaml ${OPERATOR_CRDDIR}/cozystack.io_packagesources.yaml
|
||||
@@ -80,3 +80,6 @@ mv ${TMPDIR}/backups.cozystack.io*.yaml ${BACKUPS_CORE_CRDDIR}/
|
||||
mv ${TMPDIR}/strategy.backups.cozystack.io*.yaml ${BACKUPSTRATEGY_CRDDIR}/
|
||||
|
||||
mv ${TMPDIR}/*.yaml ${COZY_CONTROLLER_CRDDIR}/
|
||||
|
||||
# Tidy dependencies for standalone api/apps/v1alpha1 submodule
|
||||
(cd "${SCRIPT_ROOT}/api/apps/v1alpha1" && go mod tidy)
|
||||
|
||||
@@ -14,3 +14,4 @@ gh release upload --clobber $version _out/assets/kernel-amd64
|
||||
gh release upload --clobber $version _out/assets/initramfs-metal-amd64.xz
|
||||
gh release upload --clobber $version _out/assets/cozypkg-*.tar.gz
|
||||
gh release upload --clobber $version _out/assets/cozypkg-checksums.txt
|
||||
gh release upload --clobber $version _out/assets/openapi.json
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'bucket' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/bucket/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
@@ -4,7 +4,7 @@ include ../../../hack/common-envs.mk
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'clickhouse' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/clickhouse/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
image:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'foundationdb' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/foundationdb/types.go
|
||||
@@ -3,5 +3,5 @@ NAME=harbor
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'harbor' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/harbor/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
@@ -17,7 +17,7 @@ image-nginx:
|
||||
rm -f images/nginx-cache.json
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'httpcache' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/httpcache/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
update:
|
||||
|
||||
@@ -2,5 +2,5 @@ include ../../../hack/package.mk
|
||||
PRESET_ENUM := ["nano","micro","small","medium","large","xlarge","2xlarge"]
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'kafka' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/kafka/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
KUBERNETES_VERSIONS = $(shell awk -F'"' '{print $$2}' files/versions.yaml)
|
||||
KUBERNETES_VERSION = v1.35
|
||||
KUBERNETES_PKG_TAG = $(shell awk '$$1 == "version:" {print $$2}' Chart.yaml)
|
||||
|
||||
include ../../../hack/common-envs.mk
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'kubernetes' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/kubernetes/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
update:
|
||||
@@ -15,19 +15,17 @@ update:
|
||||
image: image-ubuntu-container-disk image-kubevirt-cloud-provider image-kubevirt-csi-driver image-cluster-autoscaler
|
||||
|
||||
image-ubuntu-container-disk:
|
||||
$(foreach ver,$(KUBERNETES_VERSIONS), \
|
||||
docker buildx build images/ubuntu-container-disk \
|
||||
--build-arg KUBERNETES_VERSION=$(ver) \
|
||||
--tag $(REGISTRY)/ubuntu-container-disk:$(call settag,$(ver)) \
|
||||
--tag $(REGISTRY)/ubuntu-container-disk:$(call settag,$(ver)-$(TAG)) \
|
||||
--cache-from type=registry,ref=$(REGISTRY)/ubuntu-container-disk:$(call settag,$(ver)) \
|
||||
--cache-to type=inline \
|
||||
--metadata-file images/ubuntu-container-disk-$(ver).json \
|
||||
$(BUILDX_ARGS) && \
|
||||
echo "$(REGISTRY)/ubuntu-container-disk:$(call settag,$(ver))@$$(yq e '."containerimage.digest"' images/ubuntu-container-disk-$(ver).json -o json -r)" \
|
||||
> images/ubuntu-container-disk-$(ver).tag && \
|
||||
rm -f images/ubuntu-container-disk-$(ver).json; \
|
||||
)
|
||||
docker buildx build images/ubuntu-container-disk \
|
||||
--build-arg KUBERNETES_VERSION=${KUBERNETES_VERSION} \
|
||||
--tag $(REGISTRY)/ubuntu-container-disk:$(call settag,$(KUBERNETES_VERSION)) \
|
||||
--tag $(REGISTRY)/ubuntu-container-disk:$(call settag,$(KUBERNETES_VERSION)-$(TAG)) \
|
||||
--cache-from type=registry,ref=$(REGISTRY)/ubuntu-container-disk:latest \
|
||||
--cache-to type=inline \
|
||||
--metadata-file images/ubuntu-container-disk.json \
|
||||
$(BUILDX_ARGS)
|
||||
echo "$(REGISTRY)/ubuntu-container-disk:$(call settag,$(KUBERNETES_VERSION))@$$(yq e '."containerimage.digest"' images/ubuntu-container-disk.json -o json -r)" \
|
||||
> images/ubuntu-container-disk.tag
|
||||
rm -f images/ubuntu-container-disk.json
|
||||
|
||||
image-kubevirt-cloud-provider:
|
||||
docker buildx build images/kubevirt-cloud-provider \
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
ttl.sh/rjfkdsjflsk/ubuntu-container-disk:v1.30@sha256:8c2276f68beb67edf5bf76d6c97b271dd9303b336e1d5850ae2b91a590c9bb57
|
||||
@@ -1 +0,0 @@
|
||||
ttl.sh/rjfkdsjflsk/ubuntu-container-disk:v1.31@sha256:2b631cd227bc9b1bae16de033830e756cd6590b512dc0d2b13367ee626f3e4ca
|
||||
@@ -1 +0,0 @@
|
||||
ttl.sh/rjfkdsjflsk/ubuntu-container-disk:v1.32@sha256:600d6ce7df4eaa8cc79c7d6d1b01ecac43e7696beb84eafce752d9210a16455f
|
||||
@@ -1 +0,0 @@
|
||||
ttl.sh/rjfkdsjflsk/ubuntu-container-disk:v1.33@sha256:243e55d6f2887a4f6ce8526de52fd083b7b88194d5c7f3eaa51b87efb557ac88
|
||||
@@ -1 +0,0 @@
|
||||
ttl.sh/rjfkdsjflsk/ubuntu-container-disk:v1.34@sha256:ad8377d5644ba51729dc69dff4c9f6b4a48957075d054a58c61a45d0bb41f6af
|
||||
@@ -1 +0,0 @@
|
||||
ttl.sh/rjfkdsjflsk/ubuntu-container-disk:v1.35@sha256:1c2f2430383a9b9882358c60c194465c1b6092b4aa77536a0343cf74155c0067
|
||||
@@ -0,0 +1 @@
|
||||
ghcr.io/cozystack/cozystack/ubuntu-container-disk:v1.35@sha256:39f626c802dd84f95720ffb54fcd80dfb8a58ac280498870d0a1aa30d4252f94
|
||||
@@ -74,7 +74,7 @@ spec:
|
||||
volumes:
|
||||
- name: system
|
||||
containerDisk:
|
||||
image: "{{ $.Files.Get (printf "images/ubuntu-container-disk-%s.tag" $.Values.version) | trim }}"
|
||||
image: "{{ $.Files.Get "images/ubuntu-container-disk.tag" | trim }}"
|
||||
- name: ephemeral
|
||||
emptyDisk:
|
||||
capacity: {{ .group.ephemeralStorage | default "20Gi" }}
|
||||
@@ -249,9 +249,6 @@ spec:
|
||||
joinConfiguration:
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs: {}
|
||||
# Ignore this for 1.31
|
||||
ignorePreflightErrors:
|
||||
- FileExisting-conntrack
|
||||
discovery:
|
||||
bootstrapToken:
|
||||
apiServerEndpoint: {{ $.Release.Name }}.{{ $.Release.Namespace }}.svc:6443
|
||||
|
||||
@@ -4,7 +4,7 @@ include ../../../hack/common-envs.mk
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'mariadb' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/mariadb/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
update:
|
||||
|
||||
@@ -3,7 +3,7 @@ include ../../../hack/package.mk
|
||||
.PHONY: generate update
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'mongodb' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/mongodb/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
update:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'nats' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/nats/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'openbao' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/openbao/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'postgresql' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/postgresql/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
update:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'qdrant' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/qdrant/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'rabbitmq' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/rabbitmq/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
update:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'redis' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/redis/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
update:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'tcpbalancer' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/tcpbalancer/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'tenant' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/tenant/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'vmdisk' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/vmdisk/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'vminstance' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/vminstance/types.go
|
||||
#INSTANCE_TYPES=$$(yq e '.metadata.name' -o=json -r ../../system/kubevirt-instancetypes/templates/instancetypes.yaml | yq 'split(" ") | . + [""]' -o json) \
|
||||
# && yq -i -o json ".properties.instanceType.enum = $${INSTANCE_TYPES}" values.schema.json
|
||||
PREFERENCES=$$(yq e '.metadata.name' -o=json -r ../../system/kubevirt-instancetypes/templates/preferences.yaml | yq 'split(" ") | . + [""]' -o json) \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json
|
||||
cozyvalues-gen -m 'vpc' -v values.yaml -s values.schema.json -g ../../../api/apps/v1alpha1/vpc/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
update:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
include ../../../hack/package.mk
|
||||
|
||||
generate:
|
||||
cozyvalues-gen -v values.yaml -s values.schema.json -r README.md
|
||||
cozyvalues-gen -m 'vpn' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/vpn/types.go
|
||||
../../../hack/update-crd.sh
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
kind: PackageSource
|
||||
metadata:
|
||||
name: cozystack.cozystack-scheduler
|
||||
spec:
|
||||
sourceRef:
|
||||
kind: OCIRepository
|
||||
name: cozystack-packages
|
||||
namespace: cozy-system
|
||||
path: /
|
||||
variants:
|
||||
- name: default
|
||||
components:
|
||||
- name: cozystack-scheduler
|
||||
path: system/cozystack-scheduler
|
||||
install:
|
||||
namespace: kube-system
|
||||
releaseName: cozystack-scheduler
|
||||
@@ -156,6 +156,5 @@
|
||||
{{include "cozystack.platform.package.default" (list "cozystack.bootbox" $) }}
|
||||
{{- end }}
|
||||
{{include "cozystack.platform.package.optional.default" (list "cozystack.hetzner-robotlb" $) }}
|
||||
{{include "cozystack.platform.package.optional.default" (list "cozystack.cozystack-scheduler" $) }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
{{- $endpoint := printf "s3.%s" .Values._namespace.host }}
|
||||
{{- range $name, $user := .Values.users }}
|
||||
{{- $secretName := printf "%s-%s" $.Values.bucketName $name }}
|
||||
{{- $existingSecret := lookup "v1" "Secret" $.Release.Namespace $secretName }}
|
||||
{{- if $existingSecret }}
|
||||
{{- $bucketInfo := fromJson (b64dec (index $existingSecret.data "BucketInfo")) }}
|
||||
{{- $endpoint = trimPrefix "https://" (index $bucketInfo.spec.secretS3 "endpoint") }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -26,6 +17,6 @@ spec:
|
||||
image: "{{ $.Files.Get "images/s3manager.tag" | trim }}"
|
||||
env:
|
||||
- name: ENDPOINT
|
||||
value: {{ $endpoint | quote }}
|
||||
value: "s3.{{ .Values._namespace.host }}"
|
||||
- name: SKIP_SSL_VERIFICATION
|
||||
value: "true"
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
apiVersion: v2
|
||||
name: cozy-cozystack-scheduler
|
||||
version: 0.1.0
|
||||
@@ -1,10 +0,0 @@
|
||||
export NAME=cozystack-scheduler
|
||||
export NAMESPACE=kube-system
|
||||
|
||||
include ../../../hack/package.mk
|
||||
|
||||
update:
|
||||
rm -rf crds templates values.yaml Chart.yaml
|
||||
tag=$$(git ls-remote --tags --sort="v:refname" https://github.com/cozystack/cozystack-scheduler | awk -F'[/^]' 'END{print $$3}') && \
|
||||
curl -sSL https://github.com/cozystack/cozystack-scheduler/archive/refs/tags/$${tag}.tar.gz | \
|
||||
tar xzvf - --strip 2 cozystack-scheduler-$${tag#*v}/chart
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +0,0 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: cozystack-scheduler
|
||||
rules:
|
||||
- apiGroups: ["cozystack.io"]
|
||||
resources:
|
||||
- schedulingclasses
|
||||
verbs: ["get", "list", "watch"]
|
||||
@@ -1,38 +0,0 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: cozystack-scheduler:kube-scheduler
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: system:kube-scheduler
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: cozystack-scheduler
|
||||
namespace: {{ .Release.Namespace }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: cozystack-scheduler:volume-scheduler
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: system:volume-scheduler
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: cozystack-scheduler
|
||||
namespace: {{ .Release.Namespace }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: cozystack-scheduler
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: cozystack-scheduler
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: cozystack-scheduler
|
||||
namespace: {{ .Release.Namespace }}
|
||||
@@ -1,54 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cozystack-scheduler-config
|
||||
namespace: {{ .Release.Namespace }}
|
||||
data:
|
||||
scheduler-config.yaml: |
|
||||
apiVersion: kubescheduler.config.k8s.io/v1
|
||||
kind: KubeSchedulerConfiguration
|
||||
leaderElection:
|
||||
leaderElect: true
|
||||
resourceNamespace: {{ .Release.Namespace }}
|
||||
resourceName: cozystack-scheduler
|
||||
profiles:
|
||||
- schedulerName: cozystack-scheduler
|
||||
plugins:
|
||||
preFilter:
|
||||
disabled:
|
||||
- name: InterPodAffinity
|
||||
- name: NodeAffinity
|
||||
- name: PodTopologySpread
|
||||
enabled:
|
||||
- name: CozystackInterPodAffinity
|
||||
- name: CozystackNodeAffinity
|
||||
- name: CozystackPodTopologySpread
|
||||
- name: CozystackSchedulingClass
|
||||
filter:
|
||||
disabled:
|
||||
- name: InterPodAffinity
|
||||
- name: NodeAffinity
|
||||
- name: PodTopologySpread
|
||||
enabled:
|
||||
- name: CozystackInterPodAffinity
|
||||
- name: CozystackNodeAffinity
|
||||
- name: CozystackPodTopologySpread
|
||||
- name: CozystackSchedulingClass
|
||||
preScore:
|
||||
disabled:
|
||||
- name: InterPodAffinity
|
||||
- name: NodeAffinity
|
||||
- name: PodTopologySpread
|
||||
enabled:
|
||||
- name: CozystackInterPodAffinity
|
||||
- name: CozystackNodeAffinity
|
||||
- name: CozystackPodTopologySpread
|
||||
score:
|
||||
disabled:
|
||||
- name: InterPodAffinity
|
||||
- name: NodeAffinity
|
||||
- name: PodTopologySpread
|
||||
enabled:
|
||||
- name: CozystackInterPodAffinity
|
||||
- name: CozystackNodeAffinity
|
||||
- name: CozystackPodTopologySpread
|
||||
@@ -1,37 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: cozystack-scheduler
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: cozystack-scheduler
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: cozystack-scheduler
|
||||
spec:
|
||||
serviceAccountName: cozystack-scheduler
|
||||
containers:
|
||||
- name: cozystack-scheduler
|
||||
image: {{ .Values.image }}
|
||||
command:
|
||||
- /cozystack-scheduler
|
||||
- --config=/etc/kubernetes/scheduler-config.yaml
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 10259
|
||||
scheme: HTTPS
|
||||
initialDelaySeconds: 15
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /etc/kubernetes/scheduler-config.yaml
|
||||
subPath: scheduler-config.yaml
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: cozystack-scheduler-config
|
||||
@@ -1,40 +0,0 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: cozystack-scheduler:extension-apiserver-authentication-reader
|
||||
namespace: kube-system
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: extension-apiserver-authentication-reader
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: cozystack-scheduler
|
||||
namespace: {{ .Release.Namespace }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: cozystack-scheduler:leader-election
|
||||
namespace: {{ .Release.Namespace }}
|
||||
rules:
|
||||
- apiGroups: ["coordination.k8s.io"]
|
||||
resources: ["leases"]
|
||||
verbs: ["create", "get", "list", "update", "watch"]
|
||||
- apiGroups: ["coordination.k8s.io"]
|
||||
resources: ["leasecandidates"]
|
||||
verbs: ["create", "get", "list", "update", "watch"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: cozystack-scheduler:leader-election
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: cozystack-scheduler:leader-election
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: cozystack-scheduler
|
||||
namespace: {{ .Release.Namespace }}
|
||||
@@ -1,5 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: cozystack-scheduler
|
||||
namespace: {{ .Release.Namespace }}
|
||||
@@ -1,2 +0,0 @@
|
||||
image: ghcr.io/cozystack/cozystack/cozystack-scheduler:v0.1.0@sha256:5f7150c82177478467ff80628acb5a400291aff503364aa9e26fc346d79a73cf
|
||||
replicas: 1
|
||||
@@ -224,8 +224,8 @@ func buildPostProcessV3(kindSchemas map[string]string) func(*spec3.OpenAPI) (*sp
|
||||
base, ok1 := doc.Components.Schemas[baseRef]
|
||||
list, ok2 := doc.Components.Schemas[baseListRef]
|
||||
stat, ok3 := doc.Components.Schemas[baseStatusRef]
|
||||
if !(ok1 && ok2 && ok3) {
|
||||
return doc, nil // not the apps GV — nothing to patch
|
||||
if !(ok1 && ok2 && ok3) && len(kindSchemas) > 0 {
|
||||
return doc, fmt.Errorf("base Application* schemas not found")
|
||||
}
|
||||
|
||||
// Clone base schemas for each kind
|
||||
@@ -339,8 +339,8 @@ func buildPostProcessV2(kindSchemas map[string]string) func(*spec.Swagger) (*spe
|
||||
base, ok1 := defs[baseRef]
|
||||
list, ok2 := defs[baseListRef]
|
||||
stat, ok3 := defs[baseStatusRef]
|
||||
if !(ok1 && ok2 && ok3) {
|
||||
return sw, nil // not the apps GV — nothing to patch
|
||||
if !(ok1 && ok2 && ok3) && len(kindSchemas) > 0 {
|
||||
return sw, fmt.Errorf("base Application* schemas not found")
|
||||
}
|
||||
|
||||
for kind, raw := range kindSchemas {
|
||||
|
||||
245
tools/openapi-gen/main.go
Normal file
245
tools/openapi-gen/main.go
Normal file
@@ -0,0 +1,245 @@
|
||||
// Copyright 2024 The Cozystack Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Command openapi-gen assembles the OpenAPI v3 spec for apps.cozystack.io from
|
||||
// ApplicationDefinition YAML files in the repository.
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
cozyv1alpha1 "github.com/cozystack/cozystack/api/v1alpha1"
|
||||
sampleopenapi "github.com/cozystack/cozystack/pkg/generated/openapi"
|
||||
"k8s.io/kube-openapi/pkg/validation/spec"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
const apiPrefix = "com.github.cozystack.cozystack.pkg.apis.apps.v1alpha1"
|
||||
|
||||
func main() {
|
||||
if err := run(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func run() error {
|
||||
// Find all ApplicationDefinition YAML files
|
||||
pattern := "packages/system/*-rd/cozyrds/*.yaml"
|
||||
matches, err := filepath.Glob(pattern)
|
||||
if err != nil {
|
||||
return fmt.Errorf("glob %q: %w", pattern, err)
|
||||
}
|
||||
if len(matches) == 0 {
|
||||
return fmt.Errorf("no files matched %q — run from repo root", pattern)
|
||||
}
|
||||
|
||||
// Parse ApplicationDefinitions and build kindSchemas map
|
||||
kindSchemas := map[string]string{}
|
||||
for _, path := range matches {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("read %s: %w", path, err)
|
||||
}
|
||||
var appDef cozyv1alpha1.ApplicationDefinition
|
||||
if err := yaml.Unmarshal(data, &appDef); err != nil {
|
||||
return fmt.Errorf("parse %s: %w", path, err)
|
||||
}
|
||||
kind := appDef.Spec.Application.Kind
|
||||
schema := appDef.Spec.Application.OpenAPISchema
|
||||
if kind == "" || schema == "" {
|
||||
continue
|
||||
}
|
||||
kindSchemas[kind] = schema
|
||||
}
|
||||
|
||||
if len(kindSchemas) == 0 {
|
||||
return fmt.Errorf("no ApplicationDefinitions with kind+schema found")
|
||||
}
|
||||
|
||||
// Get base OpenAPI definitions (Application, ApplicationList, ApplicationStatus + k8s types)
|
||||
defs := sampleopenapi.GetOpenAPIDefinitions(func(path string) spec.Ref {
|
||||
name := sanitizeName(path)
|
||||
return spec.MustCreateRef("#/components/schemas/" + name)
|
||||
})
|
||||
|
||||
// Build schemas map
|
||||
schemas := map[string]*spec.Schema{}
|
||||
for path, def := range defs {
|
||||
name := sanitizeName(path)
|
||||
s := def.Schema
|
||||
schemas[name] = &s
|
||||
}
|
||||
|
||||
baseRef := apiPrefix + ".Application"
|
||||
baseListRef := apiPrefix + ".ApplicationList"
|
||||
baseStatusRef := apiPrefix + ".ApplicationStatus"
|
||||
|
||||
base, ok1 := schemas[baseRef]
|
||||
baseList, ok2 := schemas[baseListRef]
|
||||
baseStat, ok3 := schemas[baseStatusRef]
|
||||
if !ok1 || !ok2 || !ok3 {
|
||||
return fmt.Errorf("base Application schemas not found in GetOpenAPIDefinitions output")
|
||||
}
|
||||
|
||||
// For each kind, clone base schemas and inject per-kind spec
|
||||
for kind, rawSchema := range kindSchemas {
|
||||
ref := apiPrefix + "." + kind
|
||||
statusRef := ref + "Status"
|
||||
listRef := ref + "List"
|
||||
|
||||
obj := deepCopySchema(base)
|
||||
status := deepCopySchema(baseStat)
|
||||
list := deepCopySchema(baseList)
|
||||
|
||||
// Set x-kubernetes-group-version-kind
|
||||
obj.Extensions = map[string]interface{}{
|
||||
"x-kubernetes-group-version-kind": []interface{}{
|
||||
map[string]interface{}{"group": "apps.cozystack.io", "version": "v1alpha1", "kind": kind},
|
||||
},
|
||||
}
|
||||
list.Extensions = map[string]interface{}{
|
||||
"x-kubernetes-group-version-kind": []interface{}{
|
||||
map[string]interface{}{"group": "apps.cozystack.io", "version": "v1alpha1", "kind": kind + "List"},
|
||||
},
|
||||
}
|
||||
|
||||
// Fix refs inside obj and list
|
||||
if prop, ok := obj.Properties["status"]; ok {
|
||||
prop.Ref = spec.MustCreateRef("#/components/schemas/" + statusRef)
|
||||
obj.Properties["status"] = prop
|
||||
}
|
||||
if list.Properties != nil {
|
||||
if items := list.Properties["items"]; items.Items != nil && items.Items.Schema != nil {
|
||||
items.Items.Schema.Ref = spec.MustCreateRef("#/components/schemas/" + ref)
|
||||
list.Properties["items"] = items
|
||||
}
|
||||
}
|
||||
|
||||
// Inject spec schema
|
||||
if err := patchSpec(obj, rawSchema); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "warning: kind %s spec patch failed: %v\n", kind, err)
|
||||
}
|
||||
|
||||
schemas[ref] = obj
|
||||
schemas[statusRef] = status
|
||||
schemas[listRef] = list
|
||||
}
|
||||
|
||||
// Remove base Application schemas
|
||||
delete(schemas, baseRef)
|
||||
delete(schemas, baseListRef)
|
||||
delete(schemas, baseStatusRef)
|
||||
|
||||
// Get version from environment
|
||||
version := os.Getenv("VERSION")
|
||||
if version == "" {
|
||||
version = "dev"
|
||||
}
|
||||
|
||||
// Sort schema names for deterministic output
|
||||
schemaNames := make([]string, 0, len(schemas))
|
||||
for name := range schemas {
|
||||
schemaNames = append(schemaNames, name)
|
||||
}
|
||||
sort.Strings(schemaNames)
|
||||
orderedSchemas := make(map[string]*spec.Schema, len(schemas))
|
||||
for _, name := range schemaNames {
|
||||
orderedSchemas[name] = schemas[name]
|
||||
}
|
||||
|
||||
doc := map[string]interface{}{
|
||||
"openapi": "3.0.0",
|
||||
"info": map[string]interface{}{
|
||||
"title": "Cozystack apps.cozystack.io API",
|
||||
"version": version,
|
||||
},
|
||||
"paths": map[string]interface{}{},
|
||||
"components": map[string]interface{}{
|
||||
"schemas": orderedSchemas,
|
||||
},
|
||||
}
|
||||
|
||||
enc := json.NewEncoder(os.Stdout)
|
||||
enc.SetIndent("", " ")
|
||||
return enc.Encode(doc)
|
||||
}
|
||||
|
||||
// sanitizeName converts a Go type path to an OpenAPI component name.
|
||||
// e.g. "github.com/cozystack/cozystack/pkg/apis/apps/v1alpha1.Application"
|
||||
// → "com.github.cozystack.cozystack.pkg.apis.apps.v1alpha1.Application"
|
||||
func sanitizeName(path string) string {
|
||||
// Split on last "." to separate package path from type name
|
||||
lastDot := strings.LastIndex(path, ".")
|
||||
if lastDot < 0 {
|
||||
return strings.ReplaceAll(path, "/", ".")
|
||||
}
|
||||
pkgPath := path[:lastDot]
|
||||
typeName := path[lastDot+1:]
|
||||
// Reverse the domain component (github.com → com.github)
|
||||
parts := strings.Split(pkgPath, "/")
|
||||
if len(parts) > 0 && strings.Contains(parts[0], ".") {
|
||||
domainParts := strings.Split(parts[0], ".")
|
||||
for i, j := 0, len(domainParts)-1; i < j; i, j = i+1, j-1 {
|
||||
domainParts[i], domainParts[j] = domainParts[j], domainParts[i]
|
||||
}
|
||||
parts[0] = strings.Join(domainParts, ".")
|
||||
}
|
||||
return strings.Join(parts, ".") + "." + typeName
|
||||
}
|
||||
|
||||
func deepCopySchema(in *spec.Schema) *spec.Schema {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
raw, err := json.Marshal(in)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("marshal schema: %w", err))
|
||||
}
|
||||
var out spec.Schema
|
||||
if err := json.Unmarshal(raw, &out); err != nil {
|
||||
panic(fmt.Errorf("unmarshal schema: %w", err))
|
||||
}
|
||||
return &out
|
||||
}
|
||||
|
||||
func patchSpec(target *spec.Schema, raw string) error {
|
||||
raw = strings.TrimSpace(raw)
|
||||
if raw == "" {
|
||||
if target.Properties == nil {
|
||||
target.Properties = map[string]spec.Schema{}
|
||||
}
|
||||
prop := target.Properties["spec"]
|
||||
prop.AdditionalProperties = &spec.SchemaOrBool{Allows: true}
|
||||
target.Properties["spec"] = prop
|
||||
return nil
|
||||
}
|
||||
var custom spec.Schema
|
||||
if err := json.Unmarshal([]byte(raw), &custom); err != nil {
|
||||
return err
|
||||
}
|
||||
if custom.AdditionalProperties == nil {
|
||||
custom.AdditionalProperties = &spec.SchemaOrBool{Allows: true}
|
||||
}
|
||||
if target.Properties == nil {
|
||||
target.Properties = map[string]spec.Schema{}
|
||||
}
|
||||
target.Properties["spec"] = custom
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user