diff --git a/charts/karpor/Chart.yaml b/charts/karpor/Chart.yaml index ef8cb71..9f68ddc 100644 --- a/charts/karpor/Chart.yaml +++ b/charts/karpor/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: karpor -version: 0.7.6 +version: 0.7.7 type: application appVersion: 0.6.4 description: A modern kubernetes visualization tool (Karpor). diff --git a/charts/karpor/README.md b/charts/karpor/README.md index 31d4ff2..99ce8a7 100644 --- a/charts/karpor/README.md +++ b/charts/karpor/README.md @@ -141,5 +141,26 @@ This one-time job is used to generate root certificates and some preliminary wor | job.image.repo | string | `"kusionstack/karpor"` | Repository for the Job image. | | job.image.tag | string | `""` | Tag for Karpor image. Defaults to the chart's appVersion if not specified. | +### Ingress + +An optional Ingress that exposes the Karpor Server. It is disabled by default. The server only serves HTTPS, so tell your ingress controller to use HTTPS for the backend. For example, with ingress-nginx: + +```shell +helm install karpor-release kusionstack/karpor \ + --set ingress.enabled=true \ + --set ingress.className=nginx \ + --set ingress.hosts[0].host=karpor.example.com \ + --set ingress.hosts[0].paths[0].path=/ \ + --set-string ingress.annotations."nginx\.ingress\.kubernetes\.io/backend-protocol"=HTTPS +``` + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| ingress.annotations | object | `{}` | Annotations for the Ingress. The karpor server only serves HTTPS on `server.port`, so the ingress controller must talk HTTPS to the backend. For ingress-nginx, set `nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"`. | +| ingress.className | string | `""` | Name of the IngressClass to use, e.g. "nginx". Leave empty to use the cluster's default IngressClass. | +| ingress.enabled | bool | `false` | Whether to create an Ingress for the karpor server. | +| ingress.hosts | list | `[{"host":"karpor.example.com","paths":[{"path":"/","pathType":"Prefix"}]}]` | Host rules for the Ingress. Each host routes its paths to the karpor server service. | +| ingress.tls | list | `[]` | TLS settings for the Ingress, e.g. `[{"hosts": ["karpor.example.com"], "secretName": "karpor-tls"}]`. | + ---------------------------------------------- Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) diff --git a/charts/karpor/README.md.gotmpl b/charts/karpor/README.md.gotmpl index 87e00f9..786a218 100644 --- a/charts/karpor/README.md.gotmpl +++ b/charts/karpor/README.md.gotmpl @@ -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 "etcd" .Key) (hasPrefix "job" .Key) (hasPrefix "ingress" .Key) ) }} | {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | {{- end }} {{- end }} @@ -123,5 +123,26 @@ This one-time job is used to generate root certificates and some preliminary wor {{- end }} {{- end }} +### Ingress + +An optional Ingress that exposes the Karpor Server. It is disabled by default. The server only serves HTTPS, so tell your ingress controller to use HTTPS for the backend. For example, with ingress-nginx: + +```shell +helm install karpor-release kusionstack/karpor \ + --set ingress.enabled=true \ + --set ingress.className=nginx \ + --set ingress.hosts[0].host=karpor.example.com \ + --set ingress.hosts[0].paths[0].path=/ \ + --set-string ingress.annotations."nginx\.ingress\.kubernetes\.io/backend-protocol"=HTTPS +``` + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +{{- range .Values }} + {{- if hasPrefix "ingress" .Key }} +| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | + {{- end }} +{{- end }} + ---------------------------------------------- Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) diff --git a/charts/karpor/templates/ingress.yml b/charts/karpor/templates/ingress.yml new file mode 100644 index 0000000..9327e0d --- /dev/null +++ b/charts/karpor/templates/ingress.yml @@ -0,0 +1,37 @@ +{{- if .Values.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: karpor-server + namespace: {{ .Values.namespace }} + labels: {{- include "karpor.labels" (dict "context" . "component" .Values.server.name) | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- with .Values.ingress.className }} + ingressClassName: {{ . }} + {{- end }} + {{- with .Values.ingress.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - http: + paths: + {{- range .paths }} + - path: {{ .path }} + pathType: {{ default "Prefix" .pathType }} + backend: + service: + name: karpor-server + port: + number: {{ $.Values.server.port }} + {{- end }} + {{- with .host }} + host: {{ . | quote }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/karpor/values.yaml b/charts/karpor/values.yaml index 16fc325..f2673bf 100644 --- a/charts/karpor/values.yaml +++ b/charts/karpor/values.yaml @@ -165,3 +165,21 @@ job: repo: kusionstack/karpor # -- Tag for Karpor image. Defaults to the chart's appVersion if not specified. tag: "" + +# Configuration for Ingress +ingress: + # -- Whether to create an Ingress for the karpor server. + enabled: false + # -- Name of the IngressClass to use, e.g. "nginx". Leave empty to use the cluster's default IngressClass. + className: "" + # -- Annotations for the Ingress. The karpor server only serves HTTPS on `server.port`, so the ingress controller + # must talk HTTPS to the backend. For ingress-nginx, set `nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"`. + annotations: {} + # -- Host rules for the Ingress. Each host routes its paths to the karpor server service. + hosts: + - host: karpor.example.com + paths: + - path: / + pathType: Prefix + # -- TLS settings for the Ingress, e.g. `[{"hosts": ["karpor.example.com"], "secretName": "karpor-tls"}]`. + tls: []