Skip to content

Commit

Permalink
Add ability to set labels on ServiceMonitor (#15)
Browse files Browse the repository at this point in the history
* Add ability to set labels on Nexus3 ServiceMonitor
  • Loading branch information
mcwarman authored Apr 21, 2020
1 parent 6c01140 commit 24df749
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 36 deletions.
2 changes: 1 addition & 1 deletion charts/nexus3/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: nexus3
version: 2.2.1
version: 2.2.2
appVersion: 3.22.1
description: Sonatype Nexus OSS is an open source repository manager
keywords:
Expand Down
71 changes: 36 additions & 35 deletions charts/nexus3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,41 +42,42 @@ The command removes all the Kubernetes components associated with the chart and

The following table lists the configurable parameters of the _Nexus3_ chart and their default values.

| Parameter | Description | Default |
| -------------------------------- | --------------------------------------------------------------------------------------- | ----------------- |
| `image.repository` | Docker repository to use | `sonatype/nexus3` |
| `image.tag` | Docker tag to use | `3.22.1` |
| `image.pullPolicy` | Docker image pull policy | `IfNotPresent` |
| `nameOverride` | String to partially override `nexus3.fullname` template (will prepend the release name) | `nil` |
| `fullnameOverride` | String to fully override `nexus3.fullname` template | `nil` |
| `securityContext.fsGroup` | File system group ownership | `200` |
| `service.type` | Type of service | `ClusterIP` |
| `service.port` | Service port | `8881` |
| `service.additionalPorts` | Additional ports exposed by the service and used by repository connectors | `nil` |
| `caCerts.secret` | Name of the secret containing additional CA certificates | `nil` |
| `metrics.enabled` | Metrics enabled for anonymous access | `false` |
| `metrics.serviceMonitor.enabled` | Prometheus service monitor created | `false` |
| `envVars.jvmMaxRAMPercentage` | JVM max RAM percentage | `25.0` |
| `envVars.jvmMaxDirectMemorySize` | JVM direct memory size | `2G` |
| `env` | List of environmental variable to apply to the deployment | `nil` |
| `persistence.enabled` | Create a volume (PVC) for storage | `false` |
| `persistence.existingClaim` | An existing PVC to use instead of creating a new one | `nil` |
| `persistence.accessMode` | The PVC access mode | `ReadWriteOnce` |
| `persistence.storageClass` | The PVC storage class (use `-` for default) | `standard` |
| `persistence.size` | The size of the PVC to create | `8Gi` |
| `podAnnotations` | Pod Annotations | `{}` |
| `resources` | Resource requests and limits | `{}` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | List of node taints to tolerate | `[]` |
| `affinity` | Map of node/pod affinities | `{}` |
| `ingress.enabled` | Create an ingress | `false` |
| `ingress.annotations` | Annotations to enhance ingress configuration | `{}` |
| `ingress.path` | Path for ingress rules | `/` |
| `ingress.hosts` | List of ingress hosts | `[]` |
| `ingress.tls` | List of TLS configurations (`ingress.tls[n].secretName`, `ingress.tls[n].hosts[m])` | `[]` |
| `properties.enabled` | Support passing _Nexus3_ properties. | `false` |
| `properties.values` | The properties to pass to _Nexus3_. | `nil` |
| `config.enabled` | Automatically configure _Nexus3_ | `false` |
| Parameter | Description | Default |
| ------------------------------------------| --------------------------------------------------------------------------------------- | ----------------- |
| `image.repository` | Docker repository to use | `sonatype/nexus3` |
| `image.tag` | Docker tag to use | `3.22.1` |
| `image.pullPolicy` | Docker image pull policy | `IfNotPresent` |
| `nameOverride` | String to partially override `nexus3.fullname` template (will prepend the release name) | `nil` |
| `fullnameOverride` | String to fully override `nexus3.fullname` template | `nil` |
| `securityContext.fsGroup` | File system group ownership | `200` |
| `service.type` | Type of service | `ClusterIP` |
| `service.port` | Service port | `8881` |
| `service.additionalPorts` | Additional ports exposed by the service and used by repository connectors | `nil` |
| `caCerts.secret` | Name of the secret containing additional CA certificates | `nil` |
| `metrics.enabled` | Metrics enabled for anonymous access | `false` |
| `metrics.serviceMonitor.enabled` | Prometheus service monitor created | `false` |
| `metrics.serviceMonitor.additionalLabels` | Additional labels to be set on the ServiceMonitor | `{}` |
| `envVars.jvmMaxRAMPercentage` | JVM max RAM percentage | `25.0` |
| `envVars.jvmMaxDirectMemorySize` | JVM direct memory size | `2G` |
| `env` | List of environmental variable to apply to the deployment | `nil` |
| `persistence.enabled` | Create a volume (PVC) for storage | `false` |
| `persistence.existingClaim` | An existing PVC to use instead of creating a new one | `nil` |
| `persistence.accessMode` | The PVC access mode | `ReadWriteOnce` |
| `persistence.storageClass` | The PVC storage class (use `-` for default) | `standard` |
| `persistence.size` | The size of the PVC to create | `8Gi` |
| `podAnnotations` | Pod Annotations | `{}` |
| `resources` | Resource requests and limits | `{}` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | List of node taints to tolerate | `[]` |
| `affinity` | Map of node/pod affinities | `{}` |
| `ingress.enabled` | Create an ingress | `false` |
| `ingress.annotations` | Annotations to enhance ingress configuration | `{}` |
| `ingress.path` | Path for ingress rules | `/` |
| `ingress.hosts` | List of ingress hosts | `[]` |
| `ingress.tls` | List of TLS configurations (`ingress.tls[n].secretName`, `ingress.tls[n].hosts[m])` | `[]` |
| `properties.enabled` | Support passing _Nexus3_ properties. | `false` |
| `properties.values` | The properties to pass to _Nexus3_. | `nil` |
| `config.enabled` | Automatically configure _Nexus3_ | `false` |

## Persistence

Expand Down
3 changes: 3 additions & 0 deletions charts/nexus3/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
helm.sh/chart: {{ include "nexus3.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{- .Values.metrics.serviceMonitor.additionalLabels | toYaml | trim | nindent 4 }}
{{- end }}
spec:
jobLabel: {{ .Release.Name }}
namespaceSelector:
Expand Down
2 changes: 2 additions & 0 deletions charts/nexus3/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ metrics:
enabled: false
serviceMonitor:
enabled: false
# additionalLabels:
# myLabel: myValue

envVars:
jvmMaxRAMPercentage: "25.0"
Expand Down

0 comments on commit 24df749

Please sign in to comment.