Skip to content

Commit

Permalink
Extend the chart to support to create the ingress resource. #5 (#7)
Browse files Browse the repository at this point in the history
* Extend the chart to support to create the ingress resource. #5

* Add new parameter to specify the className of the ingress controller resource used

* Add missing parameters to the Traffic Exposure parameters table

* Update charts/backstage/templates/ingress.yaml

Test if the parameter ingress.className exists and then add it

Co-authored-by: Vincenzo Scamporlino <[email protected]>

* Update README.md

Fix the typo error `bacstage` to `backstage `

Co-authored-by: Vincenzo Scamporlino <[email protected]>

Co-authored-by: Vincenzo Scamporlino <[email protected]>
  • Loading branch information
cmoulliard and vinzscam authored Jun 22, 2022
1 parent d6bdd82 commit c758650
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ The command removes all the Kubernetes components associated with the chart and
### Traffic Exposure parameters

| Name | Description | Value |
| ---------------------------------- | ---------------------------------------------------------------- | ----------- |
|------------------------------------|------------------------------------------------------------------|-------------|
| `ingress.enabled` | Enable ingress | `false` |
| `ingress.className` | Name of the IngressClass cluster resource (e.g nginx) | `""` |
| `ingress.annotations` | Additional annotations for the Ingress resource | `{}` |
| `ingress.host` | Hostname of the backstage application (e.g backstage.<IP>.nip.io) | `""` |
| `service.type` | Kubernetes Service type | `ClusterIP` |
| `service.ports.backend` | Port for client connections | `7007` |
| `service.nodePorts.backend` | Node port for client connections | `""` |
Expand Down
34 changes: 34 additions & 0 deletions charts/backstage/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: backstage
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.ingress.annotations }}
{{ include "common.tplvalues.render" ( dict "value" .Values.ingress.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className | quote }}
{{- end }}
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "common.names.fullname" . }}
port:
number: {{ .Values.service.ports.backend }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/backstage/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@ diagnosticMode:
args:
- infinity

## @section Ingress parameters
ingress:
## @param ingress.enabled Enable the creation of the ingress resource
enabled: false

## @param ingress.className Name of the IngressClass cluster resource which defines which controller will implement the resource (e.g nginx)
className: ""

## @param ingress.annotations Additional annotations for the Ingress resource
annotations: '{
"nginx.ingress.kubernetes.io/rewrite-target": "/",
"nginx.ingress.kubernetes.io/ssl-redirect": "false"
}'

## @param host Hostname to be used to expose the route to access the backstage application (e.g: backstage.IP.nip.io)
host: ""

## @section Backstage parameters

## Backstage image version
Expand Down

0 comments on commit c758650

Please sign in to comment.