Skip to content

Commit 51e0e15

Browse files
steacheBitnami Containers
andauthored
[bitnami/haproxy] allow to create ingress (#12424)
* Fix: chart version Signed-off-by: Tomáš Sýkora <tomas@reservio.com> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Signed-off-by: Tomáš Sýkora <tomas@reservio.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
1 parent 96e0229 commit 51e0e15

File tree

4 files changed

+199
-13
lines changed

4 files changed

+199
-13
lines changed

bitnami/haproxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ name: haproxy
2323
sources:
2424
- https://github.com/bitnami/containers/tree/main/bitnami/haproxy
2525
- https://github.com/haproxytech/haproxy
26-
version: 0.5.5
26+
version: 0.6.0

bitnami/haproxy/README.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,32 @@ The command removes all the Kubernetes components associated with the chart and
8181

8282
### Traffic Exposure Parameters
8383

84-
| Name | Description | Value |
85-
| ---------------------------------- | -------------------------------------------------------------------- | -------------- |
86-
| `service.type` | haproxy service type | `LoadBalancer` |
87-
| `service.ports` | List of haproxy service ports | `[]` |
88-
| `service.clusterIP` | haproxy service Cluster IP | `""` |
89-
| `service.loadBalancerIP` | haproxy service Load Balancer IP | `""` |
90-
| `service.loadBalancerSourceRanges` | haproxy service Load Balancer sources | `[]` |
91-
| `service.externalTrafficPolicy` | haproxy service external traffic policy | `Cluster` |
92-
| `service.annotations` | Additional custom annotations for haproxy service | `{}` |
93-
| `service.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` |
94-
| `service.sessionAffinityConfig` | Additional settings for the sessionAffinity | `{}` |
95-
| `service.labels` | Additional custom labels for haproxy service | `{}` |
84+
| Name | Description | Value |
85+
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
86+
| `service.type` | haproxy service type | `LoadBalancer` |
87+
| `service.ports` | List of haproxy service ports | `[]` |
88+
| `service.clusterIP` | haproxy service Cluster IP | `""` |
89+
| `service.loadBalancerIP` | haproxy service Load Balancer IP | `""` |
90+
| `service.loadBalancerSourceRanges` | haproxy service Load Balancer sources | `[]` |
91+
| `service.externalTrafficPolicy` | haproxy service external traffic policy | `Cluster` |
92+
| `service.annotations` | Additional custom annotations for haproxy service | `{}` |
93+
| `service.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` |
94+
| `service.sessionAffinityConfig` | Additional settings for the sessionAffinity | `{}` |
95+
| `service.labels` | Additional custom labels for haproxy service | `{}` |
96+
| `ingress.enabled` | Enable ingress record generation for haproxy | `false` |
97+
| `ingress.pathType` | Ingress path type | `ImplementationSpecific` |
98+
| `ingress.apiVersion` | Force Ingress API version (automatically detected if not set) | `""` |
99+
| `ingress.hostname` | Default host for the ingress record | `haproxy.local` |
100+
| `ingress.path` | Default path for the ingress record | `/` |
101+
| `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` |
102+
| `ingress.tls` | Enable TLS configuration for the host defined at `ingress.hostname` parameter | `false` |
103+
| `ingress.selfSigned` | Create a TLS secret for this ingress record using self-signed certificates generated by Helm | `false` |
104+
| `ingress.extraHosts` | An array with additional hostname(s) to be covered with the ingress record | `[]` |
105+
| `ingress.extraPaths` | An array with additional arbitrary paths that may need to be added to the ingress under the main host | `[]` |
106+
| `ingress.extraTls` | TLS configuration for additional hostname(s) to be covered with this ingress record | `[]` |
107+
| `ingress.secrets` | Custom TLS certificates as secrets | `[]` |
108+
| `ingress.ingressClassName` | IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) | `""` |
109+
| `ingress.extraRules` | Additional rules to be covered with this ingress record | `[]` |
96110

97111

98112
### HAProxy Parameters
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{{- if .Values.ingress.enabled }}
2+
apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
3+
kind: Ingress
4+
metadata:
5+
name: {{ include "common.names.fullname" . }}
6+
namespace: {{ .Release.Namespace | quote }}
7+
labels: {{- include "common.labels.standard" . | nindent 4 }}
8+
{{- if .Values.commonLabels }}
9+
{{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
10+
{{- end }}
11+
annotations:
12+
{{- if .Values.commonAnnotations }}
13+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
14+
{{- end }}
15+
{{- if .Values.ingress.annotations }}
16+
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.annotations "context" $) | nindent 4 }}
17+
{{- end }}
18+
spec:
19+
{{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }}
20+
ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
21+
{{- end }}
22+
rules:
23+
{{- if .Values.ingress.hostname }}
24+
- host: {{ include "common.tplvalues.render" ( dict "value" .Values.ingress.hostname "context" $ ) }}
25+
http:
26+
paths:
27+
{{- if .Values.ingress.extraPaths }}
28+
{{- toYaml .Values.ingress.extraPaths | nindent 10 }}
29+
{{- end }}
30+
- path: {{ .Values.ingress.path }}
31+
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
32+
pathType: {{ .Values.ingress.pathType }}
33+
{{- end }}
34+
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" "http" "context" $) | nindent 14 }}
35+
{{- end }}
36+
{{- range .Values.ingress.extraHosts }}
37+
- host: {{ include "common.tplvalues.render" ( dict "value" .name "context" $ ) }}
38+
http:
39+
paths:
40+
- path: {{ default "/" .path }}
41+
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
42+
pathType: {{ default "ImplementationSpecific" .pathType }}
43+
{{- end }}
44+
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" "http" "context" $) | nindent 14 }}
45+
{{- end }}
46+
{{- if .Values.ingress.extraRules }}
47+
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraRules "context" $) | nindent 4 }}
48+
{{- end }}
49+
{{- if or (and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned)) .Values.ingress.extraTls }}
50+
tls:
51+
{{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned) }}
52+
- hosts:
53+
- {{ .Values.ingress.hostname | quote }}
54+
secretName: {{ printf "%s-tls" .Values.ingress.hostname }}
55+
{{- end }}
56+
{{- if .Values.ingress.extraTls }}
57+
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }}
58+
{{- end }}
59+
{{- end }}
60+
{{- end }}

