-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: adjust mo-ob-opensource/sa/mo-ob-opensource-kube-state-metrics…
… creation (#26) ## What type of PR is this? * [ ] Feature * [x] BUG * [ ] Alerts * [ ] Improvement * [ ] Documentation * [ ] Test and CI ## Which issue(s) this PR related: issue #matrixorigin/MO-Cloud#4464 prepare pr: #25 ## What this PR does / why we need it: 解决 mo-ob-opensource 1.0.8 新建 serviceaccount.yaml 的适配问题
- Loading branch information
Showing
3 changed files
with
68 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "mo-ob-opensource.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts | ||
*/}} | ||
{{- define "mo-ob-opensource.namespace" -}} | ||
{{- if .Values.namespaceOverride -}} | ||
{{- .Values.namespaceOverride -}} | ||
{{- else -}} | ||
{{- .Release.Namespace -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "mo-ob-opensource.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Generate basic labels | ||
*/}} | ||
{{- define "mo-ob-opensource.labels" }} | ||
helm.sh/chart: {{ template "mo-ob-opensource.chart" . }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/component: metrics | ||
app.kubernetes.io/part-of: {{ template "mo-ob-opensource.name" . }} | ||
{{- include "mo-ob-opensource.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
{{- if .Values.customLabels }} | ||
{{ toYaml .Values.customLabels }} | ||
{{- end }} | ||
{{- if .Values.releaseLabel }} | ||
release: {{ .Release.Name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "mo-ob-opensource.selectorLabels" }} | ||
{{- if .Values.selectorOverride }} | ||
{{ toYaml .Values.selectorOverride }} | ||
{{- else }} | ||
app.kubernetes.io/name: {{ include "mo-ob-opensource.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- 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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
{{- if not .Values.serviceAccount.kubeStateMetrics.create -}} | ||
{{- if .Values.serviceAccount.kubeStateMetrics.handle -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ default "mo-ob-opensource-kube-state-metrics" .Values.serviceAccount.kubeStateMetrics.name }} | ||
namespace: {{ .Release.Name }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "mo-ob-opensource.labels" . | indent 4 }} | ||
{{- 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