Skip to content

Commit

Permalink
Merge pull request #123 from nuvlaedge/issue-2763-multiple
Browse files Browse the repository at this point in the history
Change to allow deployment  of multiple Kubernetes NEs
  • Loading branch information
giovannibianco authored Jan 22, 2024
2 parents ea73ef0 + 2793580 commit 11d0bf0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
8 changes: 6 additions & 2 deletions helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ The NuvlaEdge has just been installed on your Kubernetes node {{ .Values.kuberne

1. After the initial installation, to approve the certificate signing request
for the certificate used to manage the NuvlaEdge instance please run the
following command as system admin of the K8s cluster
following command as system admin of the K8s cluster:{{printf "\n\n" }}

kubectl certificate approve {{ .Values.credManager.csr_name }}{{printf "\n" }}
{{- if .Values.SET_MULTIPLE -}}
kubectl certificate approve {{ .Values.credManager.csr_name }}{{ printf "-" }}{{ include "nuvlaedge.uuid" . }}{{printf "\n\n" }}
{{- else -}}
kubectl certificate approve {{ .Values.credManager.csr_name }}{{printf "\n\n" }}
{{- end -}}

{{- else -}}

Expand Down
7 changes: 7 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ nuvlaedge
{{- end }}
{{- end }}

{{/*
Define the UUID based on the NUVLAEDGE_UUID
*/}}
{{- define "nuvlaedge.uuid" -}}
{{- .Values.NUVLAEDGE_UUID | replace "nuvlabox/" "" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
Expand Down
6 changes: 6 additions & 0 deletions helm/templates/kubernetes-credentials-manager-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ spec:
value: "{{ .Values.credManager.wait_approved_sec }}"
- name: CSR_NAME
value: {{ .Values.credManager.csr_name }}
- name: NUVLAEDGE_UUID
value: {{ .Values.NUVLAEDGE_UUID }}
- name: MY_NAMESPACE
value: {{ include "nuvlaedge.namespace" . }}
- name: SET_MULTIPLE
value: {{ .Values.SET_MULTIPLE }}
volumes:
- name: nuvlaedge-db
hostPath:
Expand Down
3 changes: 2 additions & 1 deletion helm/templates/serviceaccount-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: nuvlaedge-service-account-cluster-role-binding
# We've got a 63 character limit!
name: nuvlaedge-service-account-cluster-role-binding-{{ include "nuvlaedge.uuid" .}}
namespace: {{ include "nuvlaedge.namespace" . }}
labels:
{{- include "nuvlaedge.labels" . | nindent 4 }}
Expand Down

0 comments on commit 11d0bf0

Please sign in to comment.