Skip to content

Commit

Permalink
Merge pull request #6 from enix/ldap
Browse files Browse the repository at this point in the history
feat(netbox): add ldap switch and a little bit more documentation
  • Loading branch information
Zempashi authored May 10, 2020
2 parents 829a278 + 9e0ca69 commit 8c3806e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/netbox/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v2
appVersion: "v2.8.1"
description: NetBox is an open source web application designed to help manage and document computer networks.
name: netbox
version: 1.2.1
version: 1.2.2
icon: https://github.com/netbox-community/netbox/raw/develop/docs/netbox_logo.svg?sanitize=true
home: https://netbox.readthedocs.io/en/stable/
sources:
Expand Down
9 changes: 9 additions & 0 deletions charts/netbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The command removes all the Kubernetes components associated with the chart and
| extraVolumeMounts | list | `[]` | |
| extraVolumes | list | `[]` | |
| fullnameOverride | string | `""` | String to fully override netbox.fullname template with a string |
| image.ldap | bool | `false` | Switch docker image tag to the ldap flavor |
| image.pullPolicy | string | `"IfNotPresent"` | Netbox image pull policy |
| image.repository | string | `"netboxcommunity/netbox"` | Netbox image |
| image.tag | string | `nil` | Netbox image version |
Expand Down Expand Up @@ -125,6 +126,14 @@ The command removes all the Kubernetes components associated with the chart and
| tolerations | list | `[]` | tolerations to add on Netbox Pod |
| updateStrategy | object | `{"type":"RollingUpdate"}` | Update strategy policy |

## LDAP

You can use the boolean `image.ldap` to switch to ldap image (tag)[https://hub.docker.com/r/netboxcommunity/netbox/tags].
Then use `extraEnvs` for environment configuration and `extraSecretEnvs` for password following the netbox documentation:

- https://github.com/netbox-community/netbox-docker/wiki/LDAP
- https://netbox.readthedocs.io/en/stable/installation/5-ldap/

## License

Copyright (c) 2020 ENIX
Expand Down
9 changes: 9 additions & 0 deletions charts/netbox/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ Create the name of the service account to use
{{ include "netbox.fullname" . }}-initializers
{{- end -}}

{{- define "netbox.imageTag" -}}
{{- $tag := .Chart.AppVersion -}}
{{- if .Values.image.ldap -}}
{{/* use "=" instead of ":=" to affect variable outside the if scope */}}
{{- $tag = printf "%s-ldap" $tag -}}
{{- end }}
{{- default $tag .Values.image.tag -}}
{{- end -}}

{{/*
https://github.com/helm/helm/issues/4535#issuecomment-416022809
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/netbox/templates/_netbox.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ template:
{{- toYaml .Values.podSecurityContext | nindent 6 }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
image: "{{ .Values.image.repository }}:{{ include "netbox.imageTag" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | indent 12 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/netbox/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ image:
tag:
# image.pullPolicy -- Netbox image pull policy
pullPolicy: IfNotPresent
# image.ldap -- Switch docker image tag to the ldap flavor
ldap: false

nginxImage:
# nginxImage.repository -- Nginx image
Expand Down

0 comments on commit 8c3806e

Please sign in to comment.