在k8s上部署分布式追踪系统skywalking遇到的大坑
1 # 先克隆源码 2 3 git clone https://github.com/apache/skywalking-kubernetes 4 cd skywalking-kubernetes/chart 5 6 # 增加 elasticsearch的helm chart库 7 helm repo add elastic https://helm.elastic.co 8 9 # 更新 skywalking的helm依赖 10 helm dep up skywalking 11 export SKYWALKING_RELEASE_NAME=skywalking # change the release name according to your scenario 12 export SKYWALKING_RELEASE_NAMESPACE=skywalking # change the namespace according to your scenario
# 这里我们采用helm的upgrade的方式安装
1 helm upgrade --install "${SKYWALKING_RELEASE_NAME}" skywalking -n "${SKYWALKING_RELEASE_NAMESPACE}" --create-namespace --set oap.image.tag=6.5.0 --set oap.storageType=elasticsearch --set ui.image.tag=6.5.0
等待五分钟后,查询一下执行情况;
[root@k8s-master chart]# kubectl get all --namespace skywalking NAME READY STATUS RESTARTS AGE pod/elasticsearch-master-0 1/1 Running 0 68m pod/elasticsearch-master-1 1/1 Running 0 68m pod/elasticsearch-master-2 1/1 Running 0 68m pod/skywalking-es-init-9hwk8 0/1 Completed 0 68m pod/skywalking-oap-5fd7d46764-rzw7p 1/1 Running 2 68m pod/skywalking-oap-5fd7d46764-v8mmh 1/1 Running 1 68m pod/skywalking-ui-c5bbb47c9-v66bm 1/1 Running 0 68m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/elasticsearch-master ClusterIP 10.106.55.143 <none> 9200/TCP,9300/TCP 68m service/elasticsearch-master-headless ClusterIP None <none> 9200/TCP,9300/TCP 68m service/skywalking-oap ClusterIP 10.107.159.182 <none> 12800/TCP,11800/TCP 68m service/skywalking-ui ClusterIP 10.100.16.45 <none> 80/TCP 68m NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/skywalking-oap 2/2 2 2 68m deployment.apps/skywalking-ui 1/1 1 1 68m NAME DESIRED CURRENT READY AGE replicaset.apps/skywalking-oap-5fd7d46764 2 2 2 68m replicaset.apps/skywalking-ui-c5bbb47c9 1 1 1 68m NAME READY AGE statefulset.apps/elasticsearch-master 3/3 68m NAME COMPLETIONS DURATION AGE job.batch/skywalking-es-init 1/1 6m48s 68m
我们想通过ingress访问它,[大家如果不知道—set的key valuse,可以通过查询valuses.yaml文件来了解]
于是我们继续执行helm upgrade
helm upgrade --install "${SKYWALKING_RELEASE_NAME}" skywalking -n "${SKYWALKING_RELEASE_NAMESPACE}" --create-namespace --set oap.image.tag=6.5.0 --set oap.storageType=elasticsearch --set ui.image.tag=6.5.0 --set ui.ingress.enabled=true --set ui.ingress.hosts[0]=skywalking.y.com
结果报了一个错误:
[root@k8s-master chart]helm upgrade --install "${SKYWALKING_RELEASE_NAME}" skywalking -n "${SKYWALKING_RELEASE_NAMESPACE}" --create-namespace --set oap.image.tag=6.5.0 --set oap.storageType=elasticsearch --set ui.image.tag=6.5.0 --set ui.ingress.hosts[0]="skywalkin g.y.com" --set ui.ingress.enabled="true"I0620 06:08:44.581141 850406 request.go:668] Waited for 1.16473581s due to client-side throttling, not priority and fairness, request: GET:https://192.168.108.33:6443/apis/kubeapps.com/v1alpha1?timeout=32s Error: UPGRADE FAILED: template: skywalking/templates/ui-ingress.yaml:48:34: executing "skywalking/templates/ui-ingress.yaml" at <.Capabilities.APIVersions.Has>: can't evaluate field Capabilities in type interface {}
vim skywalking/templates/ui-ingress.yaml 打开一看,这个模板文件是做了ingress的版本兼容,我们删除版本兼容的,只保留v1版本的,大家可以根据实际情况修改,如下图,只保留白色框里的红色文本就可以了
修改后
大功告成,看效果