Skip to content

Commit

Permalink
Update deployment files needed for releasing (#215)
Browse files Browse the repository at this point in the history
* Update deploy files

Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>

* Add README and update files

Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>

* Rename dir grafana to grafana-with-plugins

Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>

* Rename "deploy" inside the direcotry to "docker"

Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>

* update deploy/README

Signed-off-by: Daxin Wang <daxinwang@harmonycloud.cn>
  • Loading branch information
dxsup authored May 12, 2022
1 parent 96f9adf commit 55d65e8
Show file tree
Hide file tree
Showing 26 changed files with 121 additions and 38 deletions.
4 changes: 2 additions & 2 deletions collector/deploy/Dockerfile → collector/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM centos:7

COPY deploy/libso/libzmq.so.5 /lib64/
COPY libso/libzmq.so.5 /lib64/
RUN ldconfig

COPY deploy/*.yml /etc/kindling/config/
COPY kindling-collector-config.yml /etc/kindling/config/
COPY kindling-collector /usr/bin/kindling-collector

CMD ["/usr/bin/kindling-collector", "--config=/etc/kindling/config/kindling-collector-config.yml"]
File renamed without changes.
11 changes: 11 additions & 0 deletions deploy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Deployment files for Kubernetes
The files under this directory are needed when releasing the Kindling.

## agent
This directory contains files used for deploying `kindling-agent` in Kubernetes.

## grafana-with-plugins
This directory contains files used for deploying `Grafana` in Kubernetes.

## recompile-probe
The files under this directory provide a convenient way to build a new `kindling-probe` image with `drivers` **built locally**. The script compiles the driver codes and produces `drivers` based on the specific kernel version, and rebuilds a container image base on the `drivers` and the latest `kindling-probe` image.
4 changes: 2 additions & 2 deletions deploy/install.sh → deploy/agent/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ kubectl create ns kindling

kubectl create serviceaccount kindling-agent -nkindling
kubectl apply -f kindling-clusterrole.yml
kubectl create clusterrolebinding kindling-agent --clusterrole=kindling-agent --serviceaccount=kindling:kindling-agent
kubectl apply -f kindling-clusterrolebinding.yml
kubectl create cm kindlingcfg -n kindling --from-file=kindling-collector-config.yml
kubectl apply -f kindling-deploy.yml

# configure Prometheus
kubectl apply -f kindling-prometheus-rabc.yml
kubectl apply -f kindling-prometheus-service.yml
kubectl apply -f kindling-prometheus-servicemonitor.yml

sleep 5
kubectl get pods -n kindling
File renamed without changes.
18 changes: 18 additions & 0 deletions deploy/agent/kindling-clusterrolebinding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
managedFields:
- apiVersion: rbac.authorization.k8s.io/v1
fieldsType: FieldsV1
name: kindling-agent
resourceVersion: "15122093"
selfLink: /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/kindling-agent
uid: 8761e9af-aab2-49d2-be7e-ca4aae974508
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kindling-agent
subjects:
- kind: ServiceAccount
name: kindling-agent
namespace: kindling
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ analyzers:
networkanalyzer:
connect_timeout: 100
# How many seconds to wait until we consider a request as no response.
request_timeout: 1
request_timeout: 60
# How many milliseconds to wait until we consider a request-response as slow.
response_slow_threshold: 500
# Whether enable conntrack module to find pod's ip when calling service
Expand Down
13 changes: 0 additions & 13 deletions deploy/kindling-deploy.yml → deploy/agent/kindling-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@ spec:
command:
- sh
- /pl/post_start.sh
args:
- --v=1
- --minloglevel=0
- --log_dir=/pl
- --logtostderr=false
- --stirling_enable_kafka_tracing=false
- --stirling_enable_nats_tracing=false
- --stirling_enable_redis_tracing=false
- --stirling_enable_dns_tracing=false
- --stirling_enable_cass_tracing=false
- --stirling_enable_http_tracing=false
- --stirling_enable_pgsql_tracing=false
- --stirling_enable_mysql_tracing=false
command:
- /pl/docker-entrypoint.sh
resources:
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions deploy/agent/uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kubectl delete -f kindling-prometheus-servicemonitor.yml
kubectl delete -f kindling-prometheus-service.yml
kubectl delete -f kindling-prometheus-rabc.yml

kubectl delete -f kindling-deploy.yml
kubectl delete cm kindlingcfg -n kindling
kubectl delete -f kindling-clusterrolebinding.yml
kubectl delete -f kindling-clusterrole.yml
kubectl delete serviceaccount kindling-agent -nkindling
1 change: 1 addition & 0 deletions deploy/grafana-with-plugins/kindling-grafana-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kubectl create -f https://k8s-bpf-probes-public.oss-cn-hangzhou.aliyuncs.com/kindling-grafana.yaml -n kindling
59 changes: 59 additions & 0 deletions deploy/grafana-with-plugins/kindling-grafana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: grafana
name: grafana
spec:
selector:
matchLabels:
app: grafana
template:
metadata:
labels:
app: grafana
spec:
containers:
- name: grafana
image: kindlingproject/kindling-grafana:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
name: http-grafana
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /robots.txt
port: 3000
scheme: HTTP
initialDelaySeconds: 120
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 2
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 120
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 3000
timeoutSeconds: 1
resources:
requests:
cpu: 250m
memory: 750Mi
---
apiVersion: v1
kind: Service
metadata:
name: grafana
spec:
ports:
- port: 3000
protocol: TCP
targetPort: http-grafana
selector:
app: grafana
type: LoadBalancer
2 changes: 2 additions & 0 deletions deploy/recompile-probe/recompile-module-Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM kindlingproject/kindling-probe:latest
COPY ./agent-libs-2b4b2a107c05bd16a03c12841c6cce1d6404efac/kindling-falcolib-probe/* /opt/kindling-extra-probe/
12 changes: 12 additions & 0 deletions deploy/recompile-probe/recompile-module.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mkdir rebuild-kindling-agent
cd rebuild-kindling-agent
curl -O https://k8s-bpf-probes-public.oss-cn-hangzhou.aliyuncs.com/2b4b2a107c05bd16a03c12841c6cce1d6404efac.tar.gz
tar -zvxf 2b4b2a107c05bd16a03c12841c6cce1d6404efac.tar.gz
cd agent-libs-2b4b2a107c05bd16a03c12841c6cce1d6404efac
docker pull kindlingproject/kernel-builder:latest
docker run -it -v /usr:/host/usr -v /lib/modules:/host/lib/modules -v $PWD:/source kindlingproject/kernel-builder:latest
cd ..
curl -O https://k8s-bpf-probes-public.oss-cn-hangzhou.aliyuncs.com/recompile-module-Dockerfile
mv -f recompile-module-Dockerfile Dockerfile
docker build -t kindlingproject/kindling-probe:latest-bymyself .

16 changes: 0 additions & 16 deletions deploy/start.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions probe/src/probe/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ container_image(
directory = "/pl",
files = [
"@kindling_falcolib_probe_tar_gz//file:file",
"//deploy:scripts",
"//docker:scripts",
":kindling_probe",
],
cmd = ["/pl/docker-entrypoint.sh"],
Expand All @@ -60,8 +60,8 @@ container_image(
base = "@px//:pl_cc_bpf_image",
directory = "/pl",
files = [
"//deploy:scripts",
"//deploy:localdriver",
"//docker:scripts",
"//docker:localdriver",
":kindling_probe",
],
cmd = ["/pl/docker-entrypoint.sh"],
Expand Down
2 changes: 1 addition & 1 deletion probe/src/probe/standalone/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ container_image(
directory = "/pl",
files = [
"@kindling_falcolib_probe_tar_gz//file:file",
"//deploy:scripts",
"//docker:scripts",
":qianlu",
],
cmd = ["/pl/docker-entrypoint.sh"],
Expand Down

0 comments on commit 55d65e8

Please sign in to comment.