Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #146 from abhilashjoseph/master
Browse files Browse the repository at this point in the history
Add namespace to nexus chart
  • Loading branch information
rjkernick authored Jul 24, 2020
2 parents 694d7c7 + c5d58ad commit 6d46d92
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/sonatype-nexus/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: sonatype-nexus
version: 2.3.2
version: 2.4.0
appVersion: 3.23.0
description: Sonatype Nexus is an open source repository manager
keywords:
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ The following table lists the configurable parameters of the Nexus chart and the

| Parameter | Description | Default |
| ------------------------------------------------------------ | ---------------------------------- | ----------------------------------------|
| `namespaceOverride` | Override for namespace | `nil` |
| `statefulset.enabled` | Use statefulset instead of deployment | `false` |
| `replicaCount` | Number of Nexus service replicas | `1` |
| `deploymentStrategy` | Deployment Strategy | `rollingUpdate` |
Expand Down
11 changes: 11 additions & 0 deletions charts/sonatype-nexus/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ If release name contains chart name it will be used as a full name.
{{- end -}}
{{- end -}}

{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
*/}}
{{- define "nexus.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/adtl-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $cm.name }}
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" $root | indent 4 }}
{{- if $.Values.nexus.labels }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/backup-pv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ .Values.nexusBackup.persistence.pdName }}
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
spec:
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/backup-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "nexus.fullname" . }}-backup
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
{{- if .Values.nexusBackup.persistence.annotations }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/backup-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ template "nexus.fullname" . }}
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
type: Opaque
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "nexus.name" . }}-conf
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
{{- if .Values.nexus.labels }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: Deployment
{{- end }}
metadata:
name: {{ template "nexus.fullname" . }}
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
{{- if .Values.nexus.labels }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ template "nexus.fullname" . }}
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
{{- range $key, $value := .Values.ingress.labels }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/proxy-ks-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ template "nexus.proxy-ks.name" . }}
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
type: Opaque
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/proxy-route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ template "nexus.fullname" . }}
namespace: {{ template "nexus.namespace" . }}
labels:
{{- range $key, $value := .Values.nexusProxyRoute.labels }}
{{ $key }}: {{ $value | quote }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/proxy-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
{{- else }}
name: {{ template "nexus.fullname" . }}
{{- end }}
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
{{- if .Values.nexus.labels }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/pv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ .Values.persistence.pdName }}
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
spec:
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "nexus.fullname" . }}-data
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
{{- if .Values.persistence.annotations }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ .Values.route.name }}
namespace: {{ template "nexus.namespace" . }}
labels:
{{- range $key, $value := .Values.route.labels }}
{{ $key }}: {{ $value | quote }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ template "nexus.name" . }}-secret
namespace: {{ template "nexus.namespace" . }}
labels:
{{ include "nexus.labels" . | indent 4 }}
{{- if .Values.nexus.labels }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: Service
metadata:
{{- if .Values.service.name }}
name: {{ .Values.service.name }}
namespace: {{ template "nexus.namespace" . }}
{{- else }}
name: {{ template "nexus.name" . }}-service
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonatype-nexus/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "nexus.fullname" . }}
namespace: {{ template "nexus.namespace" . }}
{{- if .Values.serviceAccount.annotations }}
annotations: {{ toYaml .Values.serviceAccount.annotations | nindent 4 }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/sonatype-nexus/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Overrides for generated resource names
# namespaceOverride:

statefulset:
enabled: false
replicaCount: 1
Expand Down

0 comments on commit 6d46d92

Please sign in to comment.