Skip to content

Commit

Permalink
[netbox] Release netbox v5.0.3
Browse files Browse the repository at this point in the history
[netbox] Release netbox v5.0.3
  • Loading branch information
firmansyahn authored Feb 2, 2024
2 parents 74aca41 + c28b5fb commit e3a4287
Show file tree
Hide file tree
Showing 24 changed files with 711 additions and 477 deletions.
4 changes: 2 additions & 2 deletions charts/netbox/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ annotations:
image: docker.io/netboxcommunity/netbox:v3.7-2.8.0
apiVersion: v2
name: netbox
version: 5.0.2
version: 5.0.3
appVersion: v3.7.1
kubeVersion: ">=1.25.0"
description: IP address management (IPAM) and data center infrastructure management (DCIM) tool
Expand Down Expand Up @@ -36,4 +36,4 @@ dependencies:
- name: st-common
repository: https://startechnica.github.io/apps
version: 0.x.x
alias: startechnica-common
alias: startechnica-common
67 changes: 48 additions & 19 deletions charts/netbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
[NetBox](https://netbox.readthedocs.io/) is an IP address management (IPAM) and
data center infrastructure management (DCIM) tool.

Forked from [bootc/netbox-chart](https://github.com/bootc/netbox-chart)

**Note:** This repository was forked from [bootc/netbox-chart](https://github.com/bootc/netbox-chart) at versions
v5.0.0 and up are from this fork and will have diverged from any changes in the original fork. A list of changes can be seen in the CHANGELOG.
v5.0.0 and up are from this fork will have diverged from any changes in the original fork. A list of changes can be seen in the CHANGELOG.

**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/startechnica/apps/issues/new/choose)**

Expand All @@ -15,12 +13,12 @@ v5.0.0 and up are from this fork and will have diverged from any changes in the
```console
$ helm repo add startechnica https://startechnica.github.io/apps
$ helm install netbox \
--set postgresql.auth.postgresPassword=[password1] \
--set postgresql.auth.password=[password2] \
--set redis.auth.password=[password3] \
startechnica/netbox
--set postgresql.auth.postgresPassword=<posgres-password> \
--set postgresql.auth.password=<db-password> \
--set redis.auth.password=<redis-password> \
startechnica/netbox
```
⚠️ **WARNING:** Please see [Production Usage](#production-usage) below before using this chart for real.
⚠️ **WARNING:** Please see [Production Usage](#production-usage) below before using this chart for production environment.

## Prerequisites

Expand All @@ -32,12 +30,12 @@ $ helm install netbox \

To install the chart with the release name `my-release` and default configuration:

```shell
```console
$ helm repo add startechnica https://startechnica.github.io/apps
$ helm install my-release \
--set postgresql.auth.postgresPassword=[password1] \
--set postgresql.auth.password=[password2] \
--set redis.auth.password=[password3] \
--set postgresql.auth.postgresPassword=<password1> \
--set postgresql.auth.password=<password2> \
--set redis.auth.password=<password3> \
startechnica/netbox
```

Expand Down Expand Up @@ -76,9 +74,9 @@ affinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/component: server
app.kubernetes.io/instance: netbox
app.kubernetes.io/name: netbox
app.kubernetes.io/component: netbox
topologyKey: kubernetes.io/hostname
```
Expand All @@ -95,17 +93,18 @@ The command removes all the Kubernetes components associated with the chart and
## Breaking Changes
* The `extraEnvs` setting has been renamed to `extraEnvVars`.
* The `extraContainers` setting has been renamed to `sidecars`.
* The `extraContainers` setting has been renamed to `sidecars`.
* The `extraInitContainers` setting has been renamed to `initContainers`.
* The `securityContext` setting has been renamed to `podSecurityContext` and `containerSecurityContext`.
* The `ingress.className` setting has been renamed to `ingress.ingressClassName`.
* The `housekeeping.securityContext` setting has been renamed to `housekeeping.containerSecurityContext`
* The `init` setting has been renamed to `initDirs`.
* The `ingress.className` setting has been renamed to `ingress.ingressClassName`.
* The `metricsEnabled` setting has been renamed to `metrics.enabled`.
* The `securityContext` setting has been renamed to `podSecurityContext` and `containerSecurityContext`.
* The `serviceMonitor` setting has been renamed to `metrics.serviceMonitor`.
* The `superuser.password: admin` setting has been changed to `superuser.password: ""`.
* The `superuser.passwordSecretKey` setting has been renamed to `superuser.existingSecretPasswordKey`.
* The `worker.autoscaling.targetCPUUtilizationPercentage` setting has been renamed to `worker.autoscaling.targetCPU`.
* The `worker.autoscaling.targetMemoryUtilizationPercentage` setting has been renamed to `worker.autoscaling.targetMemory`.
* The `worker.extraEnvs` setting has been renamed to `worker.extraEnvVars`.
* The `serviceMonitor` setting has been renamed to `metrics.serviceMonitor`.
* The `metricsEnabled` setting has been renamed to `metrics.enabled`.
* The `serviceMonitor` setting has been renamed to `metrics.serviceMonitor`.

## Upgrading

Expand Down Expand Up @@ -167,6 +166,36 @@ PostgreSQL chart was upgraded from 5.x.x to 7.x.x, and Redis from 8.x.x to

The following table lists the configurable parameters for this chart and their default values.

### Global parameters

| Name | Description | Value |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----- |
| `global.imageRegistry` | Global Docker image registry | `""` |
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` |
| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` |
| `global.namespaceOverride` | Override the namespace for resource deployed by the chart, but can itself be overridden by the local namespaceOverride | `""` |


### Common parameters

| Name | Description | Value |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------- |
| `kubeVersion` | Force target Kubernetes version (using Helm capabilities if not set) | `""` |
| `nameOverride` | String to partially override common.names.fullname template with a string (will prepend the release name) | `""` |
| `namespaceOverride` | String to fully override common.names.namespace | `""` |
| `fullnameOverride` | String to fully override common.names.fullname template with a string | `""` |
| `commonAnnotations` | Annotations to add to all deployed objects | `{}` |
| `commonLabels` | Labels to add to all deployed objects | `{}` |
| `schedulerName` | Name of the Kubernetes scheduler (other than default) | `""` |
| `clusterDomain` | Kubernetes DNS Domain name to use | `cluster.local` |
| `extraDeploy` | Array of extra objects to deploy with the release (evaluated as a template) | `[]` |
| `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` |
| `diagnosticMode.command` | Command to override all containers in the deployment | `[]` |
| `diagnosticMode.args` | Args to override all containers in the deployment | `[]` |


### Netbox parameters

| Parameter | Description | Default |
| ------------------------------------------------|---------------------------------------------------------------------|----------------------------------------------|
| `replicaCount` | The desired number of NetBox pods | `1` |
Expand Down
14 changes: 7 additions & 7 deletions charts/netbox/templates/ConfigMap/netbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,13 @@ data:
ENABLE_LOCALIZATION: {{ toJson .Values.enableLocalization }}
TIME_ZONE: {{ .Values.timeZone | quote }}
DATE_FORMAT: {{ .Values.dateFormat | quote }}
SHORT_DATE_FORMAT: {{ .Values.shortDateFormat | quote }}
TIME_FORMAT: {{ .Values.timeFormat | quote }}
SHORT_TIME_FORMAT: {{ .Values.shortTimeFormat | quote }}
DATETIME_FORMAT: {{ .Values.dateTimeFormat | quote }}
SHORT_DATE_FORMAT: {{ .Values.shortDateFormat | quote }}
SHORT_TIME_FORMAT: {{ .Values.shortTimeFormat | quote }}
SHORT_DATETIME_FORMAT: {{ .Values.shortDateTimeFormat | quote }}
{{- if eq .Values.remoteAuth.backend "netbox.authentication.LDAPBackend" }}

{{- if and (eq .Values.remoteAuth.backend "netbox.authentication.LDAPBackend") .Values.remoteAuth.ldap.enabled }}
ldap_config.py: |-
from importlib import import_module
Expand Down Expand Up @@ -288,15 +287,16 @@ data:
AUTH_LDAP_MIRROR_GROUPS_EXCEPT: {{ toJson .Values.remoteAuth.ldap.mirrorGroupsExcept }}
AUTH_LDAP_CACHE_TIMEOUT: {{ int .Values.remoteAuth.ldap.cacheTimeout }}
{{- end }}
{{- if .Values.overrideUnitConfig }}

{{- if .Values.overrideUnitConfig -}}
nginx-unit.json: |-
{{- toPrettyJson .Values.overrideUnitConfig | nindent 4 }}
{{- end }}
{{- end -}}

{{- range $index, $config := .Values.extraConfig -}}
{{- if $config.values }}

extra-{{ $index }}.yaml: |-
{{- toYaml $config.values | nindent 4 }}
{{- end }}
{{ end -}}
{{- end -}}
45 changes: 45 additions & 0 deletions charts/netbox/templates/HorizontalPodAutoscaler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "netbox.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: server
app.kubernetes.io/part-of: netbox
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
scaleTargetRef:
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
name: {{ template "netbox.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if or .Values.autoscaling.targetCPU .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ coalesce .Values.autoscaling.targetCPU .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ coalesce .Values.autoscaling.targetCPU .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- end }}
{{- if or .Values.autoscaling.targetMemory .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ coalesce .Values.autoscaling.targetMemory .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ coalesce .Values.autoscaling.targetMemory .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/netbox/templates/Ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
secretName: {{ printf "%s-tls" .Values.ingress.hostname }}
{{- end }}
{{- if .Values.ingress.extraTls }}
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }}
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
21 changes: 8 additions & 13 deletions charts/netbox/templates/PersistentVolumeClaim/media.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,20 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "netbox.fullname" . }}-media
{{- with .Values.commonAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if or .Values.persistence.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.persistence.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
labels:
{{- include "netbox.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
{{- range .Values.persistence.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: {{ .Values.persistence.storageClass | quote }}
{{- end }}
{{- end }}
{{- include "common.storage.class" (dict "persistence" .Values.reportsPersistence "global" .Values.global) | nindent 2 }}
{{- with .Values.persistence.selector }}
selector:
{{- toYaml . | nindent 4 }}
Expand Down
23 changes: 9 additions & 14 deletions charts/netbox/templates/PersistentVolumeClaim/reports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,22 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "netbox.fullname" . }}-reports
{{- with .Values.commonAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if or .Values.reportsPersistence.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.reportsPersistence.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
labels:
{{- include "netbox.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.reportsPersistence.accessMode | quote }}
{{- range .Values.reportsPersistence.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.reportsPersistence.size | quote }}
{{- if .Values.reportsPersistence.storageClass }}
{{- if (eq "-" .Values.reportsPersistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: {{ .Values.reportsPersistence.storageClass | quote }}
{{- end }}
{{- end }}
{{- include "common.storage.class" (dict "persistence" .Values.reportsPersistence "global" .Values.global) | nindent 2 }}
{{- with .Values.reportsPersistence.selector }}
selector:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
{{- end -}}
23 changes: 9 additions & 14 deletions charts/netbox/templates/PersistentVolumeClaim/scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,22 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "netbox.fullname" . }}-scripts
{{- with .Values.commonAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if or .Values.scriptsPersistence.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.scriptsPersistence.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
labels:
{{- include "netbox.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.scriptsPersistence.accessMode | quote }}
{{- range .Values.scriptsPersistence.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.scriptsPersistence.size | quote }}
{{- if .Values.scriptsPersistence.storageClass }}
{{- if (eq "-" .Values.scriptsPersistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: {{ .Values.scriptsPersistence.storageClass | quote }}
{{- end }}
{{- end }}
{{- include "common.storage.class" (dict "persistence" .Values.scriptsPersistence "global" .Values.global) | nindent 2 }}
{{- with .Values.scriptsPersistence.selector }}
selector:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
{{- end -}}
Loading

0 comments on commit e3a4287

Please sign in to comment.