app-service,tapr,cli: support kubeblocks middleware mongodb minio (#1834)

* app-service,tapr,cli: support kubeblocks middleware mongodb minio

* set image tag

* fix: add KB_MIDDLEWARES env

* fix: rabbitmq addon chart location url
This commit is contained in:
hysyeah 2025-09-25 15:25:11 +08:00 committed by GitHub
parent d60accd2f6
commit 6cbd31a11f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 145376 additions and 16999 deletions

View file

@ -76,4 +76,7 @@ run_cmd "cp -rf framework/bfl/.olares/config/launcher ${DIST}/wizard/config/"
echo "packaging gpu ..."
run_cmd "cp -rf infrastructure/gpu/.olares/config/gpu ${DIST}/wizard/config/"
echo "packaging kubeblocks ..."
run_cmd "cp -rf infrastructure/kubeblocks/.olares/config/kubeblocks ${DIST}/wizard/config/"
echo "packaging completed"

View file

@ -66,6 +66,7 @@ func (l *linuxInstallPhaseBuilder) installTerminus() phase {
return []module.Module{
&terminus.GetNATGatewayIPModule{},
&terminus.InstallAccountModule{},
&terminus.InstallKubeblocksModule{},
&terminus.InstallSettingsModule{},
&terminus.InstallOsSystemModule{},
&terminus.InstallLauncherModule{},

View file

@ -30,6 +30,7 @@ func (m *macosInstallPhaseBuilder) installTerminus() phase {
return []module.Module{
&terminus.GetNATGatewayIPModule{},
&terminus.InstallAccountModule{},
&terminus.InstallKubeblocksModule{},
&terminus.InstallSettingsModule{},
&terminus.InstallOsSystemModule{},
&terminus.InstallLauncherModule{},

View file

@ -57,6 +57,10 @@ func (m *Manager) Package() error {
return err
}
if err := m.packageKubeBlocks(); err != nil {
return err
}
return nil
}
@ -121,3 +125,11 @@ func (m *Manager) packageGPU() error {
filepath.Join(m.distPath, "wizard/config/gpu"),
)
}
func (m *Manager) packageKubeBlocks() error {
fmt.Println("package kubeblocks ...")
return util.CopyDirectory(
filepath.Join(m.olaresRepoRoot, "infrastructure/kubeblocks/.olares/config/kubeblocks"),
filepath.Join(m.distPath, "wizard/config/kubeblocks"),
)
}

View file

@ -0,0 +1,50 @@
package terminus
import (
"fmt"
"path/filepath"
"time"
"github.com/beclab/Olares/cli/pkg/common"
"github.com/beclab/Olares/cli/pkg/core/connector"
"github.com/beclab/Olares/cli/pkg/core/logger"
"github.com/beclab/Olares/cli/pkg/core/task"
"github.com/pkg/errors"
)
type InstallKubeblocks struct {
common.KubeAction
}
func (t *InstallKubeblocks) Execute(runtime connector.Runtime) error {
kubectl := "kubectl"
kubeblocksCRDsPath := filepath.Join(runtime.GetInstallerDir(), "wizard/config/kubeblocks/kubeblocks_crds.yaml")
applyCRDsCmd := fmt.Sprintf("%s apply -f %s --server-side", kubectl, kubeblocksCRDsPath)
_, err := runtime.GetRunner().SudoCmd(applyCRDsCmd, false, true)
if err != nil {
return errors.Wrap(errors.WithStack(err), "failed to apply kubeblocks_crds.yaml")
}
return nil
}
type InstallKubeblocksModule struct {
common.KubeModule
}
func (m *InstallKubeblocksModule) Init() {
logger.InfoInstallationProgress("Installing KubeBlocks ...")
m.Name = "InstallKubeblocksModule"
installKubeblocks := &task.LocalTask{
Name: "InstallKubeblocks",
Action: &InstallKubeblocks{},
Retry: 3,
Delay: 10 * time.Second,
}
m.Tasks = []task.Interface{
installKubeblocks,
}
}

View file

@ -178,7 +178,7 @@ spec:
priorityClassName: "system-cluster-critical"
containers:
- name: app-service
image: beclab/app-service:0.4.5
image: beclab/app-service:0.4.6
imagePullPolicy: IfNotPresent
securityContext:
runAsUser: 0
@ -195,6 +195,8 @@ spec:
value: "vault,desktop,message,search,appstore,notification,dashboard,settings,profile"
- name: SYS_APPS
value: "market,auth,citus,desktop,did,docs,files,fsnotify,headscale,infisical,intentprovider,ksserver,message,mongo,monitoring,notifications,profile,redis,recommend,seafile,search,search-admin,settings,systemserver,tapr,vault,video,zinc,accounts,control-hub,dashboard,nitro,olares-app"
- name: KB_MIDDLEWARES
value: "mongodb,minio"
- name: GENERATED_APPS
value: "citus,mongo-cluster-cfg,mongo-cluster-mongos,mongo-cluster-rs0,frp-agent,l4-bfl-proxy,drc-redis-cluster,appdata-backend,argoworkflows,argoworkflow-workflow-controller,velero,kvrocks"
- name: WS_CONTAINER_IMAGE

View file

@ -121,7 +121,7 @@ spec:
name: check-appservice
containers:
- name: chartrepo
image: beclab/dynamic-chart-repository:v0.1.16
image: beclab/dynamic-chart-repository:v0.2.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 81

View file

@ -101,7 +101,7 @@ spec:
name: check-chart-repo
containers:
- name: appstore-backend
image: beclab/market-backend:v0.4.31
image: beclab/market-backend:v0.5.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 81

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,8 @@
apiVersion: v1
target: prebuilt
output:
containers:
-
name: apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks-tools:1.0.0
-
name: apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks:1.0.0

View file

@ -0,0 +1,96 @@
apiVersion: extensions.kubeblocks.io/v1alpha1
kind: Addon
metadata:
name: minio
spec:
defaultInstallValues:
- enabled: true
resources: {}
description: etcd is a strongly consistent, distributed key-value store that provides
a reliable way to store data that needs to be accessed by a distributed system
or cluster of machines.
helm:
chartLocationURL: file:///minio-1.0.0.tgz
chartsImage: beclab/kubeblock-addon-charts:v1.0.0
chartsPathInImage: /charts
installValues: {}
valuesMapping:
jsonMap: {}
valueMap: {}
install:
enabled: true
resources: {}
installable:
autoInstall: true
provider: community
type: Helm
version: 1.0.0
---
apiVersion: extensions.kubeblocks.io/v1alpha1
kind: Addon
metadata:
annotations:
addon.kubeblocks.io/kubeblocks-version: '>=0.9.0'
labels:
addon.kubeblocks.io/model: document
addon.kubeblocks.io/name: mongodb
addon.kubeblocks.io/provider: community
addon.kubeblocks.io/version: 1.0.0
name: mongodb
spec:
defaultInstallValues:
- enabled: true
description: MongoDB is a document database designed for ease of application development
and scaling.
helm:
chartLocationURL: file:///mongodb-1.0.0.tgz
chartsImage: beclab/kubeblock-addon-charts:v1.0.0
installable:
autoInstall: true
type: Helm
---
apiVersion: extensions.kubeblocks.io/v1alpha1
kind: Addon
metadata:
annotations:
addon.kubeblocks.io/kubeblocks-version: '>=1.0.0'
labels:
addon.kubeblocks.io/model: search-engine
addon.kubeblocks.io/name: elasticsearch
addon.kubeblocks.io/provider: community
addon.kubeblocks.io/version: 1.0.0
name: elasticsearch
spec:
defaultInstallValues:
- enabled: true
description: Elasticsearch is a distributed, RESTful search engine optimized for
speed and relevance on production-scale workloads.
helm:
chartLocationURL: file:///elasticsearch-1.0.0-alpha.0.tgz
chartsImage: beclab/kubeblock-addon-charts:v1.0.0
installable:
autoInstall: true
type: Helm
---
apiVersion: extensions.kubeblocks.io/v1alpha1
kind: Addon
metadata:
annotations:
addon.kubeblocks.io/kubeblocks-version: '>=1.0.0'
labels:
addon.kubeblocks.io/model: message
addon.kubeblocks.io/name: rabbitmq
addon.kubeblocks.io/provider: community
addon.kubeblocks.io/version: 1.0.0
name: rabbitmq
spec:
defaultInstallValues:
- enabled: true
description: RabbitMQ is a reliable and mature messaging and streaming broker.
helm:
chartLocationURL: file:///rabbitmq-1.0.0-alpha.0.tgz
chartsImage: beclab/kubeblock-addon-charts:v1.0.0
installable:
autoInstall: true
type: Helm

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,5 @@
# kubeblocks
## Overview
KubeBlocks provides a single, production-grade control plane to run, manage, and scale any database—from MySQL and Postgres to Kafka and MongoDB—with a consistent, unified API.

View file

@ -55,52 +55,9 @@ spec:
hostPath:
type: DirectoryOrCreate
path: '{{ $dbbackup_rootpath }}/pg_backup'
initContainers:
- name: init-dbspace
image: busybox:1.28
volumeMounts:
- name: dbdata-dir
mountPath: /dbdata
command:
- sh
- -c
- |
mkdir -p /dbdata/mdbdata && \
mkdir -p /dbdata/mdbdata-config && \
chown 1001 /dbdata/mdbdata && \
chown 1001 /dbdata/mdbdata-config
containers:
# must be first container
- name: percona-server-mongodb-operator
image: beclab/percona-server-mongodb-operator:1.14.2
imagePullPolicy: IfNotPresent
ports:
- containerPort: 60000
protocol: TCP
name: metrics
command:
- percona-server-mongodb-operator
env:
- name: LOG_STRUCTURED
value: 'false'
- name: LOG_LEVEL
value: INFO
- name: WATCH_NAMESPACE
value: ''
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: percona-server-mongodb-operator
- name: RESYNC_PERIOD
value: 5s
- name: LOG_VERBOSE
value: "false"
- name: DISABLE_TELEMETRY
value: "false"
- name: operator-api
image: beclab/middleware-operator:0.2.15
image: beclab/middleware-operator:0.2.16
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9080