Skip to content

Commit

Permalink
Update: use core and ui labels.
Browse files Browse the repository at this point in the history
- Use the recommanded label app.kubernetes.io/component for Core and UI
resources.
- Fix: UI Rbac and secrets resources only generate when webui.enabled is
  true

Signed-off-by: Nicolas Lamirault <[email protected]>
  • Loading branch information
nlamirault authored and mmadoo committed Dec 18, 2023
1 parent 3732f87 commit 8aa2670
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 43 deletions.
28 changes: 12 additions & 16 deletions charts/falcosidekick/templates/deployment-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,22 @@ metadata:
name: {{ include "falcosidekick.fullname" . }}-ui
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui
helm.sh/chart: {{ include "falcosidekick.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}-ui
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "falcosidekick.labels" . | nindent 4 }}
app.kubernetes.io/component: ui
spec:
replicas: {{ .Values.webui.replicaCount }}
{{- if .Values.webui.revisionHistoryLimit }}
revisionHistoryLimit: {{ .Values.webui.revisionHistoryLimit }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui
app.kubernetes.io/instance: {{ .Release.Name }}-ui
{{- include "falcosidekick.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: ui
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui
app.kubernetes.io/instance: {{ .Release.Name }}-ui
{{- include "falcosidekick.labels" . | nindent 8 }}
app.kubernetes.io/component: ui
{{- if .Values.webui.podLabels }}
{{ toYaml .Values.webui.podLabels | indent 8 }}
{{- end }}
Expand Down Expand Up @@ -125,22 +123,20 @@ metadata:
name: {{ include "falcosidekick.fullname" . }}-ui-redis
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui-redis
helm.sh/chart: {{ include "falcosidekick.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}-ui
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "falcosidekick.labels" . | nindent 4 }}
app.kubernetes.io/component: ui-redis
spec:
replicas: 1
serviceName: {{ include "falcosidekick.fullname" . }}-ui-redis
selector:
matchLabels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui-redis
app.kubernetes.io/instance: {{ .Release.Name }}-ui-redis
{{- include "falcosidekick.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: ui-redis
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui-redis
app.kubernetes.io/instance: {{ .Release.Name }}-ui-redis
{{- include "falcosidekick.labels" . | nindent 8 }}
app.kubernetes.io/component: ui-redis
{{- if .Values.webui.redis.podLabels }}
{{ toYaml .Values.webui.redis.podLabels | indent 8 }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/falcosidekick/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "falcosidekick.labels" . | nindent 4 }}
app.kubernetes.io/component: core
spec:
replicas: {{ .Values.replicaCount }}
{{- if .Values.revisionHistoryLimit }}
Expand All @@ -14,10 +15,12 @@ spec:
selector:
matchLabels:
{{- include "falcosidekick.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: core
template:
metadata:
labels:
{{- include "falcosidekick.labels" . | nindent 8 }}
app.kubernetes.io/component: core
{{- if and .Values.config.azure.podIdentityClientID .Values.config.azure.podIdentityName }}
aadpodidbinding: {{ include "falcosidekick.fullname" . }}
{{- end }}
Expand Down
6 changes: 2 additions & 4 deletions charts/falcosidekick/templates/ingress-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ metadata:
name: {{ $fullName }}-ui
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui
helm.sh/chart: {{ include "falcosidekick.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}-ui
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "falcosidekick.labels" . | nindent 4 }}
app.kubernetes.io/component: ui
{{- with .Values.webui.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/falcosidekick/templates/rbac-ui.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webui.enabled -}}
---
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -33,3 +34,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ include "falcosidekick.fullname" . }}-ui
{{- end }}
14 changes: 6 additions & 8 deletions charts/falcosidekick/templates/secrets-ui.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webui.enabled -}}
{{- if eq .Values.webui.existingSecret "" }}
---
apiVersion: v1
Expand All @@ -6,10 +7,8 @@ metadata:
name: {{ include "falcosidekick.fullname" . }}-ui
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui
helm.sh/chart: {{ include "falcosidekick.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "falcosidekick.labels" . | nindent 4 }}
app.kubernetes.io/component: ui
type: Opaque
data:
{{- if .Values.webui.user }}
Expand All @@ -27,13 +26,12 @@ metadata:
name: {{ include "falcosidekick.fullname" . }}-ui-redis
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui
helm.sh/chart: {{ include "falcosidekick.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "falcosidekick.labels" . | nindent 4 }}
app.kubernetes.io/component: ui
type: Opaque
data:
{{- if .Values.webui.redis.password }}
REDIS_ARGS: "{{ printf "--requirepass %s" .Values.webui.redis.password | b64enc}}"
{{- end }}
{{- end }}
{{- end }}
20 changes: 8 additions & 12 deletions charts/falcosidekick/templates/service-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ metadata:
name: {{ include "falcosidekick.fullname" . }}-ui
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui
helm.sh/chart: {{ include "falcosidekick.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}-ui
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "falcosidekick.labels" . | nindent 4 }}
app.kubernetes.io/component: ui
{{- with .Values.webui.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -25,8 +23,8 @@ spec:
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui
app.kubernetes.io/instance: {{ .Release.Name }}-ui
{{- include "falcosidekick.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: ui
{{- if .Values.webui.redis.enabled }}
---
apiVersion: v1
Expand All @@ -35,10 +33,8 @@ metadata:
name: {{ include "falcosidekick.fullname" . }}-ui-redis
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui-redis
helm.sh/chart: {{ include "falcosidekick.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}-ui
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- include "falcosidekick.labels" . | nindent 4 }}
app.kubernetes.io/component: ui
{{- with .Values.webui.redis.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -51,7 +47,7 @@ spec:
protocol: TCP
name: redis
selector:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}-ui-redis
app.kubernetes.io/instance: {{ .Release.Name }}-ui-redis
{{- include "falcosidekick.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: ui-redis
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/falcosidekick/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ spec:
protocol: TCP
name: http-notls
{{- end }}

selector:
{{- include "falcosidekick.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: core
3 changes: 1 addition & 2 deletions charts/falcosidekick/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ spec:
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "falcosidekick.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- include "falcosidekick.selectorLabels" . | nindent 6 }}
{{- end }}

0 comments on commit 8aa2670

Please sign in to comment.