-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refact karpor chart, add more variables, bump to v0.5 (#36)
* refactor: refine karpor chart, add more variables * chore: support auto generate readme * docs: add helm set help * fix: lint problmes, add lint to makefile
- Loading branch information
Showing
12 changed files
with
426 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,22 @@ | ||
# The fields explain in the Chart.yaml can refer: | ||
# https://helm.sh/docs/topics/charts/#the-chartyaml-file | ||
apiVersion: v2 | ||
name: karpor | ||
# The Chart Version | ||
version: 0.5.0 | ||
type: application | ||
# The Application Version in the Chart | ||
appVersion: 0.4.2 | ||
description: A Helm chart for Karpor, a modern kubernetes visualization tool. | ||
home: https://github.com/KusionStack/karpor | ||
icon: https://kusionstack.io/karpor/assets/logo/logo.svg | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.4.3 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: 0.4.2 | ||
|
||
maintainers: | ||
- name: kusionstack | ||
email: kusionstack@gmail.com | ||
url: https://kusionstack.io/karpor | ||
sources: | ||
- https://github.com/KusionStack/charts/tree/master/charts/karpor | ||
- https://github.com/KusionStack/karpor | ||
keywords: | ||
- KusionStack | ||
- karpor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# To generate help information | ||
.DEFAULT_GOAL := help | ||
.PHONY: help | ||
help: ## This help message :) | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: lint | ||
lint: ## Lint, will not fix but sets exit code on error | ||
@which yamllint > /dev/null || (echo "Installing yamllint@latest ..."; brew install yamllint && echo -e "Installation complete!\n") | ||
@yamllint --config-file ../../.github/configs/lintconf.yaml *.yaml | ||
|
||
.PHONY: doc | ||
doc: ## Auto Generate README with helm-docs and README.md.gotmpl | ||
@which helm-docs > /dev/null || (echo "Installing helm-docs@latest ..."; go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest && echo -e "Installation complete!\n") | ||
@helm-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# Karpor Chart | ||
|
||
![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.4.2](https://img.shields.io/badge/AppVersion-0.4.2-informational?style=flat-square) | ||
|
||
A Helm chart for Karpor, a modern kubernetes visualization tool. | ||
|
||
**Homepage:** <https://github.com/KusionStack/karpor> | ||
|
||
## Maintainers | ||
|
||
| Name | Email | Url | | ||
| ---- | ------ | --- | | ||
| kusionstack | <kusionstack@gmail.com> | <https://kusionstack.io/karpor> | | ||
|
||
## Source Code | ||
|
||
* <https://github.com/KusionStack/charts/tree/master/charts/karpor> | ||
* <https://github.com/KusionStack/karpor> | ||
|
||
## Prerequisites | ||
|
||
- Helm v3.5.0+ | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `my-release`: | ||
|
||
```bash | ||
$ helm repo add kusionstack https://kusionstack.github.io/charts | ||
$ helm repo update | ||
$ helm install karpor kusionstack/karpor | ||
``` | ||
|
||
**Note** that installing this chart directly means it will use the [default template values](./values.yaml) for Karpor. | ||
|
||
You may have to set your specific configurations if it is deployed into a production cluster, or you want to custom configure `resources`, `replicas`, `port` etc. | ||
|
||
```bash | ||
$ helm install my-release kusionstack/karpor --set server.replicas=3 --set syncer.port=7654 | ||
``` | ||
|
||
## Chart Parameters | ||
|
||
The following table lists the configurable parameters of the chart and their default values. | ||
|
||
### General Parameters | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| namespace | string | `"karpor"` | Which namespace to be deployed. | | ||
| namespaceEnabled | bool | `true` | Whether to generate namespace. | | ||
|
||
### Global Parameters | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| global.image.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy to be applied to all Karpor components. | | ||
|
||
### Karpor Server | ||
|
||
The Karpor Server Component is main backend server. It itself is an `apiserver`, which also provides `/rest-api` to serve Dashboard. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| server.image.repo | string | `"kusionstack/karpor"` | Repository for Karpor server image. | | ||
| server.image.tag | string | `""` | Tag for Karpor server image. Defaults to the chart's appVersion if not specified. | | ||
| server.name | string | `"karpor-server"` | Component name for Karpor server. | | ||
| server.port | int | `7443` | Port for Karpor server. | | ||
|
||
### Karpor Syncer | ||
|
||
The Karpor Syncer Component is independent server to synchronize cluster resources in real-time. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| syncer.image.repo | string | `"kusionstack/karpor"` | Repository for Karpor syncer image. | | ||
| syncer.image.tag | string | `""` | Tag for Karpor syncer image. Defaults to the chart's appVersion if not specified. | | ||
| syncer.name | string | `"karpor-syncer"` | Component name for Karpor syncer. | | ||
| syncer.port | int | `7443` | Port for Karpor syncer. | | ||
|
||
### ElasticSearch | ||
|
||
The ElasticSearch Component to store the synchronized resources and user data. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| elasticsearch.image.repo | string | `"docker.elastic.co/elasticsearch/elasticsearch"` | Repository for ElasticSearch image. | | ||
| elasticsearch.image.tag | string | `"8.6.2"` | Specific tag for ElasticSearch image. | | ||
| elasticsearch.name | string | `"elasticsearch"` | Component name for ElasticSearch. | | ||
| elasticsearch.port | int | `9200` | Port for ElasticSearch. | | ||
|
||
### ETCD | ||
|
||
The ETCD Component is the storage of Karpor Server as `apiserver`. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| etcd.image.repo | string | `"quay.io/coreos/etcd"` | Repository for ETCD image. | | ||
| etcd.image.tag | string | `"v3.5.11"` | Specific tag for ETCD image. | | ||
| etcd.name | string | `"etcd"` | Component name for ETCD. | | ||
| etcd.port | int | `2379` | Port for ETCD. | | ||
|
||
### Job | ||
|
||
This one-time job is used to generate root certificates and some preliminary work. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| job.image.repo | string | `"golang"` | Repository for the Job image. | | ||
| job.image.tag | string | `"1.19"` | Specific tag for the Job image. | | ||
|
||
---------------------------------------------- | ||
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# Karpor Chart | ||
|
||
{{ template "chart.badgesSection" . }} | ||
|
||
{{ template "chart.description" . }} | ||
|
||
{{ template "chart.homepageLine" . }} | ||
|
||
{{ template "chart.maintainersSection" . }} | ||
|
||
{{ template "chart.sourcesSection" . }} | ||
|
||
## Prerequisites | ||
|
||
- Helm v3.5.0+ | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `my-release`: | ||
|
||
```bash | ||
$ helm repo add kusionstack https://kusionstack.github.io/charts | ||
$ helm repo update | ||
$ helm install karpor kusionstack/karpor | ||
``` | ||
|
||
**Note** that installing this chart directly means it will use the [default template values](./values.yaml) for Karpor. | ||
|
||
You may have to set your specific configurations if it is deployed into a production cluster, or you want to custom configure `resources`, `replicas`, `port` etc. | ||
|
||
```bash | ||
$ helm install my-release kusionstack/karpor --set server.replicas=3 --set syncer.port=7654 | ||
``` | ||
|
||
## Chart Parameters | ||
|
||
The following table lists the configurable parameters of the chart and their default values. | ||
|
||
### General Parameters | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
{{- range .Values }} | ||
{{- if not (or (hasPrefix "global" .Key) (hasPrefix "server" .Key) (hasPrefix "syncer" .Key) (hasPrefix "elasticsearch" .Key) (hasPrefix "etcd" .Key) (hasPrefix "job" .Key) ) }} | ||
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | | ||
{{- end }} | ||
{{- end }} | ||
|
||
### Global Parameters | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
{{- range .Values }} | ||
{{- if hasPrefix "global" .Key }} | ||
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | | ||
{{- end }} | ||
{{- end }} | ||
|
||
### Karpor Server | ||
|
||
The Karpor Server Component is main backend server. It itself is an `apiserver`, which also provides `/rest-api` to serve Dashboard. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
{{- range .Values }} | ||
{{- if hasPrefix "server" .Key }} | ||
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | | ||
{{- end }} | ||
{{- end }} | ||
|
||
### Karpor Syncer | ||
|
||
The Karpor Syncer Component is independent server to synchronize cluster resources in real-time. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
{{- range .Values }} | ||
{{- if hasPrefix "syncer" .Key }} | ||
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | | ||
{{- end }} | ||
{{- end }} | ||
|
||
### ElasticSearch | ||
|
||
The ElasticSearch Component to store the synchronized resources and user data. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
{{- range .Values }} | ||
{{- if hasPrefix "elasticsearch" .Key }} | ||
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | | ||
{{- end }} | ||
{{- end }} | ||
|
||
### ETCD | ||
|
||
The ETCD Component is the storage of Karpor Server as `apiserver`. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
{{- range .Values }} | ||
{{- if hasPrefix "etcd" .Key }} | ||
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | | ||
{{- end }} | ||
{{- end }} | ||
|
||
### Job | ||
|
||
This one-time job is used to generate root certificates and some preliminary work. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
{{- range .Values }} | ||
{{- if hasPrefix "job" .Key }} | ||
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- if not .SkipVersionFooter }} | ||
{{ template "helm-docs.versionFooter" . }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "karpor.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "karpor.labels" -}} | ||
helm.sh/chart: {{ include "karpor.chart" .context }} | ||
{{ include "karpor.selectorLabels" (dict "context" .context "component" .component) }} | ||
app.kubernetes.io/managed-by: {{ .context.Release.Service }} | ||
app.kubernetes.io/version: {{ .context.Chart.AppVersion }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "karpor.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ .context.Chart.Name }} | ||
{{- if .component }} | ||
app.kubernetes.io/component: {{ .component }} | ||
{{- end }} | ||
app.kubernetes.io/instance: {{ .context.Release.Name }} | ||
{{- end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.