diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4f80541 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +* text eol=lf + +*.png binary \ No newline at end of file diff --git a/charts/nlk/Chart.yaml b/charts/nlk/Chart.yaml index 218fbd0..c11d885 100644 --- a/charts/nlk/Chart.yaml +++ b/charts/nlk/Chart.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v2 appVersion: 0.1.0 description: NGINX LoadBalancer for Kubernetes @@ -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 diff --git a/charts/nlk/templates/_helpers.tpl b/charts/nlk/templates/_helpers.tpl index 60fa7ee..17a6405 100644 --- a/charts/nlk/templates/_helpers.tpl +++ b/charts/nlk/templates/_helpers.tpl @@ -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 -}} diff --git a/charts/nlk/templates/clusterrole.yaml b/charts/nlk/templates/clusterrole.yaml index 4d03a4a..4164475 100644 --- a/charts/nlk/templates/clusterrole.yaml +++ b/charts/nlk/templates/clusterrole.yaml @@ -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: - "" diff --git a/charts/nlk/templates/clusterrolebinding.yaml b/charts/nlk/templates/clusterrolebinding.yaml index b989dfe..0ccd455 100644 --- a/charts/nlk/templates/clusterrolebinding.yaml +++ b/charts/nlk/templates/clusterrolebinding.yaml @@ -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 }} diff --git a/charts/nlk/templates/nlk-configmap.yaml b/charts/nlk/templates/nlk-configmap.yaml index 8d59573..482b8cb 100644 --- a/charts/nlk/templates/nlk-configmap.yaml +++ b/charts/nlk/templates/nlk-configmap.yaml @@ -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 }}" + diff --git a/charts/nlk/templates/nlk-deployment.yaml b/charts/nlk/templates/nlk-deployment.yaml index 105bd69..fb55d77 100644 --- a/charts/nlk/templates/nlk-deployment.yaml +++ b/charts/nlk/templates/nlk-deployment.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ .Release.Name }}-nlk + name: {{ include "nlk.fullname" . }} namespace: nlk labels: app: nlk @@ -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 }} @@ -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" . }} diff --git a/charts/nlk/templates/nlk-secret.yaml b/charts/nlk/templates/nlk-secret.yaml index e3cae1b..ff7d7ff 100644 --- a/charts/nlk/templates/nlk-secret.yaml +++ b/charts/nlk/templates/nlk-secret.yaml @@ -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 diff --git a/charts/nlk/templates/nlk-serviceaccount.yaml b/charts/nlk/templates/nlk-serviceaccount.yaml index a9d3560..5bdca4f 100644 --- a/charts/nlk/templates/nlk-serviceaccount.yaml +++ b/charts/nlk/templates/nlk-serviceaccount.yaml @@ -2,6 +2,6 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: nginx-loadbalancer-kubernetes + name: {{ include "nlk.fullname" . }} namespace: nlk {{- end }} diff --git a/charts/nlk/values.yaml b/charts/nlk/values.yaml index b8a74dd..394bc1f 100644 --- a/charts/nlk/values.yaml +++ b/charts/nlk/values.yaml @@ -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 @@ -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: {}