Add support for spire-server ingress (#68)

Co-authored-by: Faisal Memon <[email protected]>
Co-authored-by: Marco Franssen <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
kfox1111
2023-05-23 13:58:58 +00:00
committed by GitHub
co-authored by Faisal Memon Marco Franssen dependabot[bot]
parent 4777a30012
commit 0ba03880a1
12 changed files with 257 additions and 28 deletions
@@ -1,42 +1,16 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "spiffe-oidc-discovery-provider.fullname" . }}
{{- $port := .Values.service.port }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ include "spiffe-oidc-discovery-provider.namespace" . }}
labels:
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
{{ include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ $fullName }}
port:
number: {{ $port }}
{{- end }}
{{- end }}
{{ include "spire-lib.ingress-spec" (dict "ingress" .Values.ingress "svcName" $fullName "port" .Values.service.port "global" .Values.global) | nindent 2 }}
{{- end }}
@@ -73,6 +73,13 @@ A Helm chart to install the SPIRE server.
| federation.bundleEndpoint.address | string | `"0.0.0.0"` | |
| federation.bundleEndpoint.port | int | `8443` | |
| federation.enabled | bool | `false` | |
| federation.ingress.annotations | object | `{}` | |
| federation.ingress.className | string | `""` | |
| federation.ingress.enabled | bool | `false` | |
| federation.ingress.hosts[0].host | string | `"spire-server-federation.example.org"` | |
| federation.ingress.hosts[0].paths[0].path | string | `"/"` | |
| federation.ingress.hosts[0].paths[0].pathType | string | `"Prefix"` | |
| federation.ingress.tls | list | `[]` | |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | The image pull policy |
| image.registry | string | `"ghcr.io"` | The OCI registry to pull the image from |
@@ -80,6 +87,13 @@ A Helm chart to install the SPIRE server.
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
| image.version | string | `""` | This value is deprecated in favor of tag. (Will be removed in a future release) |
| imagePullSecrets | list | `[]` | |
| ingress.annotations | object | `{}` | |
| ingress.className | string | `""` | |
| ingress.enabled | bool | `false` | |
| ingress.hosts[0].host | string | `"spire-server.example.org"` | |
| ingress.hosts[0].paths[0].path | string | `"/"` | |
| ingress.hosts[0].paths[0].pathType | string | `"Prefix"` | |
| ingress.tls | list | `[]` | |
| initContainers | list | `[]` | |
| jwtIssuer | string | `"oidc-discovery.example.org"` | The JWT issuer domain |
| logLevel | string | `"info"` | The log level, valid values are "debug", "info", "warn", and "error" |
@@ -0,0 +1,18 @@
{{- if .Values.federation.enabled }}
{{- if .Values.federation.ingress.enabled -}}
{{- $svcName := include "spire-server.fullname" . }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ printf "%s-federation" $svcName }}
namespace: {{ include "spire-server.namespace" . }}
labels:
{{ include "spire-server.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{ include "spire-lib.ingress-spec" (dict "ingress" .Values.federation.ingress "svcName" $svcName "port" .Values.federation.bundleEndpoint.port "global" .Values.global) | nindent 2 }}
{{- end }}
{{- end }}
@@ -0,0 +1,16 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "spire-server.fullname" . -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ include "spire-server.namespace" . }}
labels:
{{ include "spire-server.labels" . | nindent 4}}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{ include "spire-lib.ingress-spec" (dict "ingress" .Values.ingress "svcName" $fullName "port" .Values.service.port "global" .Values.global) | nindent 2 }}
{{- end }}
@@ -127,6 +127,26 @@ federation:
port: 8443
address: "0.0.0.0"
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
# If Profile Type == https_spiffe:
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"
hosts:
- host: spire-server-federation.example.org
paths:
- path: /
pathType: Prefix
tls: []
# - hosts:
# - spire-server-federation.example.org
# If Profile Type == https_web:
# secretName: spire-server-federation-tls
ca_subject:
country: NL
organization: Example
@@ -247,6 +267,24 @@ telemetry:
namespace: ""
labels: {}
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"
hosts:
- host: spire-server.example.org
paths:
- path: /
pathType: Prefix
tls: []
# - secretName: spire-server-tls
# hosts:
# - spire-server.example.org
extraVolumes: []
extraVolumeMounts: []
extraContainers: []