Skip to content

Commit ff926a2

Browse files
authored
Rework kobs architecture (#346)
Rework kobs architecture, by introducing a "hub" and "satellite" component. This new architecture allows us to run the kobs "hub" component in a central cluster and access clusters / services (plugins) through the kobs "satellite" component. The following tasks are still todo: - We have to update the documentation with the new architecture. - We have to update the plugin documentation. - We have to adjust the demo.
1 parent 9e16b7b commit ff926a2

File tree

1,846 files changed

+67587
-63989
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,846 files changed

+67587
-63989
lines changed

.dockerignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
.github
22
.vscode
3-
app/build
4-
app/node_modules
53
bin
64
deploy
75
docs
86
node_modules
9-
plugins/*/lib
10-
plugins/*/lib-esm
7+
plugins/*/build
118
plugins/*/node_modules
129
CHANGELOG.md
1310
CODE_OF_CONDUCT.md

.github/workflows/codeql.yaml

+17-18
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ on:
1616
- 'docs/**'
1717
- '.dockerignore'
1818
- '.editorconfig'
19-
- '.gitattributes'
2019
- '.gitignore'
2120
- 'CHANGELOG.md'
2221
- 'CODE_OF_CONDUCT.md'
@@ -35,7 +34,6 @@ on:
3534
- 'docs/**'
3635
- '.dockerignore'
3736
- '.editorconfig'
38-
- '.gitattributes'
3937
- '.gitignore'
4038
- 'CHANGELOG.md'
4139
- 'CODE_OF_CONDUCT.md'
@@ -58,40 +56,41 @@ jobs:
5856
strategy:
5957
fail-fast: false
6058
matrix:
61-
language: ['go', 'javascript']
62-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
63-
# Learn more:
64-
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
59+
language: [ 'go', 'javascript' ]
60+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
61+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
6562

6663
steps:
6764
- name: Checkout repository
68-
uses: actions/checkout@v2
65+
uses: actions/checkout@v3
6966

7067
# Initializes the CodeQL tools for scanning.
7168
- name: Initialize CodeQL
72-
uses: github/codeql-action/init@v1
69+
uses: github/codeql-action/init@v2
7370
with:
7471
languages: ${{ matrix.language }}
7572
# If you wish to specify custom queries, you can do so here or in a config file.
7673
# By default, queries listed here will override any specified in a config file.
7774
# Prefix the list here with "+" to use these queries and those in the config file.
78-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
75+
76+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
77+
# queries: security-extended,security-and-quality
78+
7979

8080
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
8181
# If this step fails, then you should remove it and run the build manually (see below)
8282
- name: Autobuild
83-
uses: github/codeql-action/autobuild@v1
83+
uses: github/codeql-action/autobuild@v2
8484

8585
# ℹ️ Command-line programs to run using the OS shell.
86-
# 📚 https://git.io/JvXDl
86+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
8787

88-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
89-
# and modify them (or add more) to build your code if your project
90-
# uses a compiled language
88+
# If the Autobuild fails above, remove it and uncomment the following three lines.
89+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
9190

92-
#- run: |
93-
# make bootstrap
94-
# make release
91+
# - run: |
92+
# echo "Run, Build Application using script"
93+
# ./location_of_script_within_repo/buildscript.sh
9594

9695
- name: Perform CodeQL Analysis
97-
uses: github/codeql-action/analyze@v1
96+
uses: github/codeql-action/analyze@v2

.github/workflows/continuous-delivery.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ jobs:
4646
push: true
4747
context: .
4848
file: ./cmd/kobs/Dockerfile
49-
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
49+
platforms: linux/386,linux/amd64,linux/arm64
5050
tags: kobsio/kobs:${{ steps.tag.outputs.tag }}

.github/workflows/continuous-integration.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ on:
88
- 'cmd/kobs/Dockerfile'
99
- 'deploy/**'
1010
- 'docs/**'
11+
- 'hack/**'
1112
- '.dockerignore'
1213
- '.editorconfig'
13-
- '.gitattributes'
1414
- '.gitignore'
1515
- 'CHANGELOG.md'
1616
- 'CODE_OF_CONDUCT.md'
@@ -32,7 +32,7 @@ jobs:
3232
- name: Setup
3333
uses: actions/setup-go@v2
3434
with:
35-
go-version: 1.17
35+
go-version: 1.18
3636

3737
- name: Cache
3838
uses: actions/cache@v2
@@ -51,7 +51,7 @@ jobs:
5151
- name: Test
5252
run: |
5353
make test-coverage
54-
cat coverage.out | grep -v "github.com/kobsio/kobs/pkg/api/apis" | grep -v "github.com/kobsio/kobs/pkg/api/clients" | grep -v "_mock.go" > coverage_modified.out; mv coverage_modified.out coverage.out
54+
cat coverage.out | grep -v "github.com/kobsio/kobs/pkg/kube/apis" | grep -v "github.com/kobsio/kobs/pkg/kube/clients" | grep -v "_mock.go" > coverage_modified.out; mv coverage_modified.out coverage.out
5555
5656
- name: Upload Coverage to Codecov
5757
uses: codecov/codecov-action@v2
@@ -98,4 +98,4 @@ jobs:
9898
9999
- name: Build
100100
run: |
101-
yarn build
101+
make generate-assets

.github/workflows/docs.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
echo ::set-output name=aliases::${MIKE_ALIASES}
3434
3535
- name: Install Material for MkDocs
36-
run: pip install -Iv mkdocs-material==8.2.9
36+
run: pip install -Iv mkdocs-material==8.3.4
3737

3838
- name: Install PyMdown Extensions
39-
run: pip install -Iv pymdown-extensions==9.1
39+
run: pip install -Iv pymdown-extensions==9.5
4040

4141
- name: Install mike
4242
run: pip install -Iv mike==1.1.2

.github/workflows/helm.yaml

+12-8
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,35 @@ name: Helm
33
on:
44
push:
55
paths:
6-
- 'deploy/helm/kobs/**'
6+
- '.github/workflows/helm.yaml'
7+
- 'deploy/helm/**'
78

89
jobs:
910
helm:
1011
name: Helm Chart
1112
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
chart: [hub, satellite]
1216
steps:
1317
- name: Checkout
1418
uses: actions/checkout@v2
1519

1620
- name: Lint
1721
run: |
18-
helm lint deploy/helm/kobs
22+
helm lint deploy/helm/${{ matrix.chart }}
1923
2024
- name: Template
2125
run: |
22-
helm template kobs -n observability deploy/helm/kobs
26+
helm template kobs-${{ matrix.chart }} -n kobs deploy/helm/${{ matrix.chart }}
2327
2428
- name: Install
2529
run: |
2630
kind create cluster
2731
sleep 60s
28-
kubectl create namespace observability
32+
kubectl create namespace kobs
2933
sleep 10s
30-
helm install --namespace observability kobs deploy/helm/kobs
34+
helm install --namespace kobs kobs${{ matrix.chart }} deploy/helm/${{ matrix.chart }}
3135
3236
- name: Configure SSH
3337
if: ${{ github.ref == 'refs/heads/main' }}
@@ -43,7 +47,7 @@ jobs:
4347
- name: Package Helm Chart
4448
if: ${{ github.ref == 'refs/heads/main' }}
4549
run: |
46-
helm package ./deploy/helm/kobs
50+
helm package ./deploy/helm/${{ matrix.chart }}
4751
4852
- name: Clone Helm Repository
4953
if: ${{ github.ref == 'refs/heads/main' }}
@@ -53,12 +57,12 @@ jobs:
5357
- name: Update Helm Repository
5458
if: ${{ github.ref == 'refs/heads/main' }}
5559
run: |
56-
mv kobs* ./helm-repository/ && helm repo index helm-repository/ --url https://helm.kobs.io/
60+
mv ${{ matrix.chart }}* ./helm-repository/ && helm repo index helm-repository/ --url https://helm.kobs.io/
5761
5862
- name: Commit Changes
5963
if: ${{ github.ref == 'refs/heads/main' }}
6064
run: |
61-
cd helm-repository/ && git add . && git commit -m "Add new release for kobs"
65+
cd helm-repository/ && git add . && git commit -m "Add new release for kobs ${{ matrix.chart }}"
6266
6367
- name: Push Changes
6468
if: ${{ github.ref == 'refs/heads/main' }}

.gitignore

+5-11
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ node_modules
66
# testing
77
/coverage
88
coverage.out
9+
coverage.html
910

10-
# production
11-
/build
11+
# builds
12+
build
1213

1314
# misc
1415
.DS_Store
@@ -24,20 +25,13 @@ npm-debug.log*
2425
yarn-debug.log*
2526
yarn-error.log*
2627

27-
# lib
28-
lib
29-
lib-esm
30-
31-
# build
32-
/app/build
33-
3428
# binaries
3529
/bin
3630

3731
# temporary files
3832
/tmp
3933

40-
# test files
41-
/config.yaml
34+
# test config, manifests and values file
35+
/config*.yaml
4236
/test.yaml
4337
/values.yaml

.vscode/launch.json

+29-10
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,46 @@
22
"version": "0.2.0",
33
"configurations": [
44
{
5-
"name": "Server",
5+
"name": "hub",
66
"type": "go",
77
"request": "launch",
88
"mode": "debug",
99
"program": "${workspaceFolder}/cmd/kobs",
1010
"args": [
11-
"--log.level=trace",
12-
"--config=../../deploy/docker/kobs/config.yaml",
13-
"--app.assets=../../app/build",
14-
"--development"
11+
"--log.level=debug",
12+
"--hub.config=../../deploy/docker/kobs/config.yaml",
13+
"--app.assets=''"
1514
]
1615
},
1716
{
18-
"name": "Chrome",
17+
"name": "satellite",
18+
"type": "go",
19+
"request": "launch",
20+
"mode": "debug",
21+
"program": "${workspaceFolder}/cmd/kobs",
22+
"args": [
23+
"--log.level=debug",
24+
"--satellite.config=../../deploy/docker/kobs/config.yaml",
25+
"--satellite.plugins=../../bin/plugins",
26+
"--satellite.token=unsecuretoken"
27+
]
28+
},
29+
{
30+
"name": "app",
1931
"type": "chrome",
2032
"request": "launch",
2133
"url": "http://localhost:3000",
22-
"webRoot": "${workspaceFolder}/app/src",
23-
"sourceMapPathOverrides": {
24-
"webpack:///src/*": "${webRoot}/*"
25-
}
34+
"webRoot": "${workspaceFolder}/plugins/app",
35+
"sourceMaps": true
36+
},
37+
{
38+
"name": "plugin",
39+
"type": "chrome",
40+
"request": "launch",
41+
"url": "http://localhost:3001",
42+
"webRoot": "${workspaceFolder}/plugins",
43+
"sourceMaps": true
2644
}
45+
2746
]
2847
}

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ NOTE: As semantic versioning states all 0.y.z releases can contain breaking chan
1414

1515
### Changed
1616

17+
- [#346](https://github.com/kobsio/kobs/pull/346): [app] :warning: _Breaking change:_ :warning: Rework kobs architecture, by introducing a `hub` and a `satellite` component. This new architecture allows us to run the kobs `hub` component in a central cluster and access clusters / services (plugins) through the kobs `satellite` component. More information regarding the new kobs architecture can be found in the documentation at [kobs.io](https://kobs.io).
18+
1719
## [v0.8.0](https://github.com/kobsio/kobs/releases/tag/v0.8.0) (2022-03-24)
1820

1921
### Added

CONTRIBUTING.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ Most of the kobs functions are implemented via plugins, which can be found in th
7878
If you adjust the Custom Resource Definitions for kobs, you must install the Kubernetes [code-generator](https://github.com/kubernetes/code-generator) into your `GOPATH`:
7979

8080
```sh
81-
go get k8s.io/[email protected]
81+
go install k8s.io/code-generator/[email protected]
82+
go install sigs.k8s.io/controller-tools/[email protected]
8283
```
8384

8485
### Components

0 commit comments

Comments
 (0)