-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ingress feature for nopo11y-stack (#23)
* Added istio common ingress helm chart * Removed nopo11y-health-check ingress, added it in nopo11y-ingress * Updated chart version to 1.4.0 from 1.3.1 * Updated max item limit to 500 from 20 * Added helper function to get service name, path and port of all nopo11y component * Added nopo11y_ingress values and removed nopo11y health check ingress option * Added istio and nginx ingress config for nopo11y component access * Removed istio-common-ingress * Updated the description for the ingress values * Added indentation * Changed default ingress type to istio * Updated logic for kiali path * Added double qoute for ingress type * Corrected istio gateway api version
- Loading branch information
1 parent
b5956a3
commit b81246a
Showing
10 changed files
with
289 additions
and
34 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
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 was deleted.
Oops, something went wrong.
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,37 @@ | ||
{{- if and (.Values.nopo11y_ingress.enabled) (eq .Values.nopo11y_ingress.type "istio") }} | ||
{{- if gt (len (include "nopo11y.services" . |fromJsonArray)) 0 }} | ||
{{- if and (.Values.nopo11y_ingress.tls.enabled) (not .Values.nopo11y_ingress.host) }} | ||
{{- fail "if nopo11y_ingress tls is enabled then host is required host can not be empty" }} | ||
{{- end }} | ||
apiVersion: networking.istio.io/v1beta1 | ||
kind: Gateway | ||
metadata: | ||
name: {{ .Release.Name }}-gateway | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
selector: | ||
{{- toYaml .Values.nopo11y_ingress.istioGatewaySelector |nindent 4 }} | ||
servers: | ||
- port: | ||
{{- if $.Values.nopo11y_ingress.tls.enabled }} | ||
number: 443 | ||
name: https | ||
protocol: HTTPS | ||
{{- else }} | ||
number: 80 | ||
name: http | ||
protocol: HTTP | ||
{{- end }} | ||
hosts: | ||
{{- if .Values.nopo11y_ingress.host }} | ||
- {{ .Values.nopo11y_ingress.host |quote }} | ||
{{- else }} | ||
- "*" | ||
{{- end }} | ||
{{- if .Values.nopo11y_ingress.tls.enabled }} | ||
tls: | ||
mode: SIMPLE | ||
credentialName: {{ $.Release.Name }}-{{ $.Release.Namespace }}-tls-secret | ||
{{- end }} | ||
{{- 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,20 @@ | ||
{{- if and (.Values.nopo11y_ingress.enabled) (eq .Values.nopo11y_ingress.type "istio") }} | ||
{{- if .Values.nopo11y_ingress.tls.enabled }} | ||
{{- if gt (len (include "nopo11y.services" . |fromJsonArray)) 0 }} | ||
{{- if or (not .Values.nopo11y_ingress.tls.tlsKey) (not .Values.nopo11y_ingress.tls.tlsCert) }} | ||
{{- fail "If tls is enaled for nopo11y_ingress then tls.tlsKey and tls.tlsCert can not be empyt" }} | ||
{{- end }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ .Release.Name }}-{{ .Release.Namespace }}-tls-secret | ||
namespace: {{ .Values.nopo11y_ingress.istioNamespace }} | ||
type: kubernetes.io/tls | ||
data: | ||
tls.crt: | | ||
{{ .Values.nopo11y_ingress.tls.tlsCert }} | ||
tls.key: | | ||
{{ .Values.nopo11y_ingress.tls.tlsKey }} | ||
{{- end }} | ||
{{- 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,33 @@ | ||
{{- if and (.Values.nopo11y_ingress.enabled) (eq .Values.nopo11y_ingress.type "istio") }} | ||
{{- if gt (len (include "nopo11y.services" . |fromJsonArray)) 0 }} | ||
apiVersion: networking.istio.io/v1beta1 | ||
kind: VirtualService | ||
metadata: | ||
name: {{ .Release.Name }}-vs | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
hosts: | ||
{{- if .Values.nopo11y_ingress.host }} | ||
- {{ .Values.nopo11y_ingress.host |quote }} | ||
{{- else }} | ||
- "*" | ||
{{- end }} | ||
gateways: | ||
- {{ $.Release.Name }}-gateway | ||
http: | ||
{{- range (include "nopo11y.services" . |fromJsonArray) }} | ||
- match: | ||
- uri: | ||
prefix: {{ .path }} | ||
{{- if hasKey . "rewritePath"}} | ||
rewrite: | ||
uri: {{ .rewritePath }} | ||
{{- end }} | ||
route: | ||
- destination: | ||
host: {{ .name }} | ||
port: | ||
number: {{ .port }} | ||
{{- end }} | ||
{{- 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,56 @@ | ||
{{- if and (.Values.nopo11y_ingress.enabled) (eq .Values.nopo11y_ingress.type "nginx") }} | ||
{{- if gt (len (include "nopo11y.services" . |fromJsonArray)) 0 }} | ||
{{- if and (.Values.nopo11y_ingress.tls.enabled) (not .Values.nopo11y_ingress.host) }} | ||
{{- fail "if nopo11y_ingress tls is enabled host is required host can not be empty" }} | ||
{{- end }} | ||
{{- range (include "nopo11y.services" . |fromJsonArray) }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ .name }}-ingress | ||
namespace: {{ $.Release.Namespace }} | ||
{{- if hasKey . "rewritePath" }} | ||
{{- if contains "nopo11y-health-check" .path }} | ||
annotations: | ||
kubernetes.io/ingress.class: nginx | ||
nginx.ingress.kubernetes.io/rewrite-target: / | ||
nginx.ingress.kubernetes.io/add-base-url : "true" | ||
{{- end }} | ||
{{- else }} | ||
annotations: | ||
nginx.ingress.kubernetes.io/rewrite-target: /$1$2 | ||
nginx.ingress.kubernetes.io/ssl-redirect: "false" | ||
nginx.ingress.kubernetes.io/use-regex: "true" | ||
{{- end }} | ||
spec: | ||
{{- if $.Values.nopo11y_ingress.tls.enabled }} | ||
tls: | ||
- hosts: | ||
- {{ $.Values.nopo11y_ingress.host |quote }} | ||
secretName: {{ $.Release.Name }}-{{ $.Release.Namespace }}-tls-secret | ||
{{- end }} | ||
ingressClassName: nginx | ||
rules: | ||
{{- if $.Values.nopo11y_ingress.host }} | ||
- host: {{ $.Values.nopo11y_ingress.host }} | ||
http: | ||
{{- else }} | ||
- http: | ||
{{- end }} | ||
paths: | ||
{{- $path:= (trimPrefix "/" .path) }} | ||
{{- if contains "nopo11y-health-check" .path }} | ||
- path: {{ .path }} | ||
{{- else }} | ||
- path: "/({{ $path }})(/.*){0,}" | ||
{{- end }} | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ .name }} | ||
port: | ||
number: {{ .port }} | ||
--- | ||
{{- end }} | ||
{{- 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,20 @@ | ||
{{- if and (.Values.nopo11y_ingress.enabled) (eq .Values.nopo11y_ingress.type "nginx") }} | ||
{{- if gt (len (include "nopo11y.services" . |fromJsonArray)) 0 }} | ||
{{- if .Values.nopo11y_ingress.tls.enabled }} | ||
{{- if or (not .Values.nopo11y_ingress.tls.tlsKey) (not .Values.nopo11y_ingress.tls.tlsCert) }} | ||
{{- fail "If tls is enaled for nopo11y_ingress then tls.tlsKey and tls.tlsCert can not be empyt" }} | ||
{{- end }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ .Release.Name }}-{{ .Release.Namespace }}-tls-secret | ||
namespace: {{ .Release.Namespace }} | ||
type: kubernetes.io/tls | ||
data: | ||
tls.crt: | | ||
{{ .Values.nopo11y_ingress.tls.tlsCert }} | ||
tls.key: | | ||
{{ .Values.nopo11y_ingress.tls.tlsKey }} | ||
{{- end }} | ||
{{- 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