Skip to content

fix: helm Chart erros + hard coding #159

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

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text eol=lf

*.png binary
7 changes: 5 additions & 2 deletions charts/nlk/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v2
appVersion: 0.1.0
description: NGINX LoadBalancer for Kubernetes
Expand All @@ -10,7 +11,9 @@ keywords:
- ingress
kubeVersion: '>= 1.22.0-0'
maintainers:
name: "@ciroque"
name: "@chrisakker"
- name: "@ciroque"
- name: "@chrisakker"
- name: "@abdennour"

type: application
version: 0.0.1
4 changes: 2 additions & 2 deletions charts/nlk/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ Expand image name.
*/}}
{{- define "nlk.image" -}}
{{- if .Values.nlk.image.digest -}}
{{- printf "%s@%s" .Values.nlk.image.repository .Values.nlk.image.digest -}}
{{- printf "%s/%s@%s" .Values.nlk.image.registry .Values.nlk.image.repository .Values.nlk.image.digest -}}
{{- else -}}
{{- printf "%s:%s" .Values.nlk.image.repository (include "nlk.tag" .) -}}
{{- printf "%s/%s:%s" .Values.nlk.image.registry .Values.nlk.image.repository (include "nlk.tag" .) -}}
{{- end -}}
{{- end -}}

Expand Down
3 changes: 1 addition & 2 deletions charts/nlk/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: resource-get-watch-list
namespace: nlk
name: {{ .Release.Namespace }}-{{ include "nlk.fullname" . }}
rules:
- apiGroups:
- ""
Expand Down
7 changes: 3 additions & 4 deletions charts/nlk/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: "nginx-loadbalancer-kubernetes:resource-get-watch-list"
namespace: nlk
name: {{ .Release.Namespace }}-{{ include "nlk.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ .Values.nlk.serviceAccount.name }}
name: {{ include "nlk.fullname" . }}
namespace: nlk
roleRef:
kind: ClusterRole
name: resource-get-watch-list
name: {{ .Release.Namespace }}-{{ include "nlk.fullname" . }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
7 changes: 4 additions & 3 deletions charts/nlk/templates/nlk-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ data:
{{- if .Values.nlk.config.entries.hosts }}
nginx-hosts: "{{ .Values.nlk.config.entries.hosts }}"
{{- end }}
tls-mode: "{{ .Values.nlk.defaultTLS.tls-mode }}"
ca-certificate: "{{ .Values.nlk.defaultTLS.ca-certificate }}"
client-certificate: "{{ .Values.nlk.defaultTLS.client-certificate }}"
tls-mode: "{{ index .Values.nlk.defaultTLS "tls-mode" }}"
ca-certificate: "{{ index .Values.nlk.defaultTLS "ca-certificate" }}"
client-certificate: "{{ index .Values.nlk.defaultTLS "client-certificate" }}"
log-level: "{{ .Values.nlk.logLevel }}"

6 changes: 3 additions & 3 deletions charts/nlk/templates/nlk-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-nlk
name: {{ include "nlk.fullname" . }}
namespace: nlk
labels:
app: nlk
Expand All @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.nlk.image.repository }}:{{ .Values.nlk.image.tag }}"
image: {{ include "nlk.image" .}}
imagePullPolicy: {{ .Values.nlk.image.pullPolicy }}
ports:
{{- range $key, $value := .Values.nlk.containerPort }}
Expand All @@ -41,4 +41,4 @@ spec:
initialDelaySeconds: {{ .Values.nlk.readyStatus.initialDelaySeconds }}
periodSeconds: {{ .Values.nlk.readyStatus.periodSeconds }}
{{- end }}
serviceAccountName: {{ .Values.nlk.serviceAccount.name }}
serviceAccountName: {{ include "nlk.fullname" . }}
4 changes: 2 additions & 2 deletions charts/nlk/templates/nlk-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: nginx-loadbalancer-kubernetes-secret
name: {{ include "nlk.fullname" . }}
namespace: nlk
annotations:
kubernetes.io/service-account.name: {{ .Values.nlk.serviceAccount.name }}
kubernetes.io/service-account.name: {{ include "nlk.fullname" . }}
type: kubernetes.io/service-account-token
2 changes: 1 addition & 1 deletion charts/nlk/templates/nlk-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx-loadbalancer-kubernetes
name: {{ include "nlk.fullname" . }}
namespace: nlk
{{- end }}
6 changes: 2 additions & 4 deletions charts/nlk/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ nlk:
replicaCount: 1

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

podAnnotations: {}
podLabels: {}
Expand Down