Skip to content

Commit

Permalink
Merge pull request #5 from nlamirault/feat/labels
Browse files Browse the repository at this point in the history
Refactoring labels
  • Loading branch information
patcher9 authored Jul 21, 2024
2 parents 0779d75 + 75cc4c3 commit f72342c
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 5 deletions.
4 changes: 2 additions & 2 deletions charts/openlit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: openlit
description: A Helm chart for OpenLIT
type: application
version: 1.1.0
appVersion: 1.2.0
version: 1.2.0
appVersion: 1.6.0
icon: https://avatars.githubusercontent.com/u/149867240?s=200&v=4

maintainers:
Expand Down
4 changes: 4 additions & 0 deletions charts/openlit/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ helm.sh/chart: {{ include "openlit.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: openlit
{{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels }}
{{- end }}
{{- end }}

{{/*
Expand Down
16 changes: 15 additions & 1 deletion charts/openlit/templates/clickhouse.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: {{ .Release.Name }}-db
{{- include "openlit.labels" . | nindent 4 }}
app.kubernetes.io/component: database
name: {{ .Release.Name }}-db
namespace: {{ .Release.Namespace }}
spec:
Expand All @@ -9,10 +13,14 @@ spec:
selector:
matchLabels:
app: {{ .Release.Name }}-db
{{- include "openlit.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: database
template:
metadata:
labels:
app: {{ .Release.Name }}-db
{{- include "openlit.labels" . | nindent 8 }}
app.kubernetes.io/component: database
spec:
terminationGracePeriodSeconds: 10
containers:
Expand Down Expand Up @@ -59,6 +67,10 @@ spec:
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ .Release.Name }}-db
{{- include "openlit.labels" . | nindent 4 }}
app.kubernetes.io/component: database
name: {{ .Release.Name }}-db
spec:
ports:
Expand All @@ -70,4 +82,6 @@ spec:
name: http
type: {{ .Values.clickhouse.service.type }}
selector:
app: {{ .Release.Name }}-db
app: {{ .Release.Name }}-db
{{- include "openlit.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: database
15 changes: 14 additions & 1 deletion charts/openlit/templates/client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ metadata:
name: openlit-collector-config
labels:
app: {{ include "openlit.fullname" . }}
component: opentelemetry-collector
{{- include "openlit.labels" . | nindent 4 }}
app.kubernetes.io/component: opentelemetry-collector
data:
opentelemetry-collector-config: |
receivers:
Expand Down Expand Up @@ -58,6 +59,10 @@ data:
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: {{ include "openlit.fullname" . }}
{{- include "openlit.labels" . | nindent 4 }}
app.kubernetes.io/component: openlit
name: {{ include "openlit.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
Expand All @@ -66,10 +71,14 @@ spec:
selector:
matchLabels:
app: {{ include "openlit.fullname" . }}
{{- include "openlit.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: openlit
template:
metadata:
labels:
app: {{ include "openlit.fullname" . }}
{{- include "openlit.labels" . | nindent 8 }}
app.kubernetes.io/component: openlit
spec:
containers:
- name: openlit
Expand Down Expand Up @@ -174,6 +183,8 @@ metadata:
name: {{ include "openlit.fullname" . }}
labels:
app: {{ include "openlit.fullname" . }}
{{- include "openlit.labels" . | nindent 4 }}
app.kubernetes.io/component: openlit
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -188,4 +199,6 @@ spec:
targetPort: 4318
selector:
app: {{ include "openlit.fullname" . }}
{{- include "openlit.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: openlit
sessionAffinity: {{ .Values.service.sessionAffinity }}
4 changes: 3 additions & 1 deletion charts/openlit/templates/ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "test.labels" . | nindent 4 }}
app: {{ include "openlit.fullname" . }}
{{- include "openlit.labels" . | nindent 4 }}
app.kubernetes.io/component: networking
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/openlit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ nameOverride: ""
# Overrides the default fullname for the release.
fullnameOverride: ""

# Additional labels to add to all resources.
additionalLabels: {}
# my-label: my-value

# Number of replicas
replicaCount: 1

Expand Down

0 comments on commit f72342c

Please sign in to comment.