Skip to content

Commit 24ea3e7

Browse files
authored
fix: helm Chart erros + hard coding (#159)
Still hardcoding namespace because the application cannot use another namespaces . it resolves #158 Special thanks to @abdennour for this helpful contribution! ---------- Co-authored-by: @ciroque
1 parent 537b14a commit 24ea3e7

File tree

10 files changed

+26
-23
lines changed

10 files changed

+26
-23
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text eol=lf
2+
3+
*.png binary

charts/nlk/Chart.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
apiVersion: v2
23
appVersion: 0.1.0
34
description: NGINX LoadBalancer for Kubernetes
@@ -10,7 +11,9 @@ keywords:
1011
- ingress
1112
kubeVersion: '>= 1.22.0-0'
1213
maintainers:
13-
name: "@ciroque"
14-
name: "@chrisakker"
14+
- name: "@ciroque"
15+
- name: "@chrisakker"
16+
- name: "@abdennour"
17+
1518
type: application
1619
version: 0.0.1

charts/nlk/templates/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ Expand image name.
9999
*/}}
100100
{{- define "nlk.image" -}}
101101
{{- if .Values.nlk.image.digest -}}
102-
{{- printf "%s@%s" .Values.nlk.image.repository .Values.nlk.image.digest -}}
102+
{{- printf "%s/%s@%s" .Values.nlk.image.registry .Values.nlk.image.repository .Values.nlk.image.digest -}}
103103
{{- else -}}
104-
{{- printf "%s:%s" .Values.nlk.image.repository (include "nlk.tag" .) -}}
104+
{{- printf "%s/%s:%s" .Values.nlk.image.registry .Values.nlk.image.repository (include "nlk.tag" .) -}}
105105
{{- end -}}
106106
{{- end -}}
107107

charts/nlk/templates/clusterrole.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
name: resource-get-watch-list
6-
namespace: nlk
5+
name: {{ .Release.Namespace }}-{{ include "nlk.fullname" . }}
76
rules:
87
- apiGroups:
98
- ""

charts/nlk/templates/clusterrolebinding.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRoleBinding
44
metadata:
5-
name: "nginx-loadbalancer-kubernetes:resource-get-watch-list"
6-
namespace: nlk
5+
name: {{ .Release.Namespace }}-{{ include "nlk.fullname" . }}
76
subjects:
87
- kind: ServiceAccount
9-
name: {{ .Values.nlk.serviceAccount.name }}
8+
name: {{ include "nlk.fullname" . }}
109
namespace: nlk
1110
roleRef:
1211
kind: ClusterRole
13-
name: resource-get-watch-list
12+
name: {{ .Release.Namespace }}-{{ include "nlk.fullname" . }}
1413
apiGroup: rbac.authorization.k8s.io
1514
{{- end }}

charts/nlk/templates/nlk-configmap.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ data:
77
{{- if .Values.nlk.config.entries.hosts }}
88
nginx-hosts: "{{ .Values.nlk.config.entries.hosts }}"
99
{{- end }}
10-
tls-mode: "{{ .Values.nlk.defaultTLS.tls-mode }}"
11-
ca-certificate: "{{ .Values.nlk.defaultTLS.ca-certificate }}"
12-
client-certificate: "{{ .Values.nlk.defaultTLS.client-certificate }}"
10+
tls-mode: "{{ index .Values.nlk.defaultTLS "tls-mode" }}"
11+
ca-certificate: "{{ index .Values.nlk.defaultTLS "ca-certificate" }}"
12+
client-certificate: "{{ index .Values.nlk.defaultTLS "client-certificate" }}"
1313
log-level: "{{ .Values.nlk.logLevel }}"
14+

charts/nlk/templates/nlk-deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: {{ .Release.Name }}-nlk
4+
name: {{ include "nlk.fullname" . }}
55
namespace: nlk
66
labels:
77
app: nlk
@@ -17,7 +17,7 @@ spec:
1717
spec:
1818
containers:
1919
- name: {{ .Chart.Name }}
20-
image: "{{ .Values.nlk.image.repository }}:{{ .Values.nlk.image.tag }}"
20+
image: {{ include "nlk.image" .}}
2121
imagePullPolicy: {{ .Values.nlk.image.pullPolicy }}
2222
ports:
2323
{{- range $key, $value := .Values.nlk.containerPort }}
@@ -41,4 +41,4 @@ spec:
4141
initialDelaySeconds: {{ .Values.nlk.readyStatus.initialDelaySeconds }}
4242
periodSeconds: {{ .Values.nlk.readyStatus.periodSeconds }}
4343
{{- end }}
44-
serviceAccountName: {{ .Values.nlk.serviceAccount.name }}
44+
serviceAccountName: {{ include "nlk.fullname" . }}

charts/nlk/templates/nlk-secret.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
22
kind: Secret
33
metadata:
4-
name: nginx-loadbalancer-kubernetes-secret
4+
name: {{ include "nlk.fullname" . }}
55
namespace: nlk
66
annotations:
7-
kubernetes.io/service-account.name: {{ .Values.nlk.serviceAccount.name }}
7+
kubernetes.io/service-account.name: {{ include "nlk.fullname" . }}
88
type: kubernetes.io/service-account-token

charts/nlk/templates/nlk-serviceaccount.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
apiVersion: v1
33
kind: ServiceAccount
44
metadata:
5-
name: nginx-loadbalancer-kubernetes
5+
name: {{ include "nlk.fullname" . }}
66
namespace: nlk
77
{{- end }}

charts/nlk/values.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ nlk:
66
replicaCount: 1
77

88
image:
9-
repository: ghcr.io/nginxinc/nginx-loadbalancer-kubernetes
9+
registry: ghcr.io
10+
repository: nginxinc/nginx-loadbalancer-kubernetes
1011
pullPolicy: Always
1112
# Overrides the image tag whose default is the chart appVersion.
1213
tag: latest
@@ -22,9 +23,6 @@ nlk:
2223
automount: true
2324
# Annotations to add to the service account
2425
annotations: {}
25-
# The name of the service account to use.
26-
# If not set and create is true, a name is generated using the fullname template
27-
name: nginx-loadbalancer-kubernetes
2826

2927
podAnnotations: {}
3028
podLabels: {}

0 commit comments

Comments
 (0)