Skip to content

Commit

Permalink
TIl service name override (#207)
Browse files Browse the repository at this point in the history
* TIl service name override

* Update helm documentation

* Update helm documentation

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
pulledtim and github-actions[bot] authored Sep 26, 2023
1 parent 64e8b97 commit 04e9ba6
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/trusted-issuers-list/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: trusted-issuers-list
version: 0.3.5
version: 0.5.0
appVersion: 0.0.2
description: A Helm chart for running the trusted-issuers-list on kubernetes.
icon: https://fiware.github.io/catalogue/img/fiware.png
Expand Down
3 changes: 2 additions & 1 deletion charts/trusted-issuers-list/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# trusted-issuers-list

![Version: 0.3.5](https://img.shields.io/badge/Version-0.3.5-informational?style=flat-square) ![AppVersion: 0.0.2](https://img.shields.io/badge/AppVersion-0.0.2-informational?style=flat-square)
![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square) ![AppVersion: 0.0.2](https://img.shields.io/badge/AppVersion-0.0.2-informational?style=flat-square)

A Helm chart for running the trusted-issuers-list on kubernetes.

Expand Down Expand Up @@ -84,6 +84,7 @@ A Helm chart for running the trusted-issuers-list on kubernetes.
| route.tir.tls | object | `{}` | tls configuration for the route |
| service.annotations | object | `{}` | additional annotations, if required |
| service.port | int | `8080` | port to be used by the service |
| service.serviceNameOverride | string | `""` | define the name of the service and avoid generating one |
| service.type | string | `"ClusterIP"` | service type |
| serviceAccount | object | `{"create":false}` | if a til specific service account should be used, it can be configured here ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ |
| serviceAccount.create | bool | `false` | specifies if the account should be created |
Expand Down
11 changes: 11 additions & 0 deletions charts/trusted-issuers-list/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ Create the name of the service account to use
{{- end -}}
{{- end -}}

{{/*
Create the name of the service
*/}}
{{- define "til.serviceName" -}}
{{- if .Values.service.serviceNameOverride -}}
{{- .Values.service.serviceNameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{ include "til.fullname" . }}
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/trusted-issuers-list/templates/route-til.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
path: /issuer
to:
kind: Service
name: {{ $fullName }}
name: {{ include "til.serviceName" . }}
{{- if .Values.route.til.tls }}
tls:
{{- with .Values.route.til.tls }}
Expand Down
2 changes: 1 addition & 1 deletion charts/trusted-issuers-list/templates/route-tir.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
path: /v4/issuers
to:
kind: Service
name: {{ $fullName }}
name: {{ include "til.serviceName" . }}
{{- if .Values.route.tir.tls }}
tls:
{{- with .Values.route.tir.tls }}
Expand Down
2 changes: 1 addition & 1 deletion charts/trusted-issuers-list/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "til.fullname" . }}
name: {{ include "til.serviceName" . }}
{{- if .Values.service.annotations }}
annotations:
{{ toYaml .Values.service.annotations | nindent 4 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/trusted-issuers-list/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ service:
port: 8080
# -- additional annotations, if required
annotations: {}
# -- define the name of the service and avoid generating one
serviceNameOverride: ""

# -- if a til specific service account should be used, it can be configured here
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
Expand Down

0 comments on commit 04e9ba6

Please sign in to comment.