Skip to content

Commit

Permalink
Defining default path spec in ingress if hosts.*.paths is null (#240)
Browse files Browse the repository at this point in the history
* update changelog

* [application/templates/ingress.yaml] Defining default path spec in ingress if hosts.*.paths is null

* add pr number to chlog

* update readme

* fix readme statement

* update chlog : add changes for 2.1.4
  • Loading branch information
mustafaStakater committed Mar 29, 2023
1 parent a387411 commit 2b3f751
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@

All notable changes to this project will be documented here.

### v2.1.7
- Fix: Add ingress path with default configuration if not specified at all. [PR-240](https://github.com/stakater/application/pull/240)

### v2.1.6
- Fix: Qoute application version label in labels [PR-238](https://github.com/stakater/application/pull/238)

### v2.1.5
- Fix: Qoute application version label in labels [PR-38](https://github.com/stakater/application/pull/238)
- Fix: Repair ingress multiple paths definitions [PR-233](https://github.com/stakater/application/pull/233)

### v2.1.4
- Fix: Repair ingress multiple paths definitions [PR-233](https://github.com/stakater/application/pull/233)
- Update: Add MIT License [PR-237](https://github.com/stakater/application/pull/237)

### v2.1.2 && v2.1.3
- Update: Improve enable conditions by adding capabilites, use `_helpers.tpl` properly, Move to common k8s labels and remove other labels [PR-226](https://github.com/stakater/application/pull/226)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ Periodic probe of container liveness. Container will be restarted if the probe f
| Name | Description | Value |
| ------------------------ | -------------------------------------------------------------------------------------------- | --------------- |
| ingress.enabled | Enable ingress | `false` |
| ingress.servicePort | Port of the service that serves pod. | `8080` |
| ingress.pathType | Each path in an Ingress is required to have a corresponding path type of ingress hosts to validate rules properly | `ImplementationSpecific` |
| ingress.hosts | Array of hosts to be served by this ingress. See example. | `[]` |
| ingress.hosts | Array of hosts to be served by this ingress. | `[]` |
| ingress.hosts[].host | Host to be served. [See example](application/values-test.yaml). | `[]` |
| ingress.hosts[].paths | Paths against the host. If not specified, default configuration is added, [See example](application/values-test.yaml). | `[]` |
| ingress.additionalLabels | Labels for ingress | `{}` |
| ingress.annotations | Annotations for ingress | `{}` |
| ingress.tls | TLS block for ingress | `[]` |
Expand Down
10 changes: 10 additions & 0 deletions application/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spec:
- host: {{ tpl .host $ }}
http:
paths:
{{- if .paths }}
{{- range .paths }}
- path: {{ .path }}
pathType: {{ default "ImplementationSpecific" (.pathType) }}
Expand All @@ -34,6 +35,15 @@ spec:
port:
name: {{ default "http" (.servicePort) }}
{{- end }}
{{- else }}
- path: "/"
pathType: "ImplementationSpecific"
backend:
service:
name: {{ $applicationNameTpl }}
port:
name: "http"
{{- end }}
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
Expand Down
3 changes: 2 additions & 1 deletion application/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ ingress:
# List of host addresses to be exposed by this Ingress

hosts:
- host: chart-example.local
- host: chart-example-1.local
- host: chart-example-2.local
paths:
- path: /
# pathType: ''
Expand Down
4 changes: 2 additions & 2 deletions application/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ ingress:
# List of host addresses to be exposed by this Ingress
hosts:
- host: chart-example.local
paths:
- path: /
# paths:
# - path: /
# pathType: ''
# serviceName: ''
# servicePort: ''
Expand Down

0 comments on commit 2b3f751

Please sign in to comment.