Skip to main content

2 posts tagged with "DaoCloud"

View All Tags

使用之前的话

Skoala 的微服务治理和微服务是强依赖的 Ghippo、Insight 和 Kpanda 作为基石;同时 Skoala 也支持了 Mesh 服务治理能力,所以也需要 Mspider。 为了保证良好的使用体验,以及减少不可预知的部署问题,请确认以上组件均可正常工作。

检测方式一

访问 UI 界面环境,可以在左侧导航栏能够正确看到所有模块,并且可以正常使用。 CleanShot 2022-09-07 at 18.07.42@2x.jpg

检测方式二

通过终端查看集群内的 apiserver 是否正常,检查服务 Pod 是否正常运行

# 检测 ghippo
~ kubectl -n ghippo-system get pods | egrep "apiserver|ui"
ghippo-apiserver-589c4ddcf6-cmct7 3/3 Running 0 17h
ghippo-apiserver-589c4ddcf6-sts8t 3/3 Running 0 17h
ghippo-ui-7ddddc548c-nsbkj 2/2 Running 0 94m


# 检查 kpanda
~ kubectl -n kpanda-system get pods | egrep "apiserver|ui"
kpanda-apiserver-695b76f476-kdb8l 2/2 Running 0 5m56s
kpanda-apiserver-695b76f476-mvllg 2/2 Running 0 7m51s
kpanda-clusterpedia-apiserver-574d49c4c-hptm7 2/2 Running 0 74m
kpanda-clusterpedia-apiserver-574d49c4c-mjm84 2/2 Running 0 74m
kpanda-ui-5f9586d49b-f4mn2 2/2 Running 0 66m
kpanda-ui-5f9586d49b-qpgwd 2/2 Running 0 66m


# 检查 Insight
~ kubectl -n insight-system get pods | egrep "server|ui"
insight-server-5bbc96bb94-n2wc7 1/1 Running 0 174m
insight-ui-66b6795c44-zm6qj 1/1 Running 0 3h38m


# 检查 mspider
~ kubectl -n mspider-system get pods | egrep "api|ui"
mspider-api-service-7d96c6798-mljst 2/2 Running 0 3h20m
mspider-ui-6f5d58cdc6-59hbn 2/2 Running 0 170m
mspider-work-api-684b75dccb-4659g 2/2 Running 0 3h20m

配置 skoala helm repo

配置好 skoala 仓库,即可查看和获取到 skoala 的应用 chart

helm repo add skoala-release https://release.daocloud.io/chartrepo/skoala
helm repo update

需要实现安装 Helm

安装依赖 mysql

在安装 skoala 的组件时,hive 和 sesame 需要用到 mysql 组件,所以这里需要预先安装一下 mysql,执行下方 yaml。

# 使用如下命令
kubectl -n skoala-system apply -f skoala-mysql.yml
# 保存到 skoala-mysql.yml 文件

~ cat skoala-mysql.yml
apiVersion: v1
kind: Service
metadata:
name: skoala-mysql
namespace: skoala-system
spec:
ports:
- port: 3306
selector:
app: mysql
clusterIP: None
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: skoala-mysql
namespace: skoala-system
spec:
selector:
matchLabels:
app: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: mysql
spec:
containers:
- image: release.daocloud.io/skoala/mysql:5.7.32
name: mysql
env:
# Use secret in real usage
- name: MYSQL_ROOT_PASSWORD
value: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-pv-claim
  • 注意修改以上,mysql 的密码。

初始化 mysql

登录到 pod 内,并成功登录到 mysql 内

kubectl -n skoala-system exec pods/`kubectl -n skoala-system get pods | grep skoala-mysql | awk '{print $1}'` -it bash

CleanShot 2022-09-07 at 18.54.47@2x.jpg

初始化数据库表

注意把对应的版本,建议使用最新的版本,这里建议 v0.6.1

helm upgrade --install skoala --create-namespace -n skoala-system --cleanup-on-fail \
--set image.tag=v0.6.1 \
skoala/skoala-agent \
--version 0.6.1

这里会将资源部署到 skoala-system 命名空间内,可以通过查看该命名空间内的资源来查看是否部署成功。

