Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/karpor/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: karpor
version: 0.7.5
version: 0.7.6
type: application
appVersion: 0.6.3
description: A modern kubernetes visualization tool (Karpor).
Expand Down
18 changes: 18 additions & 0 deletions charts/karpor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ The following table lists the configurable parameters of the chart and their def
| namespace | string | `"karpor"` | Which namespace to be deployed. |
| namespaceEnabled | bool | `true` | Whether to generate namespace. |
| registryProxy | string | `""` | Image registry proxy will be the prefix as all component image. |
| search.engine | string | `"elasticsearch"` | Engine for storage,may elasticsearch or meilisearch |
| search.external.addresses | list | `["192.168.0.1:3456"]` | Address for search engine |
| search.external.enabled | bool | `false` | If external is set to be true. and fill the connection information in "external" section |
| search.external.password | string | `""` | password for search engine |
| search.external.username | string | `""` | Username for search engine |

### Global Parameters

Expand Down Expand Up @@ -117,6 +122,19 @@ The ElasticSearch Component to store the synchronized resources and user data.
| elasticsearch.replicas | int | `1` | The number of ElasticSearch pods to run. |
| elasticsearch.resources | object | `{"limits":{"cpu":"2","ephemeral-storage":"10Gi","memory":"4Gi"},"requests":{"cpu":"2","ephemeral-storage":"10Gi","memory":"4Gi"}}` | Resource limits and requests for the karpor elasticsearch pods. |

The MeiliSearch Component to store the synchronized resources and user data.

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| meilisearch.image.repo | string | `"getmeili/meilisearch"` | Repository for meilisearch image. |
| meilisearch.image.tag | string | `"v1.13"` | Specific tag for meilisearch image. |
| meilisearch.key | string | `"danger!changeIt"` | Default master key |
| meilisearch.name | string | `"meilisearch"` | Component name for meilisearch. |
| meilisearch.noAnalytics | bool | `true` | |
| meilisearch.port | int | `7700` | Port for meilisearch. |
| meilisearch.replicas | int | `1` | The number of meilisearch pods to run. |
| meilisearch.resources | object | `{"limits":{"cpu":"2","ephemeral-storage":"10Gi","memory":"4Gi"},"requests":{"cpu":"2","ephemeral-storage":"10Gi","memory":"4Gi"}}` | Resource limits and requests for the karpor meilisearch pods. |

### ETCD

The ETCD Component is the storage of Karpor Server as `apiserver`.
Expand Down
13 changes: 12 additions & 1 deletion charts/karpor/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The following table lists the configurable parameters of the chart and their def
| 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) ) }}
{{- if not (or (hasPrefix "global" .Key) (hasPrefix "server" .Key) (hasPrefix "syncer" .Key) (hasPrefix "elasticsearch" .Key) (hasPrefix "meilisearch" .Key) (hasPrefix "etcd" .Key) (hasPrefix "job" .Key) ) }}
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} |
{{- end }}
{{- end }}
Expand Down Expand Up @@ -99,6 +99,17 @@ The ElasticSearch Component to store the synchronized resources and user data.
{{- end }}
{{- end }}

The MeiliSearch Component to store the synchronized resources and user data.

