data-migration

by Helm

Helm chartv0.22.4App 0.22.4

data-migration for Choerodon

About this chart

Choerodon Base Service

Choerodon Base Service 提供一些基础功能 ,主要包括角色管理、菜单管理、用户管理、租户管理、权限刷新和单据权限管理。

Introduction

Add Helm chart repository

helm repo add choerodon https://openchart.choerodon.com.cn/choerodon/c7n
helm repo update

Installing the Chart

$ helm install c7n/hzero-monitor --name hzero-monitor

Specify each parameter using the --set key=value[,key=value] argument to helm install.

Uninstalling the Chart

$ helm delete hzero-monitor

Configuration

ParameterDescriptionDefault
replicaCountpod运行数量1
image.repository镜像库地址registry.choerodon.com.cn/choerodon/hzero-monitor
image.pullPolicy镜像拉取策略IfNotPresent
preJob.timeoutjob超时时间300
preJob.imagejob镜像库地址registry.cn-hangzhou.aliyuncs.com/choerodon-tools/dbtool:0.6.4
preJob.preConfig.enabled是否初始manager_service数据库true
preJob.preConfig.configFile初始化到配置中心文件名application.yml
preJob.preConfig.configType初始化到配置中心存储方式k8s
preJob.preConfig.updatePolicy初始化配置策略: not/add/override/updateadd
preJob.preConfig.registerHost注册中心地址http://register-server:8000
preJob.preConfig.datasource.urlmanager_service数据库连接地址jdbc:mysql://localhost:3306/manager_service?useUnicode=true&characterEncoding=utf-8&useSSL=false&useInformationSchema=true&remarks=true
preJob.preConfig.datasource.usernamemanager_service数据库用户名choerodon
preJob.preConfig.datasource.passwordmanager_service数据库密码password
preJob.preInitDB.enabled是否初始base_service数据库true
preJob.preInitDB.datasource.urlbase_service数据库连接地址jdbc:mysql://localhost:3306/base_service?useUnicode=true&characterEncoding=utf-8&useSSL=false&useInformationSchema=true&remarks=true
preJob.preInitDB.datasource.usernamebase_service数据库用户名choerodon
preJob.preInitDB.datasource.passwordbase_service数据库密码password
preJob.preInitDB.datasource.exclusion初始化数据库更新数据的时候忽略的表或列iam_user.hash_password,oauth_client.web_server_redirect_uri,oauth_ldap.server_address,oauth_ldap.object_class,iam_role.is_enabled,fd_organization.name
metrics.path收集应用的指标数据路径/actuator/prometheus
metrics.group性能指标应用分组spring-boot
logs.parser日志收集格式spring-boot
deployment.managementPort服务管理端口8031
ingress.enabled是否创建k8s ingressfalse
env.open.SPRING_CLOUD_CONFIG_ENABLED是否启用配置中心true
env.open.SPRING_CLOUD_CONFIG_URI配置中心地址http://register-server:8000
env.open.SPRING_DATASOURCE_URL数据库连接地址jdbc:mysql://localhost/base_service?useUnicode=true&characterEncoding=utf-8&useSSL=false&useInformationSchema=true&remarks=true
env.open.SPRING_DATASOURCE_USERNAME数据库用户名choerodon
env.open.SPRING_DATASOURCE_PASSWORD数据库密码password
env.open.SPRING_REDIS_HOSTredis主机地址localhost
env.open.SPRING_REDIS_PORTredis端口6379
env.open.SPRING_REDIS_DATABASEredis db1
env.open.CHOERODON_RESOURCE_JWT_IGNORE忽略jwt的url/favicon.ico
env.open.EUREKA_CLIENT_SERVICEURL_DEFAULTZONE注册服务地址http://register-server.io-choerodon:8000/eureka/
env.open.CHOERODON_CLEANPERMISSION清理permission表中的旧接口和role_permission表中角色和权限层级不匹配的脏数据false
env.open.CHOERODON_GATEWAY_URL网关地址http://api.staging.saas.hand-china.com
service.enabled是否创建k8s servicefalse
service.typeservice类型ClusterIP
service.portservice端口8030
service.nameservice名称hzero-monitor
resources.limitsk8s中容器能使用资源的资源最大值3Gi
resources.requestsk8s中容器使用的最小资源需求2Gi

SkyWalking Configuration

ParameterDescription
javaagentSkyWalking 代理jar包(添加则开启 SkyWalking,删除则关闭)
skywalking.agent.application_codeSkyWalking 应用名称
skywalking.agent.sample_n_per_3_secsSkyWalking 采样率配置
skywalking.agent.namespaceSkyWalking 跨进程链路中的header配置
skywalking.agent.authenticationSkyWalking 认证token配置
skywalking.agent.span_limit_per_segmentSkyWalking 每segment中的最大span数配置
skywalking.agent.ignore_suffixSkyWalking 需要忽略的调用配置
skywalking.agent.is_open_debugging_classSkyWalking 是否保存增强后的字节码文件
skywalking.collector.backend_serviceSkyWalking OAP 服务地址和端口配置
$ helm install c7n/hzero-monitor \
    --set env.open.SKYWALKING_OPTS="-javaagent:/agent/skywalking-agent.jar -Dskywalking.agent.application_code=hzero-monitor  -Dskywalking.agent.sample_n_per_3_secs=-1 -Dskywalking.collector.backend_service=oap.skywalking:11800" \
    --name hzero-monitor

验证部署

curl -s $(kubectl get po -n c7n-system -l choerodon.io/release=hzero-monitor -o jsonpath="{.items[0].status.podIP}"):8031/actuator/health | jq -r .status

出现以下类似信息即为成功部署

UP

Deploy data-migration with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has data-migration on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartdata-migration is pinned at v0.22.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply