Skip to content

Commit

Permalink
feat: support k8s installation (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Feb 13, 2023
1 parent 83429f5 commit bb5d4fe
Show file tree
Hide file tree
Showing 30 changed files with 10,776 additions and 40 deletions.
73 changes: 39 additions & 34 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Juno Nightly Build
name: Juno Latest Build

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -55,38 +55,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Ignore the error when we delete the nightly release, it might not exist.
- name: Delete the nightly Release
continue-on-error: true
run: |
gh release delete nightly --repo $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository_owner }}/${{ github.event.repository.name }}

# Ignore the error when we delete the nightly tag, it might not exist.
- name: Delete the nightly Tag
continue-on-error: true
run:
gh api --method DELETE /repos/$GITHUB_REPOSITORY/git/refs/tags/nightly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository_owner }}/${{ github.event.repository.name }}

- name: Recreate the nightly Release and Tag
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: true
tag_name: nightly
files: |
./dist/juno_0.0.0-SNAPSHOT-*
body: |
This is the "nightly" release of **Juno**, which contains the most recent commits from the main branch.
This release **might not be stable**.
It is only intended for developers wishing to try out the nightly features in Juno, some of which may not be fully implemented.
- name: image_name
run: echo ${{ env.IMAGE_NAME }}
- name: Extract metadata (tags, labels) for Docker
Expand All @@ -107,8 +75,45 @@ jobs:
image: ${{ env.IMAGE_NAME }}
buildArgs: "JUNO_TAR=${{ steps.vars.outputs.file_name }}"
addLatest: false
tags: nightly
tags: latest
directory: dist
dockerfile: ./cmd/juno-admin/Dockerfile
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate install.yml
run: |
make gen-dev-deployment
# Ignore the error when we delete the latest release, it might not exist.
- name: Delete the latest Release
continue-on-error: true
run: |
gh release delete latest --repo $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository_owner }}/${{ github.event.repository.name }}

# Ignore the error when we delete the latest tag, it might not exist.
- name: Delete the latest Tag
continue-on-error: true
run:
gh api --method DELETE /repos/$GITHUB_REPOSITORY/git/refs/tags/latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository_owner }}/${{ github.event.repository.name }}

- name: Recreate the latest Release and Tag
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: true
tag_name: latest
files: |
./dist/juno_0.0.0-SNAPSHOT-*
./deployment/install.yml
body: |
This is the "latest" release of **Juno**, which contains the most recent commits from the main branch.
This release **might not be stable**.
It is only intended for developers wishing to try out the latest features in Juno, some of which may not be fully implemented.
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Generate install.yml
run: |
make gen-deployment
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: deployment/install.yml
asset_name: install.yml
tag: ${{ github.ref }}

- name: image_name
run: echo ${{ env.IMAGE_NAME }}
- name: Extract metadata (tags, labels) for Docker
Expand Down
4 changes: 0 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ builds:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch: [amd64]
ldflags:
- -X github.com/douyu/jupiter/pkg.buildAppVersion={{.Version}}
Expand All @@ -22,8 +20,6 @@ builds:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch: [amd64]
ldflags:
- -X github.com/douyu/jupiter/pkg.buildAppVersion={{.Version}}
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,9 @@ build_data:

tar:
@cd $(BASE_PATH)/release && tar zcvf juno_$(APP_VERSION).tar.gz $(APP_VERSION)

gen-dev-deployment:
kustomize build deployment/overlays/dev > deployment/install.yml

gen-deployment:
kustomize build deployment/ > deployment/install.yml
4 changes: 2 additions & 2 deletions config/single-region-admin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
secret="12341234123412341234123412341234"

[logger.system]
debug=false # 是否在命令行输出
debug=true # 是否在命令行输出
enableConsole=false # 是否按命令行格式输出
level="debug"
async=false
name="system.json" # 日志名称
dir="./logs"

[logger.biz]
debug=false # 是否在命令行输出
debug=true # 是否在命令行输出
enableConsole=false # 是否按命令行格式输出
level="debug"
async=false
Expand Down
45 changes: 45 additions & 0 deletions deployment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Deployment

## 一键启动

### Docker Compose

```bash
docker-compose -f docker-compose.yml up -d
```

### Kubernetes

```bash
kubectl apply -f install.yml
```

## 访问

访问 [http://localhost:50002](http://localhost:50002)

使用如下账号进行登录 Juno

```txt
username: admin
password: admin
```

## 相关中间件

| 中间件 | 地址 | 备注 |
| ------------------ | ------------------------------------------------ | ----------- |
| etcd | [localhost:2379](localhost:2379) |
| redis | [localhost:6379](localhost:6379) |
| mysql | [localhost:3306](localhost:3306) | root/root |
| mysql-admin | [http://localhost:8080](http://localhost:8080) | |
| clickhouse | [localhost:9000](localhost:9000) |
| grafana | [http://localhost:3000](http://localhost:3000) | admin/admin |
| prometheus | [http://localhost:9090](http://localhost:9090) |
| rocketmq | [localhost:9876](localhost:9876) |
| rocketmq-dashboard | [http://localhost:19876](http://localhost:19876) |
| juno-admin | [http://localhost:50002](http://localhost:50002) | admin/admin |
| juno-agent | [http://localhost:50010](http://localhost:50010) |
| jaeger | [http://localhost:16686](http://localhost:16686) |
| otel-collector | [localhost:4317](localhost:4317) |
| uptrace | [http://localhost:14318](http://localhost:14318) |
10 changes: 10 additions & 0 deletions deployment/data/config/broker/broker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
autoCreateTopicEnable = true
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
#set `brokerIP1` if you want to set physical IP as broker IP.
# brokerIP1=127.0.0.1
Loading

0 comments on commit bb5d4fe

Please sign in to comment.