Update nexus helm charts. Docker and helm repos are exposed using separated ingress...
[it/dep.git] / ric-infra / 10-Nexus / helm / templates / _gen-cert.tpl
 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
-################################################################################
+################################################################################i
 
-{{/* vim: set filetype=mustache: */}}
 {{/*
-Expand the name of the chart.
+Generate certificates for the docker registry
 */}}
-{{- define "ext.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- define "nexus.gen-docker-cert" -}}
+{{- $altNames := list ( include "common.ingressurl.localdocker" . ) -}}
+{{- $ca := genCA "docker-registry-ca" 365 -}}
+{{- $cert := genSignedCert ( include "common.ingressurl.localdocker" . ) nil $altNames 365 $ca -}}
+tls.crt: {{ $cert.Cert | b64enc }}
+tls.key: {{ $cert.Key | b64enc }}
 {{- 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)
-.
-If release name contains chart name it will be used as a full name.
-*/}}
-{{- define "ext.fullname" -}}
-{{- if .Values.fullnameOverride -}}
-{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- $name := default .Chart.Name .Values.nameOverride -}}
-{{- if contains $name .Release.Name -}}
-{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-{{- end -}}
+{{- define "nexus.gen-helm-cert" -}}
+{{- $altNames := list ( include "common.ingressurl.localhelm" . ) -}}
+{{- $ca := genCA "docker-registry-ca" 365 -}}
+{{- $cert := genSignedCert ( include "common.ingressurl.localhelm" . ) nil $altNames 365 $ca -}}
+tls.crt: {{ $cert.Cert | b64enc }}
+tls.key: {{ $cert.Key | b64enc }}
 {{- end -}}
 
-{{/*
-Create chart name and version as used by the chart label.
-*/}}
-{{- define "ext.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
 
+{{- define "nexus.gen-nexus-cert" -}}
+{{- $altNames := list ( include "common.ingressurl.localnexus" . ) -}}
+{{- $ca := genCA "docker-registry-ca" 365 -}}
+{{- $cert := genSignedCert ( include "common.ingressurl.localnexus" . ) nil $altNames 365 $ca -}}
+tls.crt: {{ $cert.Cert | b64enc }}
+tls.key: {{ $cert.Key | b64enc }}
+{{- end -}}