| Key | Type | Default | Description |
|-----|------|---------|-------------|
{{- range .Values }}
{{- if hasPrefix "meilisearch" .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`.
Expand Down
67 changes: 67 additions & 0 deletions charts/karpor/templates/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,70 @@ Real image.
.repo | join "/") }}:{{ if .needV }}v{{ end }}{{ default .context.Chart.AppVersion .tag }}
{{- end -}}

{{/*
ElasticSearch URL.
*/}}
{{- define "elasticsearch.url" -}}
{{ if .Values.search.external.enabled }}{{ .Values.search.external.addresses | join "," }}{{else}}http://elasticsearch.{{ .Values.namespace }}.svc:{{ .Values.elasticsearch.port }}{{end}}
{{- end -}}

{{/*
Meilisearch URL.
*/}}
{{- define "meilisearch.url" -}}
{{ if .Values.search.external.enabled }}{{ .Values.search.external.addresses | join "," }}{{else}}http://meilisearch.{{ .Values.namespace }}.svc:{{ .Values.meilisearch.port }}{{end}}
{{- end -}}



{{/*
Search URL Args.
*/}}
{{- define "karpor.searchURL" -}}
{{ if eq .Values.search.engine "meilisearch" }}{{ include "meilisearch.url" .}}{{else}}{{ include "elasticsearch.url" . }}{{ end }}
{{- end -}}

{{/*
Search User Args.
*/}}
{{- define "karpor.searchUsername" -}}
{{ if eq .Values.search.engine "meilisearch" }}{{ include "meilisearch.user" . }}{{else}}{{ include "elasticsearch.user" . }}{{ end }}
{{- end -}}

{{/*
Search Password Args.
*/}}
{{- define "karpor.searchPassword" -}}
{{ if eq .Values.search.engine "meilisearch" }}{{ include "meilisearch.password" . }}{{else}}{{ include "elasticsearch.password" . }}{{ end }}
{{- end -}}

{{/*
Meilisearch User.
*/}}
{{- define "meilisearch.user" -}}
{{ if .Values.search.external.enabled }}{{ .Values.search.external.username }}{{else}} {{ "" }}{{end}}
{{- end -}}

{{/*
Meilisearch Password.
*/}}
{{- define "meilisearch.password" -}}
{{ if .Values.search.external.enabled }}{{ .Values.search.external.password }}{{else}}{{ .Values.meilisearch.key }}{{end}}
{{- end -}}

{{/*
ElasticSearch User.
*/}}
{{- define "elasticsearch.user" -}}
{{ if .Values.search.external.enabled }}{{ .Values.search.external.username }}{{else}}{{ "" }}{{end}}
{{- end -}}

{{/*
ElasticSearch Password.
*/}}
{{- define "elasticsearch.password" -}}
{{ if .Values.search.external.enabled }}{{ .Values.search.external.password }}{{else}}{{ "" }}{{end}}
{{- end -}}



4 changes: 3 additions & 1 deletion charts/karpor/templates/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if and ( eq .Values.search.engine "elasticsearch") (not .Values.search.external) }}
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -43,7 +44,7 @@ spec:
- name: ES_JAVA_OPTS
value: -Xms1g -Xmx1g
image: {{ include "karpor.realImage" (dict "context" . "repo" .Values.elasticsearch.image.repo "tag" .Values.elasticsearch.image.tag) }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
name: elasticsearch
ports:
- containerPort: {{ .Values.elasticsearch.port }}
Expand All @@ -56,3 +57,4 @@ spec:
volumes:
- emptyDir: {}
name: data
{{- end }}
14 changes: 10 additions & 4 deletions charts/karpor/templates/karpor-server.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{{- if and ( ne .Values.search.engine "elasticsearch") (ne .Values.search.engine "meilisearch") }}
{{ fail "values.search.mode must be one of [elasticsearch,meilisearch] "}}
{{- end }}
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -41,9 +44,12 @@ spec:
spec:
containers:
- args:
- --search-storage-type=elasticsearch
- --elastic-search-addresses=http://elasticsearch.{{ .Values.namespace }}.svc:{{ .Values.elasticsearch.port }}
- --etcd-servers=http://etcd.{{ .Values.namespace }}.svc:{{ .Values.etcd.port }}
- --search-storage-type={{.Values.search.engine}}
- "--search-addresses={{ include "karpor.searchURL" . }}"
- "--search-username={{ include "karpor.searchUsername" . }}"
- "--search-password={{ include "karpor.searchPassword" . }}"
{{/* - --elastic-search-addresses=http://elasticsearch.{{ .Values.namespace }}.svc:{{ .Values.elasticsearch.port }}*/}}
- "--etcd-servers=http://etcd.{{ .Values.namespace }}.svc:{{ .Values.etcd.port }}"
- --secure-port={{ .Values.server.port }}
- --client-ca-file=/etc/karpor/ca.crt
- --service-account-signing-key-file=/etc/karpor/ca.key
Expand Down Expand Up @@ -81,7 +87,7 @@ spec:
command:
- /karpor
image: {{ include "karpor.realImage" (dict "context" . "repo" .Values.server.image.repo "tag" .Values.server.image.tag "needV" (not (hasPrefix "v" .Values.server.image.tag))) }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
name: karpor-server
ports:
- containerPort: {{ .Values.server.port }}
Expand Down
7 changes: 5 additions & 2 deletions charts/karpor/templates/karpor-syncer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ spec:
- /karpor
args:
- syncer
- --elastic-search-addresses=http://elasticsearch.{{ .Values.namespace }}.svc:{{ .Values.elasticsearch.port }}
- "--search-storage-type={{ .Values.search.engine }}"
- "--search-addresses={{ include "karpor.searchURL" . }}"
- "--search-username={{ include "karpor.searchUsername" .}}"
- "--search-password={{ include "karpor.searchPassword" .}}"
env:
- name: KUBECONFIG
value: /etc/karpor/config
image: {{ include "karpor.realImage" (dict "context" . "repo" .Values.syncer.image.repo "tag" .Values.syncer.image.tag "needV" (not (hasPrefix "v" .Values.syncer.image.tag))) }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
name: karpor-syncer
ports:
- containerPort: {{ .Values.syncer.port }}
Expand Down
57 changes: 57 additions & 0 deletions charts/karpor/templates/meilisearch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{{- if and (eq .Values.search.engine "meilisearch") (not .Values.search.external.enabled ) }}
apiVersion: v1
kind: Service
metadata:
name: meilisearch
namespace: {{ .Values.namespace }}
spec:
ports:
- port: {{ .Values.meilisearch.port }}
selector:
{{- include "karpor.selectorLabels" (dict "context" . "component" .Values.meilisearch.name) | nindent 4 }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: meilisearch
namespace: {{ .Values.namespace }}
labels:
{{- include "karpor.labels" (dict "context" . "component" .Values.meilisearch.name) | nindent 4 }}
spec:
replicas: {{ .Values.meilisearch.replicas }}
selector:
matchLabels:
{{- include "karpor.selectorLabels" (dict "context" . "component" .Values.meilisearch.name) | nindent 6 }}
template:
metadata:
labels:
{{- include "karpor.selectorLabels" (dict "context" . "component" .Values.meilisearch.name) | nindent 8 }}
spec:
volumes:
- emptyDir: {}
name: data
containers:
- name: meilisearch
image: {{ include "karpor.realImage" (dict "context" . "repo" .Values.meilisearch.image.repo "tag" .Values.meilisearch.image.tag) }}
command:
- meilisearch
- --master-key
- {{ .Values.meilisearch.key}}
- --experimental-contains-filter
{{ if .Values.meilisearch.noAnalytics }}
- --no-analytics
{{ end }}

ports:
- containerPort: {{ .Values.meilisearch.port }}
protocol: TCP
resources:
{{- toYaml .Values.meilisearch.resources | nindent 12 }}
volumeMounts:
- name: data
mountPath: /meili_data
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
restartPolicy: Always
{{- end }}
40 changes: 40 additions & 0 deletions charts/karpor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,47 @@ syncer:
cpu: 500m
memory: 1Gi
ephemeral-storage: 10Gi
search:
# -- Engine for storage,may elasticsearch or meilisearch
engine: elasticsearch
external:
# -- If external is set to be true. and fill the connection information in "external" section
enabled: false
# -- Address for search engine
addresses:
- "192.168.0.1:3456"
# -- Username for search engine
username: ""
# -- password for search engine
password: ""

# Configuration for meilisearch
meilisearch:
# -- Component name for meilisearch.
name: meilisearch
# -- The number of meilisearch pods to run.
replicas: 1
# -- Port for meilisearch.
port: 7700
# -- Default master key
key: danger!changeIt
# -- If set to be true, add flag --no-analytics
noAnalytics: true
image:
# -- Repository for meilisearch image.
repo: getmeili/meilisearch
# -- Specific tag for meilisearch image.
tag: "v1.13"
# -- Resource limits and requests for the karpor meilisearch pods.
resources:
requests:
cpu: "2"
memory: 4Gi
ephemeral-storage: 10Gi
limits:
cpu: "2"
memory: 4Gi
ephemeral-storage: 10Gi
# Configuration for ElasticSearch
elasticsearch:
# -- Component name for ElasticSearch.
Expand Down
Loading