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

Refactoring Kubernetes recommanded labels #78

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion charts/quickwit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: quickwit
description: Sub-second search & analytics engine on cloud storage.
type: application
version: 0.5.14
version: 0.5.15
appVersion: "v0.8.1"
keywords:
- quickwit
Expand Down
6 changes: 1 addition & 5 deletions charts/quickwit/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ helm.sh/chart: {{ include "quickwit.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: quickwit
{{ include "quickwit.additionalLabels" . }}
{{- end }}

Expand All @@ -64,39 +65,34 @@ app.kubernetes.io/instance: {{ .Release.Name }}
Searcher Selector labels
*/}}
{{- define "quickwit.searcher.selectorLabels" -}}
{{ include "quickwit.selectorLabels" . }}
guilload marked this conversation as resolved.
Show resolved Hide resolved
app.kubernetes.io/component: searcher
{{- end }}

{{/*
Janitor Selector labels
*/}}
{{- define "quickwit.janitor.selectorLabels" -}}
{{ include "quickwit.selectorLabels" . }}
app.kubernetes.io/component: janitor
{{- end }}

{{/*
Metastore Selector labels
*/}}
{{- define "quickwit.metastore.selectorLabels" -}}
{{ include "quickwit.selectorLabels" . }}
app.kubernetes.io/component: metastore
{{- end }}

{{/*
Control Plane Selector labels
*/}}
{{- define "quickwit.control_plane.selectorLabels" -}}
{{ include "quickwit.selectorLabels" . }}
app.kubernetes.io/component: control-plane
{{- end }}

{{/*
Indexer Selector labels
*/}}
{{- define "quickwit.indexer.selectorLabels" -}}
{{ include "quickwit.selectorLabels" . }}
app.kubernetes.io/component: indexer
{{- end }}

Expand Down
1 change: 1 addition & 0 deletions charts/quickwit/templates/configmap-bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
name: {{ include "quickwit.fullname" . }}-bootstrap
labels:
{{- include "quickwit.labels" . | nindent 4 }}
app.kubernetes.io/component: config
data:
{{- range .Values.config.indexes }}
{{ .index_id }}.yaml: |-
Expand Down
1 change: 1 addition & 0 deletions charts/quickwit/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ include "quickwit.fullname" . }}
labels:
{{- include "quickwit.labels" . | nindent 4 }}
app.kubernetes.io/component: config
data:
node.yaml: |-
version: 0.8
Expand Down
7 changes: 5 additions & 2 deletions charts/quickwit/templates/control-plane-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ kind: Deployment
metadata:
name: {{ include "quickwit.fullname" . }}-control-plane
labels:
{{- include "quickwit.labels" . | nindent 4 }}
{{- include "quickwit.labels" . | nindent 4 }}
{{- include "quickwit.control_plane.selectorLabels" . | nindent 4 }}
annotations:
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
Expand All @@ -15,6 +16,7 @@ spec:
replicas: 1
selector:
matchLabels:
{{- include "quickwit.selectorLabels" . | nindent 6 }}
{{- include "quickwit.control_plane.selectorLabels" . | nindent 6 }}
strategy:
type: Recreate
Expand All @@ -29,8 +31,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "quickwit.additionalLabels" . | nindent 8 }}
{{- include "quickwit.labels" . | nindent 8 }}
{{- include "quickwit.control_plane.selectorLabels" . | nindent 8 }}
{{- include "quickwit.additionalLabels" . | nindent 8 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quickwit.additionalLabels is already part of quickwit.labels

spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
1 change: 1 addition & 0 deletions charts/quickwit/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
name: {{ include "quickwit.fullname" . }}
labels:
{{- include "quickwit.labels" . | nindent 4 }}
app.kubernetes.io/component: metrics
spec:
groups:
- name: {{ include "quickwit.fullname" . }}
Expand Down
1 change: 1 addition & 0 deletions charts/quickwit/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ include "quickwit.fullname" . }}
labels:
{{- include "quickwit.labels" . | nindent 4 }}
app.kubernetes.io/component: secret
type: Opaque
data:
{{- if .Values.config.postgres }}
Expand Down
6 changes: 5 additions & 1 deletion charts/quickwit/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ include "quickwit.fullname" . }}-searcher
labels:
{{- include "quickwit.labels" . | nindent 4 }}
{{- include "quickwit.searcher.selectorLabels" . | nindent 4 }}
annotations:
{{- with .Values.service.annotations }}
{{- toYaml . | nindent 4 }}
Expand Down Expand Up @@ -60,6 +61,7 @@ metadata:
name: {{ include "quickwit.fullname" . }}-indexer
labels:
{{- include "quickwit.labels" . | nindent 4 }}
{{- include "quickwit.indexer.selectorLabels" . | nindent 4 }}
annotations:
{{- with .Values.service.annotations }}
{{- toYaml . | nindent 4 }}
Expand All @@ -86,6 +88,7 @@ metadata:
name: {{ include "quickwit.fullname" . }}-metastore
labels:
{{- include "quickwit.labels" . | nindent 4 }}
{{- include "quickwit.metastore.selectorLabels" . | nindent 4 }}
annotations:
{{- with .Values.service.annotations }}
{{- toYaml . | nindent 4 }}
Expand All @@ -112,6 +115,7 @@ metadata:
name: {{ include "quickwit.fullname" . }}-control-plane
labels:
{{- include "quickwit.labels" . | nindent 4 }}
{{- include "quickwit.control_plane.selectorLabels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -124,14 +128,14 @@ spec:
name: grpc
selector:
{{- include "quickwit.control_plane.selectorLabels" . | nindent 4 }}

---
apiVersion: v1
kind: Service
metadata:
name: {{ include "quickwit.fullname" . }}-janitor
labels:
{{- include "quickwit.labels" . | nindent 4 }}
{{- include "quickwit.janitor.selectorLabels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand Down
3 changes: 2 additions & 1 deletion charts/quickwit/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ kind: ServiceAccount
metadata:
name: {{ include "quickwit.serviceAccountName" . }}
labels:
{{- include "quickwit.labels" . | nindent 4 }}
{{- include "quickwit.labels" . | nindent 4 -}}
guilload marked this conversation as resolved.
Show resolved Hide resolved
app.kubernetes.io/component: rbac
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
1 change: 1 addition & 0 deletions charts/quickwit/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
name: {{ include "quickwit.fullname" . }}
labels:
{{- include "quickwit.labels" . | nindent 4 }}
app.kubernetes.io/component: metrics
spec:
endpoints:
- path: /metrics
Expand Down
Loading