~ kubectl -n skoala-system get pods
NAME READY STATUS RESTARTS AGE
hive-96b58785c-shhnh 0/1 Running 0 23h
sesame-cdd894f74-l55hw 0/1 Running 0 23h
ui-7df9754f85-v2gg5 1/1 Running 0 23h

安装 Skoala

查看 skaola 当前最新版本

helm search repo skoala-release/skoala --versions
NAME CHART VERSION APP VERSION DESCRIPTION
skoala-release/skoala 0.6.1 0.6.1 The helm chart for Skoala
skoala-release/skoala 0.6.0 0.6.0 The helm chart for Skoala
skoala-release/skoala 0.5.1 0.5.1 The helm chart for Skoala

执行部署

这里注意各个组件的版本,建议安装如下版本,直接执行命令即可,【在 demo 部署时】

helm upgrade --install skoala --create-namespace -n skoala-system --cleanup-on-fail \
--set ui.image.tag=v0.5.3 \
--set hive.image.tag=v0.6.1 \
--set sesame.image.tag=v0.6.1 \
daocloud-registry/skoala \
--version 0.6.1

查看部署的 pod 是否启动成功

~ kubectl -n skoala-system get pods
NAME READY STATUS RESTARTS AGE
hive-96b58785c-shhnh 1/1 Running 0 25h
sesame-cdd894f74-l55hw 1/1 Running 0 25h
skoala-mysql-75dc5cfc7-99tbs 1/1 Running 0 25h
ui-7df9754f85-v2gg5 1/1 Running 0 23h

卸载

helm uninstall skoala -n skoala-system

更多参数的配置

KeyTypeDefaultDescription
global.image.pullPolicystring"IfNotPresent"
global.image.repositorystring"release.daocloud.io"
global.imageCredentials.emailstring""
global.imageCredentials.passwordstring""
global.imageCredentials.usernamestring""
global.imagePullSecretslist[]
global.istioInjection.enablebooltrue
global.namespacestring"skoala-system"
hive.configMap.chart-repos.skoala.namestring"skoala"
hive.configMap.chart-repos.skoala.passwordstring""
hive.configMap.chart-repos.skoala.urlstring"https://release.daocloud.io/chartrepo/skoala"
hive.configMap.chart-repos.skoala.userstring""
hive.configMap.client.ghippo.kubeconfigstring""
hive.configMap.client.ghippo.timeoutint30
hive.configMap.client.insightstring"insight-server.insight-system:80"
hive.configMap.client.kpandastring"kpanda-apiserver.kpanda-system:80"
hive.configMap.client.mspiderstring"mspider-api-service.mspider-system:8081"
hive.configMap.client.mspider_mcpcstring"mspider-work-api.mspider-system:8081"
hive.configMap.data.database.databasestring"hive"
hive.configMap.data.database.driverstring"mysql"
hive.configMap.data.database.hoststring"skoala-mysql"
hive.configMap.data.database.max-connection-lifetimeint20
hive.configMap.data.database.max-idle-connectionsint150
hive.configMap.data.database.max-open-connectionsint150
hive.configMap.data.database.passwordstring"dangerous"
hive.configMap.data.database.portint3306
hive.configMap.data.database.userstring"root"
hive.configMap.data.server.grpc.addrstring"0.0.0.0:9091"
hive.configMap.data.server.grpc.timeoutstring"1s"
hive.configMap.data.server.http.addrstring"0.0.0.0:8081"
hive.configMap.data.server.http.timeoutstring"1s"
hive.enablebooltrue
hive.image.namestring"skoala/hive"
hive.image.pullPolicystring"IfNotPresent"
hive.image.tagstring"v0.6.0"
hive.nameOverridestring"hive"
hive.replicaCountint1
hive.resourcesobject{}
hive.service.grpc.nodePortint30091
hive.service.grpc.portint9091
hive.service.http.nodePortint30081
hive.service.http.portint8081
hive.service.typestring"NodePort"
sesame.configMap.chart-repos.skoala.namestring"skoala"
sesame.configMap.chart-repos.skoala.passwordstring""
sesame.configMap.chart-repos.skoala.urlstring"https://release.daocloud.io/chartrepo/skoala"
sesame.configMap.chart-repos.skoala.userstring""
sesame.configMap.client.ghippo.kubeconfigstring""
sesame.configMap.client.ghippo.timeoutint30
sesame.configMap.client.insightstring"insight-server.insight-system:80"
sesame.configMap.client.kpandastring"kpanda-apiserver.kpanda-system:80"
sesame.configMap.data.server.grpc.addrstring"0.0.0.0:9092"
sesame.configMap.data.server.grpc.timeoutstring"1s"
sesame.configMap.data.server.http.addrstring"0.0.0.0:8082"
sesame.configMap.data.server.http.timeoutstring"1s"
sesame.configMap.log.developmentbooltrue
sesame.configMap.log.disable-colorboolfalse
sesame.configMap.log.disable-stacktraceboolfalse
sesame.configMap.log.enable-callerbooltrue
sesame.configMap.log.error-output-pathsstring"dist/log/skoala-sesame.error.log"
sesame.configMap.log.formatstring"console"
sesame.configMap.log.levelstring"debug"
sesame.configMap.log.namestring"skoala-sesame"
sesame.configMap.log.output-pathsstring"dist/log/skoala-sesame.log,stdout"
sesame.enablebooltrue
sesame.image.namestring"skoala/sesame"
sesame.image.pullPolicystring"IfNotPresent"
sesame.image.tagstring"v0.6.0"
sesame.nameOverridestring"sesame"
sesame.replicaCountint1
sesame.resourcesobject{}
sesame.service.grpc.nodePortint30092
sesame.service.grpc.portint9092
sesame.service.http.nodePortint30082
sesame.service.http.portint8082
sesame.service.typestring"NodePort"
ui.enablebooltrue
ui.image.namestring"skoala/skoala-ui"
ui.image.pullPolicystring"IfNotPresent"
ui.image.tagstring"v0.4.0"
ui.nameOverridestring"ui"
ui.replicaCountint1
ui.resourcesobject{}
ui.service.nodePortint30090
ui.service.portint80
ui.service.typestring"NodePort"
createbooltrue
ui.serviceAccount.namestring""
ui.tolerationslist[]

