Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[helm] set app.kubernetes.io/instance label appropriately, define the new deployment.instance_name value #75

Merged
merged 2 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 10 additions & 20 deletions kiali-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
{{/* vim: set filetype=mustache: */}}

{{/*
Expand the name of the chart.
*/}}
{{- define "kiali-server.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
Create a default fully qualified instance name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
To simulate the way the operator works, use deployment.instance_name rather than the old fullnameOverride.
For backwards compatibility, if fullnameOverride is not kiali but deployment.instance_name is kiali,
use fullnameOverride, otherwise use deployment.instance_name.
*/}}
{{- define "kiali-server.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- if (and (eq .Values.deployment.instance_name "kiali") (ne .Values.fullnameOverride "kiali")) }}
{{- .Values.fullnameOverride | trunc 63 }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- .Values.deployment.instance_name | trunc 63 }}
{{- end }}
{{- end }}

Expand All @@ -48,7 +38,7 @@ Common labels
*/}}
{{- define "kiali-server.labels" -}}
helm.sh/chart: {{ include "kiali-server.chart" . }}
app: {{ include "kiali-server.name" . }}
app: kiali
{{ include "kiali-server.selectorLabels" . }}
version: {{ .Values.deployment.version_label | default .Chart.AppVersion | quote }}
app.kubernetes.io/version: {{ .Values.deployment.version_label | default .Chart.AppVersion | quote }}
Expand All @@ -60,8 +50,8 @@ app.kubernetes.io/part-of: "kiali"
Selector labels
*/}}
{{- define "kiali-server.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kiali-server.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: kiali
app.kubernetes.io/instance: {{ include "kiali-server.fullname" . }}
{{- end }}

{{/*
Expand Down
1 change: 1 addition & 0 deletions kiali-server/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ data:
{{- $_ := set $cm "istio_namespace" (include "kiali-server.istio_namespace" .) }}
{{- $_ := set $cm.auth "strategy" (include "kiali-server.auth.strategy" .) }}
{{- $_ := set $cm.auth.openshift "client_id_prefix" (include "kiali-server.fullname" .) }}
{{- $_ := set $cm.deployment "instance_name" (include "kiali-server.fullname" .) }}
{{- $_ := set $cm.identity "cert_file" (include "kiali-server.identity.cert_file" .) }}
{{- $_ := set $cm.identity "private_key_file" (include "kiali-server.identity.private_key_file" .) }}
{{- $_ := set $cm.login_token "signing_key" (include "kiali-server.login_token.signing_key" .) }}
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/envoy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: envoy
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/go.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: go
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/kiali.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: kiali
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: micrometer-1.0.6-jvm-pool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: micrometer-1.0.6-jvm
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/micrometer-1.1-jvm.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: micrometer-1.1-jvm
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/microprofile-1.1.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: microprofile-1.1
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/microprofile-x.y.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: microprofile-x.y
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/nodejs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: nodejs
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/quarkus.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: quarkus
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/springboot-jvm-pool.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: springboot-jvm-pool
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/springboot-jvm.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: springboot-jvm
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/springboot-tomcat.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: springboot-tomcat
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/thorntail.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: thorntail
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/tomcat.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: tomcat
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/vertx-client.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: vertx-client
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/vertx-eventbus.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: vertx-eventbus
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/vertx-jvm.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: vertx-jvm
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/vertx-pool.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: vertx-pool
Expand Down
2 changes: 1 addition & 1 deletion kiali-server/templates/dashboards/vertx-server.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if (include "kiali-server.isDashboardEnabled" .) }}
---
apiVersion: "monitoring.kiali.io/v1alpha1"
apiVersion: monitoring.kiali.io/v1alpha1
kind: MonitoringDashboard
metadata:
name: vertx-server
Expand Down
7 changes: 6 additions & 1 deletion kiali-server/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
nameOverride: "kiali"
# 'fullnameOverride' is deprecated. Use 'deployment.instance_name' instead.
# This is only supported for backward compatibility and will be removed in a future version.
# If 'fullnameOverride' is not "kiali" and 'deployment.instance_name' is "kiali",
# then 'deployment.instance_name' will take the value of 'fullnameOverride' value.
# Otherwise, 'fullnameOverride' is ignored and 'deployment.instance_name' is used.
fullnameOverride: "kiali"

# This is required for "openshift" auth strategy.
Expand Down Expand Up @@ -42,6 +46,7 @@ deployment:
image_pull_secrets: []
image_version: ${HELM_IMAGE_TAG}
ingress_enabled: true
instance_name: "kiali"
logger:
log_format: "text"
log_level: "info"
Expand Down