diff --git a/charts/netbox/.helmignore b/charts/netbox/.helmignore deleted file mode 100644 index 50af031..0000000 --- a/charts/netbox/.helmignore +++ /dev/null @@ -1,22 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/charts/netbox/Chart.lock b/charts/netbox/Chart.lock deleted file mode 100644 index 34dd476..0000000 --- a/charts/netbox/Chart.lock +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: -- name: postgresql - repository: https://charts.bitnami.com/bitnami - version: 8.7.3 -- name: redis - repository: https://charts.bitnami.com/bitnami - version: 10.6.3 -digest: sha256:c77a0b49446cf2e16b24910a37bc297bd5902769b285f49b7d1762d0c3ffafc5 -generated: "2020-04-09T19:09:34.941875689+02:00" diff --git a/charts/netbox/Chart.yaml b/charts/netbox/Chart.yaml deleted file mode 100644 index 3f9f14f..0000000 --- a/charts/netbox/Chart.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- -apiVersion: v2 -appVersion: "v2.9.3" -description: "[DEPRECATED] This chart is not maintained anymore, we advise migrating to bootc/netbox" -name: netbox -version: 1.2.10 -icon: https://github.com/netbox-community/netbox/raw/develop/docs/netbox_logo.svg?sanitize=true -home: https://netbox.readthedocs.io/en/stable/ -sources: - - https://github.com/enix/helm-charts/tree/master/charts/netbox - - https://github.com/netbox-community/netbox - - https://github.com/netbox-community/netbox-docker -dependencies: - - name: postgresql - version: '>=8.7.3' - repository: https://charts.bitnami.com/bitnami - condition: postgresql.enabled - - name: redis - version: '>=10.6.3' - repository: https://charts.bitnami.com/bitnami - condition: redis.enabled -maintainers: - - name: Antoine Millet - email: antoine@inaps.org - url: https://github.com/NaPs - - name: Zempashi - email: julien.girardin@enix.fr - url: https//github.com/Zempashi - -annotations: - artifacthub.io/changes: | - - "Deprecation Notice: This chart is not maintained anymore, we advise migrating to bootc/netbox ; further information at https://github.com/enix/helm-charts/issues/50" - artifacthub.io/recommendations: | - - url: https://artifacthub.io/packages/helm/bootc/netbox diff --git a/charts/netbox/README.md b/charts/netbox/README.md deleted file mode 100644 index 7178061..0000000 --- a/charts/netbox/README.md +++ /dev/null @@ -1,151 +0,0 @@ -netbox -====== - -
- -NetBox is an open source web application designed to help manage and document computer networks. - -## TL;DR; - -```bash -$ helm repo add enix https://charts.enix.io/ -$ helm install my-release enix/netbox -``` - -Source code can be found [here](https://netbox.readthedocs.io/en/stable/) - -## Chart Requirements - -| Repository | Name | Version | -|------------|------|---------| -| https://charts.bitnami.com/bitnami | postgresql | >=8.7.3 | -| https://charts.bitnami.com/bitnami | redis | >=10.6.3 | - -## Installing the Chart - -To install the chart with the release name `my-release`: - -```bash -$ helm install my-release enix/netbox -``` - -The command deploys Netbox on the Kubernetes cluster in the default configuration. The [Chart Values](#chart-values) section lists the parameters that can be configured during installation. - -> **Tip**: List all releases using `helm list` - -## Uninstalling the Chart - -To uninstall/delete the `my-release` deployment: - -```bash -$ helm delete my-release -``` - -The command removes all the Kubernetes components associated with the chart and deletes the release. - -## Chart Values - -| Key | Type | Default | Description | -|-----|------|---------|-------------| -| affinity | object | `{}` | affinity configuration on Netbox Pod | -| allowedHosts | string | `"*"` | "ALLOWED_HOSTS" in Netbox configuration | -| deployment.replicaCount | int | `1` | Number of Netbox Pods to run (Deployment mode) | -| emailFrom | string | `nil` | From address of email sent by Netbox | -| emailPassword | string | `""` | Password to use on email server | -| emailPort | int | `25` | SMTP port to use on email server | -| emailServer | string | `nil` | Email server used by Netbox | -| emailTimeout | int | `10` | Timeout in email communications | -| emailUsername | string | `""` | Username to use on email server | -| existingEnvSecret | string | `nil` | Provide secret environment variable. Should contain all netbox's expected secret env vars | -| extraContainers | list | `[]` | | -| extraEnvs | object | `{}` | | -| extraInitContainers | list | `[]` | | -| extraLabels | object | `{}` | Extra labels to add on chart resources | -| extraSecretEnvs | object | `{}` | | -| extraSecrets | object | `{}` | | -| extraStartupScripts | list | `[]` | | -| 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 | -| ingress.annotations | object | `{}` | Ingress annotations | -| ingress.enabled | bool | `false` | Enable ingress controller resource | -| ingress.hosts | list | `["netbox.local"]` | Ingress Hosts | -| ingress.isNginx | bool | `true` | Enable special annotation for Nginx ingress (adds proxy-body-size). See Nginx section. | -| ingress.paths | list | `["/"]` | Ingress Paths | -| ingress.tls | list | `[]` | Ingress TLS | -| initializers | object | `{}` | Netbox initializer file content (mounted in /opt/netbox/initializers/) | -| kind | string | `"StatefulSet"` | Type of deployment (StatefulSet or Deployment) | -| livenessProbe | object | `{"httpGet":{"path":"/api/","port":"http"}}` | livenessProbe configuration on Netbox Pod | -| nameOverride | string | `""` | String to partially override netbox.fullname template with a string (will prepend the release name) | -| nginx.customConfig | string | `nil` | Custom nginx configuration | -| nginx.proxyBodySize | string | `nil` | See: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size | -| nginx.proxyPass | string | `"http://localhost:8001"` | Custom proxypass url | -| nginxImage.pullPolicy | string | `"IfNotPresent"` | Nginx image pull policy | -| nginxImage.repository | string | `"nginx"` | Nginx image | -| nginxImage.tag | string | `"1.17.9-alpine"` | Nginx image version | -| nodeSelector | object | `{}` | nodeSelector configuration on Netbox Pod | -| persistence.accessModes | list | `["ReadWriteOnce"]` | Persistent Volume Access Modes. Only for statefulSet Mode | -| persistence.customVolumeClaims | string | `nil` | Entirely customize VolumeClaims. Only for statefulSet Mode | -| persistence.enabled | bool | `true` | Enable statefulSet persistency | -| persistence.size | string | `"5G"` | Size of data volume. Only for statefulSet Mode | -| persistence.storageClassName | string | `nil` | Storage class of backing PVC. Only for statefulSet Mode | -| postgresql.enabled | bool | `true` | Enable the postgresql sub-chart | -| postgresql.host | string | `nil` | Host of the postgresql server to use | -| postgresql.postgresqlDatabase | string | `"netbox"` | Postgresql database name | -| postgresql.postgresqlPassword | string | `"netbox"` | Postgresql password (DO NOT USE DEFAULT VALUE IN PRODUCTION) | -| postgresql.postgresqlUsername | string | `"netbox"` | Postgresql username | -| readinessProbe | object | `{"httpGet":{"path":"/api/","port":"http"}}` | readinessProbe configuration on Netbox Pod | -| redis.cluster.enabled | bool | `false` | Enable the redis sub-chart cluster-mode | -| redis.enabled | bool | `true` | Enable the redis sub-chart | -| redis.host | string | `nil` | Host of the redis server | -| redis.master.persistence.enabled | bool | `false` | | -| resources | object | `{}` | resources configuration on Netbox Pod | -| restartPolicy | string | `"Always"` | Pods restart policy | -| secretKey | string | `nil` | Netbox django secret key (use long random string) | -| service.port | int | `80` | Port to use to access Netbox | -| service.type | string | `"ClusterIP"` | Kubernetes Service type | -| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | -| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | -| serviceAccount.name | string | `nil` | Name of the service account to use. Default is derived from fullname template | -| statefulSet.replicaCount | int | `1` | Number of Netbox Pods to run (StatefulSet mode) | -| superuser.apiToken | string | `nil` | API access token of the Netbox superuser to create on first launch | -| superuser.email | string | `"admin@example.com"` | Email of the Netbox superuser to create on first launch | -| superuser.name | string | `"admin"` | Username of the Netbox superuser to create on first launch | -| superuser.password | string | `nil` | Password of the Netbox superuser to create on first launch | -| superuserExistingSecret | string | `nil` | Use custom secret for initial superuser credentials. Should contain appropriate environment variable name (eg: SUPERUSER_PASSWORD) | -| superuserSkip | bool | `false` | Don't create superuser on startup. | -| 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 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file diff --git a/charts/netbox/README.md.gotmpl b/charts/netbox/README.md.gotmpl deleted file mode 100644 index 479efd1..0000000 --- a/charts/netbox/README.md.gotmpl +++ /dev/null @@ -1,61 +0,0 @@ -{{ template "chart.header" . }} - - - -{{ template "chart.description" . }} - -## TL;DR; - -```bash -$ helm repo add enix https://charts.enix.io/ -$ helm install my-release enix/netbox -``` - -{{ template "chart.sourceLinkLine" . }} - -{{ template "chart.requirementsSection" . }} - -## Installing the Chart - -To install the chart with the release name `my-release`: - -```bash -$ helm install my-release enix/netbox -``` - -The command deploys Netbox on the Kubernetes cluster in the default configuration. The [Chart Values](#chart-values) section lists the parameters that can be configured during installation. - -> **Tip**: List all releases using `helm list` - -## Uninstalling the Chart - -To uninstall/delete the `my-release` deployment: - -```bash -$ helm delete my-release -``` - -The command removes all the Kubernetes components associated with the chart and deletes the release. - -{{ template "chart.valuesSection" . }} - -## License - -Copyright (c) 2020 ENIX - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file diff --git a/charts/netbox/charts/.gitignore b/charts/netbox/charts/.gitignore deleted file mode 100644 index aa1ec1e..0000000 --- a/charts/netbox/charts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.tgz diff --git a/charts/netbox/templates/NOTES.txt b/charts/netbox/templates/NOTES.txt deleted file mode 100644 index 2a6c82f..0000000 --- a/charts/netbox/templates/NOTES.txt +++ /dev/null @@ -1,4 +0,0 @@ -Deprecation Notice ------------------- - -This chart is not maintained anymore, we advise migrating to https://artifacthub.io/packages/helm/bootc/netbox diff --git a/charts/netbox/templates/_helpers.tpl b/charts/netbox/templates/_helpers.tpl deleted file mode 100644 index 05d8eb0..0000000 --- a/charts/netbox/templates/_helpers.tpl +++ /dev/null @@ -1,103 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "netbox.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "netbox.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "netbox.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - - -{{/* -Common labels -*/}} -{{- define "netbox.labels" -}} -helm.sh/chart: {{ include "netbox.chart" . }} -{{ include "netbox.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{/* -Selector labels -*/}} -{{- define "netbox.selectorLabels" -}} -app.kubernetes.io/name: {{ include "netbox.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "netbox.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (include "netbox.fullname" .) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{- define "netbox.env.configMapName" -}} -{{ include "netbox.fullname" . }}-env -{{- end -}} - -{{- define "netbox.env.secretName" -}} -{{ include "netbox.fullname" . }}-env -{{- end -}} - -{{- define "netbox.superuser.secretName" -}} -{{ include "netbox.fullname" . }}-superuser -{{- end -}} - -{{- define "netbox.nginxConfigName" -}} -{{ include "netbox.fullname" . }}-nginx -{{- end -}} - -{{- define "netbox.initializersConfigName" -}} -{{ 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 -*/}} -{{- define "call-nested" }} -{{- $dot := index . 0 }} -{{- $subchart := index . 1 }} -{{- $template := index . 2 }} -{{- include $template (dict "Chart" (dict "Name" $subchart) "Values" (index $dot.Values $subchart) "Release" $dot.Release "Capabilities" $dot.Capabilities) }} -{{- end }} diff --git a/charts/netbox/templates/_netbox.tpl b/charts/netbox/templates/_netbox.tpl deleted file mode 100644 index bd410ac..0000000 --- a/charts/netbox/templates/_netbox.tpl +++ /dev/null @@ -1,150 +0,0 @@ -{{- define "netbox.common" -}} -{{- $netboxEnv := include (print $.Template.BasePath "/env-configmap.yaml") . }} -{{- $netboxSecretEnv := include (print $.Template.BasePath "/env-secret.yaml") . }} -{{- $nginxConfig := include (print $.Template.BasePath "/nginx-configmap.yaml") . }} -selector: - matchLabels: - {{- include "netbox.selectorLabels" . | nindent 4 }} -{{- with .Values.statefulSet.updateStrategy }} -updateStrategy: - {{- toYaml . | nindent 2 }} -{{- end }} -template: - metadata: - labels: - {{- include "netbox.selectorLabels" . | nindent 8 }} - annotations: - checksum/config: {{ print "%s%s%s" $netboxEnv $netboxSecretEnv $nginxConfig | sha256sum }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 6 }} - {{- end }} - serviceAccountName: {{ include "netbox.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 6 }} - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ include "netbox.imageTag" . }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - resources: - {{- toYaml .Values.resources | nindent 10 }} - envFrom: - - configMapRef: - name: {{ include "netbox.env.configMapName" . | quote }} - - secretRef: - {{- if .Values.existingEnvSecret }} - name: {{ .Values.existingEnvSecret | quote }} - {{- else }} - name: {{ include "netbox.env.secretName" . | quote }} - {{- end }} - {{- if not .Values.superuserSkip }} - - secretRef: - {{- if .Values.superuserExistingSecret }} - name: {{ .Values.superuserExistingSecret |quote }} - {{- else }} - name: {{ include "netbox.superuser.secretName" . | quote }} - {{- end }} - optional: true - {{- end }} -{{- if or (or .Values.postgresql.enabled .Values.redis.enabled) .Values.redis.existingSecret }} - env: -{{- if or .Values.postgresql.enabled .Values.postgresql.existingSecret}} - - name: DB_PASSWORD - valueFrom: - secretKeyRef: -{{- if .Values.postgresql.existingSecret }} - name: {{ .Values.postgresql.existingSecret | quote }} -{{- else }} - name: {{ include "call-nested" (list . "postgresql" "postgresql.fullname") | quote }} -{{- end }} - key: "postgresql-password" -{{- end }} -{{- if or .Values.redis.enabled .Values.redis.existingSecret }} - - name: REDIS_PASSWORD - valueFrom: - secretKeyRef: -{{- if .Values.redis.existingSecret }} - name: {{ .Values.redis.existingSecret | quote}} -{{- else }} - name: {{ include "call-nested" (list . "redis" "redis.fullname") | quote }} -{{- end }} - key: 'redis-password' -{{- end }} -{{- end }} - volumeMounts: - - name: netbox-static-files - mountPath: /opt/netbox/netbox/static/ - - name: netbox-media-files - mountPath: /etc/netbox/media - {{- if .Values.initializers }} - - name: netbox-initializers - mountPath: /opt/netbox/initializers/ - {{- end }} - {{- range $mount := .Values.extraVolumeMounts }} - - {{ $mount | toYaml | indent 10 | trim }} - {{- end }} - - name: nginx - image: "{{ .Values.nginxImage.repository }}:{{ .Values.nginxImage.tag }}" - imagePullPolicy: {{ .Values.nginxImage.pullPolicy }} - command: ["nginx"] - args: ["-c", "/etc/netbox-nginx/nginx.conf", "-g", "daemon off;"] - ports: - - name: http - containerPort: 80 - protocol: TCP - {{- with .Values.livenessProbe }} - livenessProbe: - {{ . | toYaml | indent 10 | trim }} - {{- end }} - {{- with .Values.readinessProbe }} - readinessProbe: - {{ . | toYaml | indent 10 | trim }} - {{- end }} - volumeMounts: - - name: nginx-config - mountPath: /etc/netbox-nginx/ - - name: netbox-static-files - mountPath: /opt/netbox/netbox/static - {{- with .Values.extraVolumeMounts }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- range $container := .Values.extraContainers }} - - {{ $container | toYaml | indent 8 | trim }} - {{- end }} - {{- if .Values.extraInitContainers }} - initContainers: - {{ toYaml .Values.extraInitContainers | nindent 4}} - {{- end }} - restartPolicy: {{ .Values.restartPolicy }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 6 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 6 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 6 }} - {{- end }} - volumes: - {{- range $volume := .Values.extraVolumes }} - - {{ $volume | toYaml | indent 6 | trim }} - {{- end }} - {{- if .Values.initializers }} - - name: netbox-initializers - configMap: - name: {{ include "netbox.initializersConfigName" . | quote }} - {{- end }} - - name: nginx-config - configMap: - name: {{ include "netbox.nginxConfigName" . |quote }} - - name: netbox-static-files - emptyDir: {} -{{- if not .Values.persistence.enabled }} - - name: netbox-media-files - emptyDir: {} -{{- end }} -{{- end -}} diff --git a/charts/netbox/templates/deployment.yaml b/charts/netbox/templates/deployment.yaml deleted file mode 100644 index b3e3204..0000000 --- a/charts/netbox/templates/deployment.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if eq .Values.kind "Deployment" }} -{{- if .Values.persistence.enabled }} -{{ $error := required "With Deployment and persistence.enabled, a volume named \"netwox-media-files\" should be set via .Values.extraVolumes" .Values.extraVolumes }} -{{- end }} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "netbox.fullname" . }} - labels: - {{- include "netbox.labels" . | nindent 4 }} - {{- with .Values.extraLabels }} - {{ . | toYaml | trim | nindent 4 }} - {{- end }} -spec: - replicas: {{ .Values.deployment.replicaCount }} -{{ include "netbox.common" . | indent 2 }} -{{- end }} diff --git a/charts/netbox/templates/env-configmap.yaml b/charts/netbox/templates/env-configmap.yaml deleted file mode 100644 index 9763dda..0000000 --- a/charts/netbox/templates/env-configmap.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "netbox.env.configMapName" . }} - labels: - {{- include "netbox.labels" . | nindent 4 }} -data: -{{- if or .Values.postgresql.host (not .Values.postgresql.enabled) }} - DB_HOST: {{ required "If you disable built-in postgres, you must provide \"postgresql.host\"" .Values.postgresql.host | quote }} -{{- else }} - DB_HOST: {{ include "call-nested" (list . "postgresql" "postgresql.fullname") |quote }} -{{- end }} -{{- if or .Values.redis.host (not .Values.redis.enabled) }} - REDIS_HOST: {{ required "If you disable built-in redis, you must provide \"redis.host\"" .Values.redis.host | quote }} -{{- else }} - REDIS_HOST: '{{ include "call-nested" (list . "redis" "redis.fullname") }}-master' -{{- end }} - REDIS_PORT: '{{ .Values.redis.master.service.port }}' - DB_NAME: '{{ .Values.postgresql.postgresqlDatabase }}' - ALLOWED_HOSTS: '{{ .Values.allowedHosts }}' - EMAIL_FROM: '{{ .Values.emailFrom }}' - EMAIL_PORT: '{{ .Values.emailPort }}' - EMAIL_SERVER: '{{ .Values.emailServer }}' - EMAIL_TIMEOUT: '{{ .Values.emailTimeout }}' - SKIP_SUPERUSER: {{ .Values.superuserSkip | ternary "true" "false" | quote }} -{{- range $key, $value := .Values.extraEnvs }} - {{ $key }}: '{{ $value }}' -{{- end }} diff --git a/charts/netbox/templates/env-secret.yaml b/charts/netbox/templates/env-secret.yaml deleted file mode 100644 index 5a60dd4..0000000 --- a/charts/netbox/templates/env-secret.yaml +++ /dev/null @@ -1,30 +0,0 @@ -{{- if not .Values.existingEnvSecret }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "netbox.env.secretName" . }} - labels: - {{- include "netbox.labels" . | nindent 4 }} -data: - DB_USER: {{ .Values.postgresql.postgresqlUsername | b64enc | quote }} -{{- if not .Values.postgresql.enabled }} - DB_PASSWORD: {{ .Values.postgresql.postgresqlPassword | b64enc | quote }} -{{- end }} -{{- if .Values.redis.password }} - REDIS_PASSWORD: {{ .Values.redis.password |b64enc | quote }} -{{- end }} -{{- if .Values.secretKey }} - SECRET_KEY: {{ .Values.secretKey | b64enc | quote }} -{{- else }} - SECRET_KEY: {{ randAscii 50 | trimall "'" | b64enc | quote }} -{{- end }} -{{- with .Values.emailUsername }} - EMAIL_USERNAME: {{ . | b64enc | quote }} -{{- end }} -{{- with .Values.emailPassword }} - EMAIL_PASSWORD: {{ . | b64enc | quote }} -{{- end }} -{{- range $key, $value := .Values.extraSecretEnvs }} - {{ $key }}: {{ $value | b64enc | quote }} -{{- end }} -{{- end }} diff --git a/charts/netbox/templates/extra-secret.yaml b/charts/netbox/templates/extra-secret.yaml deleted file mode 100644 index 8e401d5..0000000 --- a/charts/netbox/templates/extra-secret.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.extraSecrets }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "netbox.fullname" . }}-secret - labels: - {{- include "netbox.labels" . | nindent 4 }} -data: -{{- range $key, $value := .Values.extraSecrets }} - {{ $key }}: {{ $value | b64enc | quote }} -{{- end }} -{{- end }} diff --git a/charts/netbox/templates/ingress.yaml b/charts/netbox/templates/ingress.yaml deleted file mode 100644 index 4bd6272..0000000 --- a/charts/netbox/templates/ingress.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "netbox.fullname" . -}} -{{- $ingressPaths := .Values.ingress.paths -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "netbox.labels" . | nindent 4 }} - {{- if or .Values.ingress.annotations (and .Values.ingress.isNginx .Values.nginx.proxyBodySize) }} - annotations: - {{- if and .Values.ingress.isNginx .Values.nginx.proxyBodySize }} - nginx.ingress.kubernetes.io/proxy-body-size: '{{ .Values.nginx.proxyBodySize }}' - {{ end }} - {{- with .Values.ingress.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ . | quote }} - http: - paths: - {{- range $ingressPaths }} - - path: {{ . }} - backend: - serviceName: {{ $fullName }} - servicePort: http - {{- end }} - {{- end }} -{{- end }} diff --git a/charts/netbox/templates/initializers-configmap.yaml b/charts/netbox/templates/initializers-configmap.yaml deleted file mode 100644 index e737dda..0000000 --- a/charts/netbox/templates/initializers-configmap.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Values.initializers }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "netbox.initializersConfigName" . | quote }} - labels: - {{- include "netbox.labels" . | nindent 4 }} -data: -{{- range $key, $value := .Values.initializers }} - {{ $key }}: | - {{ $value | indent 4 | trim }} -{{- end }} -{{- end }} diff --git a/charts/netbox/templates/nginx-configmap.yaml b/charts/netbox/templates/nginx-configmap.yaml deleted file mode 100644 index 1eed8c7..0000000 --- a/charts/netbox/templates/nginx-configmap.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "netbox.nginxConfigName" . }} - labels: - {{- include "netbox.labels" . | nindent 4 }} -data: - nginx.conf: | -{{- if .Values.nginx.customConfig }} -{{ .Values.nginx.customConfig | indent 4 }} -{{- else }} - worker_processes 1; - events { - worker_connections 1024; - } - http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - sendfile on; - tcp_nopush on; - keepalive_timeout 65; - gzip on; - server_tokens off; - server { - listen 80; - access_log off; - location /static/ { - alias /opt/netbox/netbox/static/; - } - location / { - proxy_pass {{ .Values.nginx.proxyPass }}; - {{- with .Values.nginx.proxyBodySize }} - client_max_body_size {{.}}; - {{- end }} - proxy_set_header X-Forwarded-Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'; - } - } - } -{{- end }} diff --git a/charts/netbox/templates/service.yaml b/charts/netbox/templates/service.yaml deleted file mode 100644 index c3febd7..0000000 --- a/charts/netbox/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "netbox.fullname" . }} - labels: - app.kubernetes.io/name: {{ include "netbox.name" . }} - helm.sh/chart: {{ include "netbox.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - app.kubernetes.io/name: {{ include "netbox.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/charts/netbox/templates/serviceaccount.yaml b/charts/netbox/templates/serviceaccount.yaml deleted file mode 100644 index 3c13d32..0000000 --- a/charts/netbox/templates/serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "netbox.serviceAccountName" . }} - labels: - {{- include "netbox.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end -}} - diff --git a/charts/netbox/templates/statefulset.yaml b/charts/netbox/templates/statefulset.yaml deleted file mode 100644 index 3cf6fd0..0000000 --- a/charts/netbox/templates/statefulset.yaml +++ /dev/null @@ -1,41 +0,0 @@ -{{- if eq .Values.kind "StatefulSet" }} -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ include "netbox.fullname" . }} - labels: - {{- include "netbox.labels" . | nindent 4 }} - {{- with .Values.extraLabels }} - {{ . | toYaml | trim | nindent 4 }} - {{- end }} -spec: - replicas: {{ .Values.statefulSet.replicaCount }} - serviceName: 'netbox' -{{ include "netbox.common" . | indent 2 }} -{{- if .Values.persistence.enabled }} - volumeClaimTemplates: -{{- if .Values.persistence.customClaims }} - {{ .Values.persistence.customClaims | toYaml | nindent 2 }} -{{- else }} - - spec: - accessModes: - {{- range .Values.persistence.accessModes }} - - {{ . | quote }} - {{- end }} - resources: - requests: - storage: "{{.Values.persistence.size }}" - {{- if .Values.persistence.storageClassName }} - {{- if (eq "-" .Values.persistence.storageClassName) }} - storageClassName: "" - {{- else }} - storageClassName: "{{ .Values.persistence.storageClassName }}" - {{- end }} - {{- end }} - metadata: - name: netbox-media-files - labels: - {{- include "netbox.labels" . | nindent 8 }} -{{- end }} -{{- end }} -{{- end }} diff --git a/charts/netbox/templates/superuser-secret.yaml b/charts/netbox/templates/superuser-secret.yaml deleted file mode 100644 index 90aeb15..0000000 --- a/charts/netbox/templates/superuser-secret.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{{- if not .Values.superuserSkip }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "netbox.superuser.secretName" . }} - labels: - {{- include "netbox.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": pre-install -data: - SUPERUSER_NAME: {{ .Values.superuser.name | b64enc | quote }} - SUPERUSER_EMAIL: {{ .Values.superuser.email | b64enc | quote }} -{{- if .Values.superuser.password }} - SUPERUSER_PASSWORD: {{ .Values.superuser.password | b64enc | quote }} -{{- else }} - SUPERUSER_PASSWORD: {{ randAlphaNum 14 | b64enc | quote }} -{{- end }} -{{- if .Values.superuser.apiToken }} - SUPERUSER_API_TOKEN: {{ .Values.superuser.apiToken | b64enc | quote }} -{{- else }} - SUPERUSER_API_TOKEN: {{ randAlphaNum 40 | b64enc | quote }} -{{- end }} -{{- end }} diff --git a/charts/netbox/templates/tests/test-connection.yaml b/charts/netbox/templates/tests/test-connection.yaml deleted file mode 100644 index b10f374..0000000 --- a/charts/netbox/templates/tests/test-connection.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "netbox.fullname" . }}-test-connection" - labels: - app.kubernetes.io/name: {{ include "netbox.name" . }} - helm.sh/chart: {{ include "netbox.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - annotations: - "helm.sh/hook": test-success -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "netbox.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/charts/netbox/values.yaml b/charts/netbox/values.yaml deleted file mode 100644 index da53c6f..0000000 --- a/charts/netbox/values.yaml +++ /dev/null @@ -1,204 +0,0 @@ ---- -# Default values for netbox. -# -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -# kind -- Type of deployment (StatefulSet or Deployment) -kind: StatefulSet - -statefulSet: - # statefulSet.replicaCount -- Number of Netbox Pods to run (StatefulSet mode) - replicaCount: 1 - -deployment: - # deployment.replicaCount -- Number of Netbox Pods to run (Deployment mode) - replicaCount: 1 - -# updateStrategy -- Update strategy policy -updateStrategy: - type: RollingUpdate - -serviceAccount: - # serviceAccount.create -- Specifies whether a service account should be created - create: true - # serviceAccount.annotations -- Annotations to add to the service account - annotations: {} - # serviceAccount.name -- Name of the service account to use. Default is derived from fullname template - name: - - - -# extraLabels -- Extra labels to add on chart resources -extraLabels: {} - -image: - # image.repository -- Netbox image - repository: netboxcommunity/netbox - # image.tag -- Netbox image version - 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 - repository: nginx - # nginxImage.tag -- Nginx image version - tag: 1.17.9-alpine - # nginxImage.pullPolicy -- Nginx image pull policy - pullPolicy: IfNotPresent - -# restartPolicy -- Pods restart policy -restartPolicy: Always - -# nameOverride -- String to partially override netbox.fullname template with a string (will prepend the release name) -nameOverride: "" -# fullnameOverride -- String to fully override netbox.fullname template with a string -fullnameOverride: "" - -service: - # service.type -- Kubernetes Service type - type: ClusterIP - # service.port -- Port to use to access Netbox - port: 80 - -# initializers -- Netbox initializer file content (mounted in /opt/netbox/initializers/) -initializers: {} - -ingress: - # ingress.enabled -- Enable ingress controller resource - enabled: false - # ingress.isNginx -- Enable special annotation for Nginx ingress (adds proxy-body-size). See Nginx section. - isNginx: true - # ingress.annotations -- Ingress annotations - annotations: {} - # ingress.paths -- Ingress Paths - paths: - - / - # ingress.hosts -- Ingress Hosts - hosts: - - netbox.local - # ingress.tls -- Ingress TLS - tls: [] - # - secretName: netbox - # hosts: - # - netbox.local - -persistence: - # persistence.enabled -- Enable statefulSet persistency - enabled: true - # persistence.accessModes -- Persistent Volume Access Modes. Only for statefulSet Mode - accessModes: - - 'ReadWriteOnce' - # persistence.size -- Size of data volume. Only for statefulSet Mode - size: "5G" - # persistence.storageClassName -- Storage class of backing PVC. Only for statefulSet Mode - storageClassName: - # persistence.customVolumeClaims -- Entirely customize VolumeClaims. Only for statefulSet Mode - customVolumeClaims: - -# livenessProbe -- livenessProbe configuration on Netbox Pod -livenessProbe: - httpGet: - path: /api/ - port: http - -# readinessProbe -- readinessProbe configuration on Netbox Pod -readinessProbe: - httpGet: - path: /api/ - port: http - -# resources -- resources configuration on Netbox Pod -resources: {} - -# nodeSelector -- nodeSelector configuration on Netbox Pod -nodeSelector: {} - -# tolerations -- tolerations to add on Netbox Pod -tolerations: [] - -# affinity -- affinity configuration on Netbox Pod -affinity: {} - -# allowedHosts -- "ALLOWED_HOSTS" in Netbox configuration -allowedHosts: "*" -# emailFrom -- From address of email sent by Netbox -emailFrom: -# emailServer -- Email server used by Netbox -emailServer: -# emailPort -- SMTP port to use on email server -emailPort: 25 -# emailTimeout -- Timeout in email communications -emailTimeout: 10 -# emailUsername -- Username to use on email server -emailUsername: "" -# emailPassword -- Password to use on email server -emailPassword: "" - -# secretKey -- Netbox django secret key (use long random string) -secretKey: - -# superuserSkip -- Don't create superuser on startup. -superuserSkip: false - -# superuserExistingSecret -- Use custom secret for initial superuser credentials. -# Should contain appropriate environment variable name (eg: SUPERUSER_PASSWORD) -superuserExistingSecret: - -superuser: - # superuser.email -- Email of the Netbox superuser to create on first launch - email: admin@example.com - # superuser.name -- Username of the Netbox superuser to create on first launch - name: admin - # superuser.password -- Password of the Netbox superuser to create on first launch - password: - # superuser.apiToken -- API access token of the Netbox superuser to create on first launch - apiToken: - -# existingEnvSecret -- Provide secret environment variable. Should contain all netbox's expected secret env vars -existingEnvSecret: - -extraEnvs: {} -extraSecretEnvs: {} -extraSecrets: {} -extraVolumes: [] -extraVolumeMounts: [] -extraContainers: [] -extraInitContainers: [] -extraStartupScripts: [] - -nginx: - # nginx.proxyBodySize -- See: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size - proxyBodySize: - # nginx.customConfig -- Custom nginx configuration - customConfig: - # nginx.proxyPass -- Custom proxypass url - proxyPass: http://localhost:8001 - -postgresql: - # postgresql.enabled -- Enable the postgresql sub-chart - enabled: true - # postgresql.host -- Host of the postgresql server to use - host: - # postgresql.postgresqlPassword -- Postgresql password (DO NOT USE DEFAULT VALUE IN PRODUCTION) - postgresqlPassword: netbox - # postgresql.postgresqlUsername -- Postgresql username - postgresqlUsername: netbox - # postgresql.postgresqlDatabase -- Postgresql database name - postgresqlDatabase: netbox - -redis: - cluster: - # redis.cluster.enabled -- Enable the redis sub-chart cluster-mode - enabled: false - # redis.enabled -- Enable the redis sub-chart - enabled: true - # redis.host -- Host of the redis server - host: - master: - persistence: - # redis.master.persistence.enable -- Persistence for redis, not really needed for netbox - enabled: false