Skip to content

Commit

Permalink
Merge pull request #5 from nokia/helm-102
Browse files Browse the repository at this point in the history
Helm 102 - Add Namespace
  • Loading branch information
Khushi Jain authored Feb 23, 2024
2 parents 9f56afe + 749ea7f commit da96736
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions deployments/helm/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
.idea/
*.tmproj
.vscode/
.github
12 changes: 12 additions & 0 deletions deployments/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "beyla.namespace" -}}
{{- if .Values.namespaceOverride }}
{{- .Values.namespaceOverride }}
{{- else }}
{{- .Release.Namespace }}
{{- end }}
{{- end }}


{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
2 changes: 1 addition & 1 deletion deployments/helm/templates/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "beyla.fullname" . }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion deployments/helm/templates/cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["list", "watch"]
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions deployments/helm/templates/daemon-set.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ include "beyla.fullname" . }}
namespace: {{ include "beyla.namespace" .}}
labels:
{{- include "beyla.labels" . | nindent 2 }}
{{- with .Values.annotations }}
Expand Down
1 change: 1 addition & 0 deletions deployments/helm/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "beyla.serviceAccountName" . }}
namespace: {{ include "beyla.namespace" .}}
labels:
{{- include "beyla.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.labels }}
Expand Down
3 changes: 3 additions & 0 deletions deployments/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ image:
tag: "main"

imagePullSecrets: []

nameOverride: ""
fullnameOverride: ""
## Override the deployment namespace
namespaceOverride: ""

## DaemonSet annotations
# annotations: {}
Expand Down

0 comments on commit da96736

Please sign in to comment.