Injecting proxy documentation
Precondition
已经安装了cert-manager
Install skywalking-swck-operator
# Use download configuration (need to unpack first)(./skywalking-swck) (recommended)
kubectl apply-f skywalking-swck-<SWCK_VERSION>-bin/config/operator-bundle.yaml
kubectl apply -f skywalking-swck/skywalking-swck-0.9-0.0-bin/config/operator-bundle. aml
# This method below seems to have problems
kubectl apply-k "github.com/apache/skywalking-swck/operator/config/default"
# or
kubtl apply -k "github.com/apache/skywalking-swck/operator/config/default?ref=v0.8.0"
gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
Can be replaced with kubesphere/kube-rbac-proxy:v0.8.0
docker pull kubesphere/kube-rbac-proxy:v0.8.0
docker tag kubesphe/kube-rbac-proxy:v0.8.0 gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
# or modify deployment configuration file to change the pulsed image
Install Custom Metrics Adchapter
参考文档 In skywalking-swck, Customs Metrics Adchapter is an optional component to extend SkyWalking control.It allows you to collect and display custom monitoring indicators using the Customers Metrics API in Kubernetes.
kubectl apply -k "github.com/apache/skywalking-swck/adapter/config"
# or
kubectl apply -k "github.com/apache/skywalking-swk/adapter/config?ref=v0.8.0"
Install Injection Proxy
# 启动测试demo应用
kubectl apply -f demo1.yaml
# Label the namespace with swck-injection=enabled
kubectl label namespace skywalking swck-injection=enabled
kubectl -n skywalking patch deployment demo1 --patch '{
"spec": {
"template": {
"metadata": {
"labels": {
"swck-java-agent-injected": "true"
}
}
}
}
}'
# 查看被打标的pods
kubectl get pod -l swck-java-agent-injected=true
# 查看javaagent
kubectl get javaagent
# 查看javaagent详情
kubectl get javaagent app-demo1-javaagent -o yaml
# Use SwAgent CR to setup override default configuration
kubectl -n skywalking apply -f swagent.yaml
# 查看
kubectl -n skywalking get SwAgent
# 查看并重启
# verify pods to be delete
kubectl -n skywalking get pods -l app=demo1
# delete pods
kubectl -n skywalking delete pods -l app=demo1
# 到skywalking上应该就能看到这个服务了