bitnami/haproxy/values.yaml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,118 @@ service:
111111
##
112112
labels: {}
113113

114+
## Configure the ingress resource that allows you to access the haproxy installation
115+
## ref: https://kubernetes.io/docs/user-guide/ingress/
116+
##
117+
ingress:
118+
## @param ingress.enabled Enable ingress record generation for haproxy
119+
##
120+
enabled: false
121+
## @param ingress.pathType Ingress path type
122+
##
123+
pathType: ImplementationSpecific
124+
## @param ingress.apiVersion Force Ingress API version (automatically detected if not set)
125+
##
126+
apiVersion: ""
127+
## @param ingress.hostname Default host for the ingress record
128+
##
129+
hostname: haproxy.local
130+
## @param ingress.path Default path for the ingress record
131+
## NOTE: You may need to set this to '/*' in order to use this with ALB ingress controllers
132+
##
133+
path: /
134+
## @param ingress.annotations Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations.
135+
## For a full list of possible ingress annotations, please see
136+
## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md
137+
## Use this parameter to set the required annotations for cert-manager, see
138+
## ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations
139+
##
140+
## e.g:
141+
## annotations:
142+
## kubernetes.io/ingress.class: nginx
143+
## cert-manager.io/cluster-issuer: cluster-issuer-name
144+
##
145+
annotations: {}
146+
## @param ingress.tls Enable TLS configuration for the host defined at `ingress.hostname` parameter
147+
## TLS certificates will be retrieved from a TLS secret with name: `{{- printf "%s-tls" .Values.ingress.hostname }}`
148+
## You can:
149+
## - Use the `ingress.secrets` parameter to create this TLS secret
150+
## - Rely on cert-manager to create it by setting the corresponding annotations
151+
## - Rely on Helm to create self-signed certificates by setting `ingress.selfSigned=true`
152+
##
153+
tls: false
154+
## DEPRECATED: Use ingress.annotations instead of ingress.certManager
155+
## certManager: false
156+
##
157+
158+
## @param ingress.selfSigned Create a TLS secret for this ingress record using self-signed certificates generated by Helm
159+
##
160+
selfSigned: false
161+
## @param ingress.extraHosts An array with additional hostname(s) to be covered with the ingress record
162+
## e.g:
163+
## extraHosts:
164+
## - name: haproxy.local
165+
## path: /
166+
##
167+
extraHosts: []
168+
## @param ingress.extraPaths An array with additional arbitrary paths that may need to be added to the ingress under the main host
169+
## e.g:
170+
## extraPaths:
171+
## - path: /*
172+
## backend:
173+
## serviceName: ssl-redirect
174+
## servicePort: use-annotation
175+
##
176+
extraPaths: []
177+
## @param ingress.extraTls TLS configuration for additional hostname(s) to be covered with this ingress record
178+
## ref: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
179+
## e.g:
180+
## extraTls:
181+
## - hosts:
182+
## - haproxy.local
183+
## secretName: haproxy.local-tls
184+
##
185+
extraTls: []
186+
## @param ingress.secrets Custom TLS certificates as secrets
187+
## NOTE: 'key' and 'certificate' are expected in PEM format
188+
## NOTE: 'name' should line up with a 'secretName' set further up
189+
## If it is not set and you're using cert-manager, this is unneeded, as it will create a secret for you with valid certificates
190+
## If it is not set and you're NOT using cert-manager either, self-signed certificates will be created valid for 365 days
191+
## It is also possible to create and manage the certificates outside of this helm chart
192+
## Please see README.md for more information
193+
## e.g:
194+
## secrets:
195+
## - name: haproxy.local-tls
196+
## key: |-
197+
## -----BEGIN RSA PRIVATE KEY-----
198+
## ...
199+
## -----END RSA PRIVATE KEY-----
200+
## certificate: |-
201+
## -----BEGIN CERTIFICATE-----
202+
## ...
203+
## -----END CERTIFICATE-----
204+
##
205+
secrets: []
206+
## @param ingress.ingressClassName IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+)
207+
## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster .
208+
## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/
209+
##
210+
ingressClassName: ""
211+
## @param ingress.extraRules Additional rules to be covered with this ingress record
212+
## ref: https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-rules
213+
## e.g:
214+
## extraRules:
215+
## - host: example.local
216+
## http:
217+
## path: /
218+
## backend:
219+
## service:
220+
## name: example-svc
221+
## port:
222+
## name: http
223+
##
224+
extraRules: []
225+
114226
## @section HAProxy Parameters
115227
##
116228
## @param image.registry HAProxy image registry

0 commit comments

Comments
 (0)