安装 skoala-agent

安装步骤说明

查看当前最新版本

~ helm search repo skoala-release/skoala-agent --versions
NAME CHART VERSION APP VERSION DESCRIPTION
skoala/skoala-agent 0.6.1 0.6.1 A Helm chart for Skoala Agent
skoala/skoala-agent 0.6.0 0.6.0 A Helm chart for Kubernetes
skoala/skoala-agent 0.5.1 0.5.1 A Helm chart for Kubernetes
skoala/skoala-agent 0.5.0 0.5.0 A Helm chart for Kubernetes

部署

helm upgrade --install skoala-agent --create-namespace -n skoala-agent --cleanup-on-fail \
--set image.tag=v0.6.1 \
skoala/skoala-agent \
--version 0.6.1

查看部署的 pod 是否启动成功

~ kubectl -n skoala-agent get pods
NAME READY STATUS RESTARTS AGE
skoala-agent-679c6d64b4-tb7k4 1/1 Running 0 26h

卸载命令

helm uninstall skoala-agent -n skoala-agent

更多参数设置

KeyTypeDefaultDescription
affinityobject{}
autoscaling.enabledboolfalse
autoscaling.maxReplicasint100
autoscaling.minReplicasint1
autoscaling.targetCPUUtilizationPercentageint80
fullnameOverridestring""
image.pullPolicystring"IfNotPresent"
image.repositorystring"release-ci.daocloud.io/skoala/skoala-agent"
image.tagstring"v0.6.0"
imagePullSecretslist[]
ingress.annotationsobject{}
ingress.classNamestring""
ingress.enabledboolfalse
ingress.hosts[0].hoststring"chart-example.local"
ingress.hosts[0].paths[0].pathstring"/"
ingress.hosts[0].paths[0].pathTypestring"ImplementationSpecific"
ingress.tlslist[]
istioInjection.enablebooltrue
nameOverridestring""
nodeSelectorobject{}
podAnnotationsobject{}
podSecurityContextobject{}
replicaCountint1
resourcesobject{}
securityContextobject{}
service.portint443
service.typestring"NodePort"
serviceAccount.annotationsobject{}
serviceAccount.createboolfalse
serviceAccount.namestring""
tolerationslist[]