This repository has been archived by the owner on Mar 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for spire-server ingress (#68)
Co-authored-by: Faisal Memon <fymemon@yahoo.com> Co-authored-by: Marco Franssen <marco.franssen@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4777a30
commit 0ba0388
Showing
12 changed files
with
257 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 2 additions & 28 deletions
30
charts/spire/charts/spiffe-oidc-discovery-provider/templates/ingress.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
charts/spire/charts/spire-server/templates/federation-ingress.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
examples/production/values-export-federation-https-spiffe-ingress-nginx.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
spire-server: | ||
federation: | ||
enabled: true | ||
ingress: | ||
enabled: true | ||
annotations: | ||
nginx.ingress.kubernetes.io/ssl-redirect: "true" | ||
nginx.ingress.kubernetes.io/force-ssl-redirect: "true" | ||
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" | ||
nginx.ingress.kubernetes.io/ssl-passthrough: "true" | ||
|
||
# Optional settings you may put in your own values. | ||
# kubernetes.io/ingress.class: nginx | ||
# kubernetes.io/tls-acme: "true" | ||
|
||
# className: nginx | ||
|
||
hosts: | ||
- host: spire-server-federation.example.org | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
tls: | ||
- hosts: | ||
- spire-server-federation.example.org |
25 changes: 25 additions & 0 deletions
25
examples/production/values-export-federation-https-web-ingress-nginx.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
spire-server: | ||
federation: | ||
enabled: true | ||
ingress: | ||
enabled: true | ||
annotations: | ||
nginx.ingress.kubernetes.io/ssl-redirect: "true" | ||
nginx.ingress.kubernetes.io/force-ssl-redirect: "true" | ||
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" | ||
|
||
# Optional settings you may put in your own values. | ||
# kubernetes.io/ingress.class: nginx | ||
# kubernetes.io/tls-acme: "true" | ||
|
||
# className: nginx | ||
|
||
hosts: | ||
- host: spire-server-federation.example.org | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
tls: | ||
- hosts: | ||
- spire-server-federation.example.org | ||
secretName: spire-server-federation-tls |
25 changes: 25 additions & 0 deletions
25
examples/production/values-export-spire-server-ingress-nginx.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
spire-server: | ||
ingress: | ||
enabled: true | ||
annotations: | ||
nginx.ingress.kubernetes.io/ssl-redirect: "true" | ||
nginx.ingress.kubernetes.io/force-ssl-redirect: "true" | ||
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" | ||
nginx.ingress.kubernetes.io/ssl-passthrough: "true" | ||
|
||
# Optional settings you may put in your own values. | ||
# kubernetes.io/tls-acme: "true" | ||
# kubernetes.io/ingress.class: nginx | ||
|
||
# className: nginx | ||
|
||
# You must override these in your own values file with the appropriate hostname | ||
# and secret or it wont start. | ||
hosts: | ||
- host: spire-server.example.org | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
tls: | ||
- hosts: | ||
- spire-server.example.org |