Skip to content

Commit f6d3e51

Browse files
underaharshit-mehtaaHarshit Mehtaronahk
authored
Allow installing into cluster (#128)
* Dockerize it * Default chart layout * Installable * Starts and loads * Progressing * Hide cluster block * Add scanners * Add icon for helm chart (#130) Co-authored-by: Harshit Mehta <[email protected]> * Image build and push scripts * Build local img * Local img * ci stuff * ci and chart changes * add readme * modify readme * move readme location * update docs and delete file * remove file * allow write actions * allow write actions * update .gitignore * update readme * delete file * add persistence and update documentation * update logo * update volume paths and documentation * change pvc size * Comment Co-authored-by: Harshit Mehta <[email protected]> Co-authored-by: Harshit Mehta <[email protected]> Co-authored-by: ronahk <[email protected]>
1 parent 9bac730 commit f6d3e51

30 files changed

+829
-50
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Dockerfile
2+
*.md
3+
bin
4+
.idea

.github/workflows/build.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Build
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: main
66
pull_request:
7-
branches: [ "main" ]
7+
branches: main
88

99
jobs:
1010
build:
@@ -40,4 +40,31 @@ jobs:
4040
# skip-go-installation: true
4141
skip-pkg-cache: true
4242
skip-build-cache: true
43-
# args: --timeout=15m
43+
# args: --timeout=15m
44+
45+
image:
46+
runs-on: ubuntu-latest
47+
timeout-minutes: 60
48+
steps:
49+
- name: Check out the repo
50+
uses: actions/checkout@v2
51+
52+
- name: Build and push
53+
uses: docker/build-push-action@v2
54+
with:
55+
context: .
56+
outputs: local
57+
build-args: VER=0.0.0-dev
58+
59+
helm_check:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v2
64+
with:
65+
fetch-depth: 0
66+
- name: Helm Template Check For Sanity
67+
uses: igabaydulin/[email protected]
68+
env:
69+
CHART_LOCATION: ./charts/helm-dashboard
70+
CHART_VALUES: ./charts/helm-dashboard/values.yaml

.github/workflows/publish-chart.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: publish helm chart
2+
3+
# for manual running in case we need to update the chart without releasing the dashboard app
4+
on:
5+
workflow_dispatch:
6+
7+
env:
8+
HELM_REP: helm-charts
9+
GH_OWNER: komodorio
10+
CHART_DIR: charts/helm-dashboard
11+
12+
jobs:
13+
publish_chart:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
- name: Bump versions
21+
run: |
22+
git config user.email [email protected]
23+
git config user.name komodor-bot
24+
git fetch --tags
25+
git checkout main
26+
sh ./ci/bump-versions.sh
27+
git add charts/helm-dashboard/Chart.yaml
28+
git commit -m "Increment chart versions [skip ci]" || echo "Already up-to-date"
29+
git push -f || echo "Nothing to push!"
30+
env:
31+
APP_VERSION: ${{ needs.pre_release.outputs.release_tag }}
32+
- name: Push folder to helm-charts repository
33+
uses: crykn/[email protected]
34+
env:
35+
API_TOKEN_GITHUB: ${{ secrets.KOMI_WORKFLOW_TOKEN }}
36+
with:
37+
source_folder: "charts/helm-dashboard"
38+
destination_repo: "komodorio/helm-charts"
39+
destination_folder: "charts/helm-dashboard"
40+
user_email: "[email protected]"
41+
user_name: "komodor-bot"
42+
destination_branch: "master"
43+
commit_msg: "feat(helm-dashboard): update chart" #important!! don't change this commit message unless you change the condition in pipeline.yml on helm-charts repo

.github/workflows/release.yaml

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ name: release
33
on:
44
push:
55
tags:
6-
- "*"
6+
- "v*"
7+
8+
env:
9+
HELM_REP: helm-charts
10+
GH_OWNER: komodorio
11+
CHART_DIR: charts/helm-dashboard
712

813
jobs:
914
pre_release:
@@ -52,3 +57,68 @@ jobs:
5257
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5358
- name: Test Binary Versions
5459
run: "dist/helm-dashboard_linux_amd64_v1/helm-dashboard --help"
60+
61+
image:
62+
runs-on: ubuntu-latest
63+
needs: release
64+
timeout-minutes: 60
65+
steps:
66+
- name: Check out the repo
67+
uses: actions/checkout@v2
68+
69+
- name: Docker meta
70+
uses: docker/metadata-action@v3
71+
id: meta
72+
with:
73+
images: komodorio/helm-dashboard
74+
75+
- name: Login to DockerHub
76+
uses: docker/login-action@v1
77+
if: github.event_name != 'pull_request'
78+
with:
79+
username: ${{ secrets.DOCKERHUB_USER }}
80+
password: ${{ secrets.DOCKERHUB_PASS }}
81+
82+
- name: Build and push
83+
uses: docker/build-push-action@v2
84+
if: github.event_name != 'pull_request'
85+
with:
86+
context: .
87+
push: ${{ github.event_name != 'pull_request' }}
88+
tags: ${{ needs.pre_release.outputs.release_tag }}
89+
labels: ${{ steps.meta.outputs.labels }}
90+
build-args: VER=${{ needs.pre_release.outputs.release_tag }}
91+
92+
publish_chart:
93+
runs-on: ubuntu-latest
94+
need: image
95+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@v2
99+
with:
100+
fetch-depth: 0
101+
- name: Bump versions
102+
run: |
103+
git config user.email [email protected]
104+
git config user.name komodor-bot
105+
git fetch --tags
106+
git checkout main
107+
sh ./ci/bump-versions.sh
108+
git add charts/helm-dashboard/Chart.yaml
109+
git commit -m "Increment chart versions [skip ci]" || echo "Already up-to-date"
110+
git push -f || echo "Nothing to push!"
111+
env:
112+
APP_VERSION: ${{ needs.pre_release.outputs.release_tag }}
113+
- name: Push folder to helm-charts repository
114+
uses: crykn/[email protected]
115+
env:
116+
API_TOKEN_GITHUB: ${{ secrets.KOMI_WORKFLOW_TOKEN }}
117+
with:
118+
source_folder: "charts/helm-dashboard"
119+
destination_repo: "komodorio/helm-charts"
120+
destination_folder: "charts/helm-dashboard"
121+
user_email: "[email protected]"
122+
user_name: "komodor-bot"
123+
destination_branch: "master"
124+
commit_msg: "feat(helm-dashboard): ${{ github.event.head_commit.message }}" #important!! don't change this commit message unless you change the condition in pipeline.yml on helm-charts repo

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ go.work
2424

2525
/bin
2626
/.idea/
27+
28+
.DS_Store
29+
.vscode/

Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Stage - builder
2+
FROM golang as builder
3+
4+
ARG VER
5+
6+
ENV GOOS=linux
7+
ENV GOARCH=amd64
8+
ENV CGO_ENABLED=0
9+
ENV VERSION=0.0.0
10+
11+
WORKDIR /build
12+
13+
COPY go.mod ./
14+
COPY go.sum ./
15+
COPY main.go ./
16+
RUN go mod download
17+
18+
ADD . src
19+
20+
WORKDIR /build/src
21+
22+
RUN make build
23+
24+
# Stage - runner
25+
FROM alpine/helm
26+
27+
RUN curl -o /bin/kubectl -vf -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && chmod +x /bin/kubectl && kubectl --help
28+
29+
# Checkov scanner
30+
RUN apk add --update --no-cache python3
31+
RUN python3 -m ensurepip
32+
RUN pip3 install checkov
33+
34+
# Trivy
35+
RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.18.3
36+
37+
COPY --from=builder /build/src/bin/dashboard /bin/helm-dashboard
38+
39+
ENTRYPOINT ["/bin/helm-dashboard", "--no-browser", "--bind=0.0.0.0"]
40+
41+
# docker build . -t komodorio/helm-dashboard:0.0.0 && kind load docker-image komodorio/helm-dashboard:0.0.0

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A simplified way of working with Helm.
66

77
## What it Does?
88

9-
The _Helm Dashboard_ plugin offers a UI-driven way to view the installed Helm charts, see their revision history and
9+
_Helm Dashboard_ offers a UI-driven way to view the installed Helm charts, see their revision history and
1010
corresponding k8s resources. Also, you can perform simple actions like roll back to a revision or upgrade to newer
1111
version.
1212

@@ -22,9 +22,11 @@ Some of the key capabilities of the tool:
2222
- Integration with popular problem scanners
2323
- Easy switch between multiple clusters
2424

25-
## Installing
25+
## Setup
2626

27-
To install it, simply run Helm command:
27+
### Using Helm plugin manager
28+
29+
To install the plugin, simply run Helm command:
2830

2931
```shell
3032
helm plugin install https://github.com/komodorio/helm-dashboard.git
@@ -42,10 +44,6 @@ To uninstall, run:
4244
helm plugin uninstall dashboard
4345
```
4446

45-
> In case standard Helm plugin way did not work for you, you can just download the appropriate [release package](https://github.com/komodorio/helm-dashboard/releases) for your platform, unpack it and just run `dashboard` binary from it.
46-
47-
## Running
48-
4947
To use the plugin, your machine needs to have working `helm` and also `kubectl` commands. Helm version 3.4.0+ is required.
5048

5149
After installing, start the UI by running:
@@ -62,18 +60,27 @@ You can see the list of available command-line flags by running `helm dashboard
6260
By default, the web server is only available locally. You can change that by specifying `HD_BIND` environment variable
6361
to the desired value. For example, `0.0.0.0` would bind to all IPv4 addresses or `[::0]` would be all IPv6 addresses.
6462
This can also be specified using flag `--bind <host>`, for example `--bind=0.0.0.0` or `--bind 0.0.0.0`.
63+
6564
> Precedence order: flag `--bind=<host>` > env `HD_BIND=<host>` > default value `localhost`
6665
6766
If your port 8080 is busy, you can specify a different port to use via `--port <number>` command-line flag.
6867

69-
If you need to limit the operations to a specific namespace, please use `--namespace=...` in your command-line.
68+
If you need to limit the operations to a specific namespace, please use `--namespace=...` in your command-line.
7069

7170
If you don't want browser tab to automatically open, add `--no-browser` flag in your command line.
7271

7372
If you want to increase the logging verbosity and see all the debug info, use the `--verbose` flag.
7473

7574
> Disclaimer: For the sake of improving the project quality, there is user analytics collected by the tool. You can disable this collecting with `--no-analytics` option. The collection is done via DataDog RUM and Heap Analytics. Only the anonymous data is collected, no sensitive information is used.
7675
76+
### Deploying Helm Dashboard on Kubernetes
77+
78+
The official helm chart is [available here](https://github.com/komodorio/helm-charts/blob/master/charts/helm-dashboard)
79+
80+
### Manual Installation
81+
82+
Download the appropriate [release package](https://github.com/komodorio/helm-dashboard/releases) for your platform, unpack it and just run `dashboard` binary from it.
83+
7784
## Scanner Integrations
7885

7986
Upon startup, Helm Dashboard detects the presence of [Trivy](https://github.com/aquasecurity/trivy)
@@ -93,7 +100,6 @@ We have two main channels for supporting the Helm Dashboard
93100
users: [Slack community](https://join.slack.com/t/komodorkommunity/shared_invite/zt-1dm3cnkue-ov1Yh~_95teA35QNx5yuMg) for general conversations
94101
and [GitHub issues](https://github.com/komodorio/helm-dashboard/issues) for real bugs.
95102

96-
97103
## Local Dev Testing
98104

99105
Prerequisites: `helm` and `kubectl` binaries installed and operational.

charts/helm-dashboard/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/helm-dashboard/Chart.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v2
2+
type: application
3+
4+
name: helm-dashboard
5+
description: A GUI Dashboard for Helm by Komodor
6+
icon: "https://github.com/komodorio/helm-dashboard/blob/main/pkg/dashboard/static/logo.png"
7+
8+
version: 0.1.0
9+
appVersion: "0.0.0"

0 commit comments

Comments
 (0)