Skip to content

Commit

Permalink
Update kubeconfig file path in pkg/k8s.go and fix formatting in READM…
Browse files Browse the repository at this point in the history
…E.md and azure-pipelines.yml
  • Loading branch information
wangzhigang1999 committed Mar 31, 2024
1 parent cb21534 commit 32b28e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ It's recommended to build this project from source code. The code is extremely s

If you run it in **k8s**, you need to **link a service account** to the pod in order to read the logs of other pods.

If you run it **locally**, you need to **specify the kubeconfig file path** in `pkg/k8s.go`.
If you run it **locally**, you need to **specify the kubeconfig file path** in `pkg/k8s.go`.

In `pkg/model.go`, you can config the namespace **white list** for safety. It's a regular expression list. By default, it's `".*"`, which
means **all namespaces are allowed.**
Expand Down Expand Up @@ -48,20 +48,20 @@ limit set in the server, default is 100.
> example client code
```typescript
const socket = new WebSocket("localhost:8080"); // 创建一个 Socket 实例
const socket = new WebSocket("localhost:8080"); // 创建一个 Socket 实例
let data: any = {
"mode": "pod",
"namespace":"default",
"workload":"nginx-7db9fccd9f-4q9q2",
"tailLines":100
}
mode: "pod",
namespace: "default",
workload: "nginx-7db9fccd9f-4q9q2",
tailLines: 100,
};

socket.onopen = function () {
socket.send(JSON.stringify(data)); // 发送数据
}
};

//
//
socket.onmessage = function (msg) {
console.log(msg)
}
```
console.log(msg);
};
```
15 changes: 5 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resources:
pool: "Azure Pipelines"

variables:
image-repo: 'bupt2018/log-transfer'
image-repo: "bupt2018/log-transfer"

stages:
- stage: BuildAndPush
Expand All @@ -29,13 +29,8 @@ stages:

- task: Docker@2
inputs:
containerRegistry: 'ACR'
containerRegistry: "ACR"
repository: "$(image-repo)"
command: 'buildAndPush'
tags: '$(Build.BuildNumber)-$(SHORT_COMMIT)'
Dockerfile: '**/Dockerfile'

# - script: |
# curl --location --request PUT --X PUT 'http://cd.bupt.site:30303/api/v1/deployments' --header 'Content-Type: application/json' --header 'key: kAmAbNuzrilmUjcrjsZtOoMcenqoKdQpVeOHVEvpGCBoqxoEQcHOgFIHLzEHJAUU' --header 'value: token-wanz-ws-log-transfer-container-0-3e1f9cc2' --data '{ "namespace":"wanz","deployment":"ws-log-transfer","container": "container-0","image": "registry.cn-beijing.aliyuncs.com/$(image-repo):$(Build.BuildNumber)-$(SHORT_COMMIT)"}'
# displayName: 'send curl'

command: "buildAndPush"
tags: "$(Build.BuildNumber)-$(SHORT_COMMIT)"
Dockerfile: "**/Dockerfile"

0 comments on commit 32b28e1

Please sign in to comment.