Skip to content

Commit dea6b9e

Browse files
authored
feat: add default backend for ingress (#215)
* feat: add default backend for ingress Signed-off-by: Mark Phelps <[email protected]> * chore: use default dict Signed-off-by: Mark Phelps <[email protected]> --------- Signed-off-by: Mark Phelps <[email protected]>
1 parent 5f8b87c commit dea6b9e

File tree

5 files changed

+58
-7
lines changed

5 files changed

+58
-7
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,48 @@ You can also override the default config values with environment variables via t
5959

6060
Note the values must be still be named as `FLIPT_<CONFIG_KEY>` per the [documentation](https://flipt.io/docs/configuration#environment-variables).
6161

62+
### Ingress Configuration
63+
64+
The chart supports ingress configuration with automatic generation of the required configuration. To enable the ingress controller, set `ingress.enabled=true` in your values file:
65+
66+
```yaml
67+
flipt:
68+
ingress:
69+
enabled: true
70+
className: nginx # optional: only if you're using a specific ingress class
71+
hosts:
72+
- host: flipt.example.com
73+
paths:
74+
- path: /
75+
pathType: Prefix
76+
```
77+
78+
For more advanced configurations, such as TLS and custom annotations:
79+
80+
```yaml
81+
flipt:
82+
ingress:
83+
enabled: true
84+
className: nginx
85+
annotations:
86+
cert-manager.io/cluster-issuer: "letsencrypt-prod"
87+
hosts:
88+
- host: flipt.example.com
89+
paths:
90+
- path: /
91+
pathType: Prefix
92+
# backend configuration is optional and will default to:
93+
# backend:
94+
# servicePort: http
95+
# serviceName: <release-name>-flipt
96+
tls:
97+
- hosts:
98+
- flipt.example.com
99+
secretName: flipt-tls
100+
```
101+
102+
The backend service configuration is optional. If not specified, the chart will automatically use the correct service name and port.
103+
62104
### YAML
63105
64106
You can also configure this chart using YAML. See the [values.yaml](charts/flipt/values.yaml) file for the default values under `flipt.config`.

charts/flipt/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: flipt
33
home: https://flipt.io
44
description: Flipt is an open-source, self-hosted feature flag solution.
55
type: application
6-
version: 0.81.0
6+
version: 0.82.0
77
appVersion: v1.56.0
88
maintainers:
99
- name: Flipt

charts/flipt/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Flipt Helm Chart
22

3-
This chart is still a work in progress.
4-
53
Please [create an issue](https://github.com/flipt-io/helm-charts/issues/new?labels=helm) or submit a pull request for any issues or missing features.
4+
5+
See the [README](https://github.com/flipt-io/helm-charts/blob/main/README.md) and [values.yaml](https://github.com/flipt-io/helm-charts/blob/main/charts/flipt/values.yaml) for more information.

charts/flipt/templates/ingress.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,16 @@ spec:
4949
backend:
5050
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
5151
service:
52-
name: {{ default $fullName .backend.serviceName }}
52+
name: {{ default $fullName ((default dict .backend).serviceName) }}
5353
port:
54-
name: {{ .backend.servicePort }}
54+
{{- if (default dict .backend).servicePort }}
55+
name: {{ (default dict .backend).servicePort }}
56+
{{- else }}
57+
name: http
58+
{{- end }}
5559
{{- else }}
56-
serviceName: {{ default $fullName .backend.serviceName }}
57-
servicePort: {{ .backend.servicePort }}
60+
serviceName: {{ default $fullName ((default dict .backend).serviceName) }}
61+
servicePort: {{ default "http" ((default dict .backend).servicePort) }}
5862
{{- end }}
5963
{{- end }}
6064
{{- end }}

charts/flipt/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ ingress:
8585
paths:
8686
- path: /
8787
pathType: ImplementationSpecific
88+
# backend configuration is optional
89+
# if not specified, defaults to:
90+
# backend:
91+
# servicePort: http
92+
# serviceName: <chart-fullname>
8893
backend:
8994
servicePort: http
9095
serviceName: ""

0 commit comments

Comments
 (0)