diff --git a/README.md b/README.md index af12a43..b543724 100644 --- a/README.md +++ b/README.md @@ -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..nip.io) | `""` | | `service.type` | Kubernetes Service type | `ClusterIP` | | `service.ports.backend` | Port for client connections | `7007` | | `service.nodePorts.backend` | Node port for client connections | `""` | diff --git a/charts/backstage/templates/ingress.yaml b/charts/backstage/templates/ingress.yaml new file mode 100644 index 0000000..d8e6640 --- /dev/null +++ b/charts/backstage/templates/ingress.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/backstage/values.yaml b/charts/backstage/values.yaml index 0ec52fd..5b69214 100644 --- a/charts/backstage/values.yaml +++ b/charts/backstage/values.yaml @@ -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