Skip to content

Commit ca87bb3

Browse files
authored
Merge pull request #1 from HaveFun83/use-ingress-default-syntax
changed ingress values to more configurable syntax
2 parents e23a5cf + 5fcf24c commit ca87bb3

5 files changed

Lines changed: 56 additions & 27 deletions

File tree

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ This repository contains helm chart for CodiMD.
1010
## Install
1111

1212
```bash
13-
helm repo add codimd ......... (TBD)
14-
helm install codimd codimd/codimd
15-
```
13+
helm repo add codimd https://helm.codimd.dev/
14+
helm install my-release codimd/codimd
15+
```
16+
17+
## Documentation
18+
[charts/codimd/README.md](./charts/codimd/README.md)

charts/codimd/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ kubeVersion: ">=1.14.0-0"
1818

1919
# This is the chart version. This version number should be incremented each time you make changes
2020
# to the chart and its templates, including the app version.
21-
version: 0.1.5
21+
version: 0.1.6
2222

2323
# This is the version number of the application being deployed. This version number should be
2424
# incremented each time you make changes to the application.

charts/codimd/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ If you want use ingress, please set `service.type` to be `ClusterIP`
6868
| service.port | Service HTTP port | `80` |
6969
| service.externalTrafficPolicy | Service externalTrafficPolicy | `nil` |
7070
| service.loadBalancerIP | Service loadBalancerIP | `nil` |
71-
| ingress.enabled | Enable ingress controller resource | `false` |
72-
| ingress.annotation | Ingress annotations | `nil` |
73-
| ingress.hostname | Default host for the ingress resource | `nil` |
74-
| ingress.tlsSecret | TLS Secret Name | `nil` |
71+
| ingress.enabled | If `true` Ingress will be created | `false` |
72+
| ingress.annotations | Ingress annotations | `nil` |
73+
| ingress.hosts | Ingress hostnames | `nil` |
74+
| ingress.tls | Ingress TLS configuration (YAML) | `nil` |
7575

7676

7777
### CodiMD common parameters
Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,41 @@
1-
{{ if .Values.ingress.enabled }}
1+
{{- if .Values.ingress.enabled -}}
2+
{{- $fullName := include "codimd.fullname" . -}}
3+
{{- $svcPort := .Values.service.port -}}
4+
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
25
apiVersion: networking.k8s.io/v1beta1
6+
{{- else -}}
7+
apiVersion: extensions/v1beta1
8+
{{- end }}
39
kind: Ingress
410
metadata:
5-
name: {{ template "codimd.fullname" . }}
6-
{{ if .Values.ingress.annotation}}
11+
name: {{ $fullName }}
12+
labels:
13+
{{- include "codimd.labels" . | nindent 4 }}
14+
{{- with .Values.ingress.annotations }}
715
annotations:
8-
{{ toYaml .Values.ingress.annotation | nindent 4 }}
9-
{{ end }}
16+
{{- toYaml . | nindent 4 }}
17+
{{- end }}
1018
spec:
19+
{{- if .Values.ingress.tls }}
20+
tls:
21+
{{- range .Values.ingress.tls }}
22+
- hosts:
23+
{{- range .hosts }}
24+
- {{ . | quote }}
25+
{{- end }}
26+
secretName: {{ .secretName }}
27+
{{- end }}
28+
{{- end }}
1129
rules:
12-
- host: {{ .Values.ingress.hostname }}
30+
{{- range .Values.ingress.hosts }}
31+
- host: {{ .host | quote }}
1332
http:
1433
paths:
15-
- backend:
16-
serviceName: {{ template "codimd.fullname" . }}
17-
servicePort: 80
18-
{{ if .Values.ingress.tlsSecret }}
19-
tls:
20-
- hosts:
21-
- {{ .Values.ingress.hostname }}
22-
secretName: {{ .Values.ingress.tlsSecret }}
23-
{{ end }}
24-
{{ end }}
34+
{{- range .paths }}
35+
- path: {{ . }}
36+
backend:
37+
serviceName: {{ $fullName }}
38+
servicePort: {{ $svcPort }}
39+
{{- end }}
40+
{{- end }}
41+
{{- end }}

charts/codimd/values.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,18 @@ service:
6767
##
6868
ingress:
6969
enabled: false
70-
# annotation:
71-
# hostname:
72-
# tlsSecret:
70+
annotations: {}
71+
# kubernetes.io/ingress.class: nginx
72+
# kubernetes.io/tls-acme: "true"
73+
hosts:
74+
- host: chart-example.local
75+
paths:
76+
- /
77+
tls: []
78+
# - secretName: chart-example-tls
79+
# hosts:
80+
# - chart-example.local
81+
7382

7483
##
7584
## CodiMD application configuration

0 commit comments

Comments
 (0)