Skip to content

Commit

Permalink
[netbox] Release v5.0.4
Browse files Browse the repository at this point in the history
[netbox] Release v5.0.4
  • Loading branch information
firmansyahn authored Feb 3, 2024
2 parents e3a4287 + 1896e4c commit 0e53b18
Show file tree
Hide file tree
Showing 34 changed files with 856 additions and 372 deletions.
1 change: 1 addition & 0 deletions charts/netbox/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.tgz
.*.swp
values-test.yaml
10 changes: 7 additions & 3 deletions charts/netbox/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ annotations:
- name: netbox
image: docker.io/netboxcommunity/netbox:v3.7-2.8.0
apiVersion: v2
name: netbox
version: 5.0.3
appVersion: v3.7.1
name: netbox
kubeVersion: ">=1.25.0"
description: IP address management (IPAM) and data center infrastructure management (DCIM) tool
home: https://github.com/bootc/netbox-chart
home: https://github.com/startechnica/apps/tree/main/charts/netbox
icon: https://raw.githubusercontent.com/netbox-community/netbox/develop/docs/netbox_logo.png
maintainers:
- name: Chris Boot
Expand Down Expand Up @@ -37,3 +36,8 @@ dependencies:
repository: https://startechnica.github.io/apps
version: 0.x.x
alias: startechnica-common
keywords:
- ipam
- netbox
type: application
version: 5.0.4
85 changes: 44 additions & 41 deletions charts/netbox/README.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion charts/netbox/docs/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Using custom auth pipelines you can assign groups based on the roles supplied by
```yaml
remoteAuth:
enabled: true
backend: social_core.backends.keycloak.KeycloakOAuth2
backends:
- social_core.backends.keycloak.KeycloakOAuth2
autoCreateUser: true

extraConfig:
Expand Down
1 change: 1 addition & 0 deletions charts/netbox/files/plugins/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tgz
1 change: 1 addition & 0 deletions charts/netbox/files/scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tgz
20 changes: 10 additions & 10 deletions charts/netbox/templates/Certificate.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- if and .Values.tls.enabled }}
{{- if .Values.tls.enabled }}
{{- if (include "common.capabilities.certManager.apiVersion" .) }}
apiVersion: {{ include "common.capabilities.certManager.apiVersion" . }}
kind: Certificate
metadata:
name: {{ include "common.names.fullname" . }}
name: {{ include "netbox.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
Expand All @@ -13,7 +13,7 @@ metadata:
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
spec:
secretName: {{ printf "%s-tls" (include "common.names.fullname" .) }}
secretName: {{ printf "%s-tls" (include "netbox.fullname" .) }}
issuerRef:
kind: {{ .Values.tls.autoGenerator.certManager.issuerKind }}
name: {{ .Values.tls.autoGenerator.certManager.issuerName }}
Expand All @@ -27,15 +27,15 @@ spec:
organizationalUnits:
- {{ include "common.names.fullname" . }}
dnsNames:
{{- range .Values.netbox.ingress.hosts }}
- {{ .host | quote }}
{{- range .Values.ingress.extraHosts }}
- {{ .name | quote }}
{{- end }}
---
{{- if .Values.gateway.enabled }}
apiVersion: {{ include "common.capabilities.certManager.apiVersion" . }}
kind: Certificate
metadata:
name: {{ include "common.names.fullname" . }}
name: {{ include "netbox.fullname" . }}
namespace: {{ .Values.gateway.namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
Expand All @@ -45,7 +45,7 @@ metadata:
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
spec:
secretName: {{ printf "%s-tls" (include "common.names.fullname" .) }}
secretName: {{ printf "%s-tls" (include "netbox.fullname" .) }}
issuerRef:
kind: {{ .Values.tls.autoGenerator.certManager.issuerKind }}
name: {{ .Values.tls.autoGenerator.certManager.issuerName }}
Expand All @@ -57,10 +57,10 @@ spec:
organizations:
- {{ .Release.Name | quote }}
organizationalUnits:
- {{ include "common.names.fullname" . }}
- {{ include "netbox.fullname" . }}
dnsNames:
{{- range .Values.netbox.ingress.hosts }}
- {{ .host | quote }}
{{- range .Values.ingress.extraHosts }}
- {{ .name | quote }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
14 changes: 14 additions & 0 deletions charts/netbox/templates/ConfigMap/init-scripts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if and .Values.initdbScripts (not .Values.initdbScriptsConfigMap) -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-init-scripts" (include "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
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
{{- include "common.tplvalues.render" (dict "value" .Values.initdbScripts "context" .) | nindent 2 }}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/netbox/templates/ConfigMap/netbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ data:
SHORT_TIME_FORMAT: {{ .Values.shortTimeFormat | quote }}
SHORT_DATETIME_FORMAT: {{ .Values.shortDateTimeFormat | quote }}
{{- if and (eq .Values.remoteAuth.backend "netbox.authentication.LDAPBackend") .Values.remoteAuth.ldap.enabled }}
{{- if and (has "netbox.authentication.LDAPBackend" .Values.remoteAuth.backend) .Values.remoteAuth.ldap.enabled }}
ldap_config.py: |-
from importlib import import_module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ template "netbox.housekeeping.fullname" . }}
{{- $versionLabel := dict "app.kubernetes.io/version" ( include "common.images.version" ( dict "imageRoot" .Values.image "chart" .Chart ) ) }}
{{- $versionLabel := dict "app.kubernetes.io/version" ( include "common.images.version" ( dict "imageRoot" .Values.housekeeping.image "chart" .Chart ) ) }}
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.commonLabels $versionLabel ) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: housekeeping
Expand All @@ -17,68 +17,96 @@ spec:
schedule: {{ .Values.housekeeping.schedule | quote }}
successfulJobsHistoryLimit: {{ .Values.housekeeping.successfulJobsHistoryLimit }}
suspend: {{ .Values.housekeeping.suspend }}
{{- if or .Values.timezone .Values.housekeeping.timezone }}
timeZone: {{ coalesce .Values.timezone .Values.housekeeping.timezone | quote }}
{{- end }}
jobTemplate:
metadata:
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.housekeeping.podLabels .Values.commonLabels $versionLabel ) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
app.kubernetes.io/component: housekeeping
app.kubernetes.io/part-of: netbox
spec:
{{- if .Values.housekeeping.ttlSecondsAfterFinished }}
ttlSecondsAfterFinished: {{ .Values.housekeeping.ttlSecondsAfterFinished }}
{{- end }}
template:
metadata:
{{- if .Values.podAnnotations }}
annotations:
{{- include "common.tplvalues.render" (dict "value" .Values.housekeeping.podAnnotations "context" $) | nindent 12 }}
{{- if .Values.housekeeping.podAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.housekeeping.podAnnotations "context" $) | nindent 12 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" (list .Values.housekeeping.podLabels .Values.commonLabels $versionLabel) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 12 }}
app.kubernetes.io/component: housekeeping
app.kubernetes.io/part-of: netbox
spec:
automountServiceAccountToken: {{ .Values.housekeeping.automountServiceAccountToken }}
{{- if .Values.housekeeping.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.housekeeping.affinity "context" $) | nindent 12 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.housekeeping.podAffinityPreset "component" "housekeeping" "customLabels" $podLabels "context" $) | nindent 14 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.housekeeping.podAntiAffinityPreset "component" "housekeeping" "customLabels" $podLabels "context" $) | nindent 14 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.housekeeping.nodeAffinityPreset.type "key" .Values.housekeeping.nodeAffinityPreset.key "values" .Values.housekeeping.nodeAffinityPreset.values) | nindent 14 }}
{{- end }}
{{- include "netbox.imagePullSecrets" . | nindent 10 }}
{{- if .Values.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 10 }}
{{- if .Values.housekeeping.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.housekeeping.nodeSelector "context" $) | nindent 10 }}
{{- end }}
restartPolicy: {{ .Values.housekeeping.restartPolicy }}
{{- if .Values.housekeeping.podSecurityContext.enabled }}
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 12 }}
securityContext: {{- omit .Values.housekeeping.podSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
serviceAccountName: {{ include "netbox.serviceAccountName" . }}
{{- if .Values.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 10 }}
{{- if .Values.housekeeping.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.housekeeping.tolerations "context" .) | nindent 10 }}
{{- end }}
{{- if .Values.initContainers }}
{{- if .Values.housekeeping.initContainers }}
initContainers:
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 10 }}
{{- include "common.tplvalues.render" (dict "value" .Values.housekeeping.initContainers "context" $) | nindent 10 }}
{{- end }}
containers:
- name: housekeeping
{{- if .Values.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 14 }}
{{- end }}
image: {{ template "netbox.housekeeping.image" . }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 14 }}
{{- else if .Values.housekeeping.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.housekeeping.command "context" $) | nindent 14 }}
{{- else }}
command:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
- housekeeping
{{- if .Values.housekeeping.extraEnvVars }}
{{- end }}
env:
- name: HOUSEKEEPING_INTERVAL
value: "20"
{{- if .Values.housekeeping.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.housekeeping.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
{{- if or .Values.extraEnvVarsCM .Values.extraEnvVarsSecret }}
envFrom:
{{- if .Values.extraEnvVarsCM }}
- configMapRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }}
{{- end }}
{{- if .Values.extraEnvVarsSecret }}
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }}
{{- end }}
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/netbox/config/configuration.py
subPath: configuration.py
readOnly: true
- name: config
mountPath: /run/config/netbox
readOnly: true
{{- if and (has "netbox.authentication.LDAPBackend" .Values.remoteAuth.backends) .Values.remoteAuth.ldap.enabled }}
- name: config
mountPath: /etc/netbox/config/ldap/ldap_config.py
subPath: ldap_config.py
readOnly: true
{{- end }}
- name: config
mountPath: /run/config/netbox
readOnly: true
- name: secrets
mountPath: /run/secrets/netbox
readOnly: true
Expand All @@ -98,8 +126,8 @@ spec:
mountPath: {{ .Values.scriptsPersistence.path }}
subPath: {{ .Values.scriptsPersistence.subPath | default "" | quote }}
{{- end }}
{{- with .Values.housekeeping.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- if .Values.housekeeping.extraVolumeMounts }}
{{- include "common.tplvalues.render" ( dict "value" .Values.housekeeping.extraVolumeMounts "context" $ ) | nindent 12 }}
{{- end }}
{{- if .Values.housekeeping.resources }}
resources: {{- toYaml .Values.housekeeping.resources | nindent 14 }}
Expand Down Expand Up @@ -157,21 +185,21 @@ spec:
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.reportsPersistence.enabled }}
- name: reports
{{- if .Values.reportsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.reportsPersistence.existingClaim | default (printf "%s-reports" (include "netbox.fullname" .)) }}
{{- end }}
{{- if .Values.scriptsPersistence.enabled }}
{{- else }}
emptyDir: {}
{{- end }}
- name: scripts
{{- if .Values.scriptsPersistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.scriptsPersistence.existingClaim | default (printf "%s-scripts" (include "netbox.fullname" .)) }}
{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- with .Values.housekeeping.affinity }}
affinity:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,15 @@ spec:
apiVersion: v1
fieldPath: status.podIP
{{- end }}
{{- if .Values.metrics.enabled }}
- name: prometheus_multiproc_dir
value: /tmp/metrics
{{- end }}
{{- if .Values.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
{{- if or .Values.extraEnvVarsCM .Values.extraEnvVarsSecret }}
envFrom:
- configMapRef:
name: {{ printf "%s-env-vars" (include "netbox.fullname" .) }}
{{- if .Values.extraEnvVarsCM }}
- configMapRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }}
Expand All @@ -134,10 +137,14 @@ spec:
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }}
{{- end }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.containerPorts.http }}
protocol: TCP
{{- if .Values.resources }}
resources: {{- toYaml .Values.resources | nindent 12 }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
Expand Down Expand Up @@ -198,9 +205,17 @@ spec:
mountPath: /run/secrets/superuser_api_token
subPath: superuser_api_token
readOnly: true
{{- if .Values.resources }}
resources: {{- toYaml .Values.resources | nindent 12 }}
{{- end }}
{{- if .Values.metrics.enabled }}
- name: metrics
mountPath: /tmp/metrics
{{- end }}
{{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }}
- name: custom-init-scripts
mountPath: /docker-entrypoint-initdb.d
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -324,7 +339,7 @@ spec:
- name: media
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (printf "%s-media" (include "netbox.fullname" .)) }}
claimName: {{ include "netbox.media.pvc" . }}
{{- else }}
emptyDir: {}
{{- end }}
Expand All @@ -342,6 +357,15 @@ spec:
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.metrics.enabled }}
- name: metrics
emptyDir: {}
{{- end }}
{{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }}
- name: custom-init-scripts
configMap:
name: {{ include "netbox.initdbScriptsCM" . }}
{{- end }}
{{- if .Values.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
{{- end }}
Loading

0 comments on commit 0e53b18

Please sign in to comment.