Skip to content

Commit

Permalink
feat: support specify registry proxy in karpor chart (#37)
Browse files Browse the repository at this point in the history
* feat: support specify registry proxy in karpor chart

* chore: bump version to 0.5.1
  • Loading branch information
elliotxx authored Jul 23, 2024
1 parent c95d7ed commit 4f52af1
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/karpor/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: v2
name: karpor
# The Chart Version
version: 0.5.0
version: 0.5.1
type: application
# The Application Version in the Chart
appVersion: 0.4.2
Expand Down
3 changes: 2 additions & 1 deletion charts/karpor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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)
![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-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.

Expand Down Expand Up @@ -49,6 +49,7 @@ 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. |

### Global Parameters

Expand Down
8 changes: 8 additions & 0 deletions charts/karpor/templates/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ app.kubernetes.io/component: {{ .component }}
app.kubernetes.io/instance: {{ .context.Release.Name }}
{{- end }}

{{/*
Real image.
*/}}
{{- define "karpor.realImage" -}}
{{- trimPrefix "/" (list (trimAll "/" .context.Values.registryProxy)
.repo | join "/") }}:{{ if .hasV }}v{{ end }}{{ default .context.Chart.AppVersion .tag }}
{{- end -}}

2 changes: 1 addition & 1 deletion charts/karpor/templates/elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
value: elastic
- name: ES_JAVA_OPTS
value: -Xms1g -Xmx1g
image: {{ .Values.elasticsearch.image.repo }}:{{ .Values.elasticsearch.image.tag }}
image: {{ include "karpor.realImage" (dict "context" . "repo" .Values.elasticsearch.image.repo "tag" .Values.elasticsearch.image.tag) }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
name: elasticsearch
ports:
Expand Down
2 changes: 1 addition & 1 deletion charts/karpor/templates/etcd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
spec:
containers:
- name: etcd
image: {{ .Values.etcd.image.repo }}:{{ .Values.etcd.image.tag }}
image: {{ include "karpor.realImage" (dict "context" . "repo" .Values.etcd.image.repo "tag" .Values.etcd.image.tag) }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
command:
- /usr/local/bin/etcd
Expand Down
2 changes: 1 addition & 1 deletion charts/karpor/templates/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
spec:
containers:
- name: karpor-generate-cert
image: {{ .Values.job.image.repo }}:{{ .Values.job.image.tag }}
image: {{ include "karpor.realImage" (dict "context" . "repo" .Values.job.image.repo "tag" .Values.job.image.tag) }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
command:
- /bin/sh
Expand Down
2 changes: 1 addition & 1 deletion charts/karpor/templates/karpor-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
- --client-ca-file=/etc/karpor/ca.crt
command:
- /karpor
image: {{ .Values.server.image.repo }}:v{{ default .Chart.AppVersion .Values.server.image.tag }}
image: {{ include "karpor.realImage" (dict "context" . "repo" .Values.server.image.repo "tag" .Values.server.image.tag "hasV" true) }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
name: karpor-server
ports:
Expand Down
2 changes: 1 addition & 1 deletion charts/karpor/templates/karpor-syncer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
env:
- name: KUBECONFIG
value: /etc/karpor/config
image: {{ .Values.syncer.image.repo }}:v{{ default .Chart.AppVersion .Values.syncer.image.tag }}
image: {{ include "karpor.realImage" (dict "context" . "repo" .Values.syncer.image.repo "tag" .Values.syncer.image.tag "hasV" true) }}
imagePullPolicy: {{ .Values.global.image.imagePullPolicy }}
name: karpor-syncer
ports:
Expand Down
2 changes: 2 additions & 0 deletions charts/karpor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
namespace: karpor
# -- Whether to generate namespace.
namespaceEnabled: true
# -- Image registry proxy will be the prefix as all component image.
registryProxy: ""

# Global configuration for Karpor components
global:
Expand Down

0 comments on commit 4f52af1

Please sign in to comment.