Skip to content

Commit

Permalink
support ingress class_name customization
Browse files Browse the repository at this point in the history
  • Loading branch information
jmazzitelli committed Oct 29, 2021
1 parent 6726500 commit fd96a3c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
15 changes: 15 additions & 0 deletions kiali-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,21 @@ Determine the default identity private key file. There is no default if on k8s;
{{- end }}
{{- end }}

{{/*
Determine the default deployment.ingress.enabled. Disable it on k8s; enable it on OpenShift.
*/}}
{{- define "kiali-server.deployment.ingress.enabled" -}}
{{- if hasKey .Values.deployment.ingress "enabled" }}
{{- .Values.deployment.ingress.enabled }}
{{- else }}
{{- if .Capabilities.APIVersions.Has "route.openshift.io/v1" }}
{{- true }}
{{- else }}
{{- false }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Determine the istio namespace - default is where Kiali is installed.
*/}}
Expand Down
13 changes: 8 additions & 5 deletions kiali-server/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if not (.Capabilities.APIVersions.Has "route.openshift.io/v1") }}
{{- if .Values.deployment.ingress_enabled }}
{{- if eq "true" (include "kiali-server.deployment.ingress.enabled" .) }}
---
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
apiVersion: networking.k8s.io/v1
Expand All @@ -13,8 +13,8 @@ metadata:
labels:
{{- include "kiali-server.labels" . | nindent 4 }}
annotations:
{{- if hasKey .Values.deployment.override_ingress_yaml.metadata "annotations" }}
{{- toYaml .Values.deployment.override_ingress_yaml.metadata.annotations | nindent 4 }}
{{- if hasKey .Values.deployment.ingress.override_yaml.metadata "annotations" }}
{{- toYaml .Values.deployment.ingress.override_yaml.metadata.annotations | nindent 4 }}
{{- else }}
# For ingress-nginx versions older than 0.20.0 use secure-backends.
# (see: https://github.com/kubernetes/ingress-nginx/issues/3416#issuecomment-438247948)
Expand All @@ -28,9 +28,12 @@ metadata:
{{- end }}
{{- end }}
spec:
{{- if hasKey .Values.deployment.override_ingress_yaml "spec" }}
{{- toYaml .Values.deployment.override_ingress_yaml.spec | nindent 2 }}
{{- if hasKey .Values.deployment.ingress.override_yaml "spec" }}
{{- toYaml .Values.deployment.ingress.override_yaml.spec | nindent 2 }}
{{- else }}
{{- if .Values.deployment.ingress.class_name }}
ingressClassName: {{ .Values.deployment.ingress.class_name }}
{{- end }}
rules:
- http:
paths:
Expand Down
8 changes: 5 additions & 3 deletions kiali-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ deployment:
image_pull_policy: "Always"
image_pull_secrets: []
image_version: ${HELM_IMAGE_TAG} # version like "v1.39" (see: https://quay.io/repository/kiali/kiali?tab=tags) or a digest hash
ingress_enabled: true
ingress:
class_name: "nginx"
#enabled:
override_yaml:
metadata: {}
instance_name: "kiali"
logger:
log_format: "text"
log_level: "info"
time_field_format: "2006-01-02T15:04:05Z07:00"
sampler_rate: "1"
node_selector: {}
override_ingress_yaml:
metadata: {}
pod_annotations: {}
pod_labels: {}
priority_class_name: ""
Expand Down

0 comments on commit fd96a3c

Please sign in to comment.