diff options
Diffstat (limited to 'kubernetes/contrib/charts/netbox/charts/netbox-app/templates')
7 files changed, 372 insertions, 0 deletions
diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/NOTES.txt b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/NOTES.txt new file mode 100755 index 0000000000..e70c418864 --- /dev/null +++ b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/NOTES.txt @@ -0,0 +1,33 @@ +# Copyright © 2018 Amdocs, Bell Canada +# +# 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. + +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "common.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ include "common.fullname" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} +{{- end }} diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/configmap.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/configmap.yaml new file mode 100755 index 0000000000..388d224569 --- /dev/null +++ b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/configmap.yaml @@ -0,0 +1,39 @@ +{{/* +# Copyright © 2018 Amdocs, Bell Canada +# +# 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. +*/}} + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-configuration-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/configuration/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-initializers-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/initializers/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-startupscripts-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/startup_scripts/*").AsConfig . | indent 2 }} diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/deployment.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/deployment.yaml new file mode 100755 index 0000000000..f321456ac0 --- /dev/null +++ b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/deployment.yaml @@ -0,0 +1,139 @@ +{{/* +# Copyright © 2018 Amdocs, Bell Canada +# +# 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. +*/}} + +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: {{ include "common.name" . }} + image: {{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + env: + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }}-pass + key: DB_PASSWORD + - name: EMAIL_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }}-pass + key: EMAIL_PASSWORD + - name: NAPALM_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }}-pass + key: NAPALM_PASSWORD + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }}-pass + key: SECRET_KEY + - name: SUPERUSER_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }}-pass + key: SUPERUSER_PASSWORD + - name: SUPERUSER_API_TOKEN + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }}-pass + key: SUPERUSER_API_TOKEN + - name: ALLOWED_HOSTS + value: {{ .Values.config.allowedHosts | quote }} + - name: DB_NAME + value: {{ .Values.config.dbName }} + - name: DB_USER + value: {{ .Values.config.dbUser }} + - name: DB_HOST + value: {{ .Values.config.dbHost }} + - name: EMAIL_SERVER + value: {{ .Values.config.emailServer }} + - name: EMAIL_PORT + value: {{ .Values.config.emailPort | quote }} + - name: EMAIL_USERNAME + value: {{ .Values.config.emailUsername }} + - name: EMAIL_TIMEOUT + value: {{ .Values.config.emailTimeout | quote }} + - name: EMAIL_FROM + value: {{ .Values.config.emailFrom }} + - name: MEDIA_ROOT + value: {{ .Values.config.mediaRoot }} + - name: NAPALM_USERNAME + value: {{ .Values.config.napalmUsername }} + - name: NAPALM_TIMEOUT + value: {{ .Values.config.napalmTimeout | quote }} + - name: MAX_PAGE_SIZE + value: {{ .Values.config.maxPageSize | quote }} + - name: SUPERUSER_NAME + value: {{ .Values.config.superuserName }} + - name: SUPERUSER_EMAIL + value: {{ .Values.config.superuserEmail }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /opt/netbox/startup_scripts + name: {{ include "common.fullname" . }}-startupscripts-config + - mountPath: /opt/netbox/initializers + name: {{ include "common.fullname" . }}-initializers-config + - mountPath: /etc/netbox/config + name: {{ include "common.fullname" . }}-configuration-config + - name: {{ include "common.fullname" . }} + mountPath: /opt/netbox/netbox/static + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }} + persistentVolumeClaim: + claimName: {{ .Release.Name }}-{{ .Values.persistence.staticPvName }} + - name: {{ include "common.fullname" . }}-startupscripts-config + configMap: + name: {{ include "common.fullname" . }}-startupscripts-configmap + - name: {{ include "common.fullname" . }}-initializers-config + configMap: + name: {{ include "common.fullname" . }}-initializers-configmap + - name: {{ include "common.fullname" . }}-configuration-config + configMap: + name: {{ include "common.fullname" . }}-configuration-configmap
\ No newline at end of file diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pv.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pv.yaml new file mode 100755 index 0000000000..eacd4959e8 --- /dev/null +++ b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pv.yaml @@ -0,0 +1,37 @@ +{{/* +# Copyright © 2018 Amdocs, Bell Canada +# +# 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. +*/}} + +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ .Release.Name }}-{{ .Values.persistence.staticPvName }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + name: {{ .Release.Name }}-{{ .Values.persistence.staticPvName }} +spec: + capacity: + storage: {{ .Values.persistence.size}} + accessModes: + - {{ .Values.persistence.accessMode }} + persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} + hostPath: + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/app +{{- end -}} diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pvc.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pvc.yaml new file mode 100755 index 0000000000..b911d239e5 --- /dev/null +++ b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/pvc.yaml @@ -0,0 +1,48 @@ +{{/* +# Copyright © 2018 Amdocs, Bell Canada +# +# 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. +*/}} + +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ .Release.Name }}-{{ .Values.persistence.staticPvName }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + {{- if .Values.persistence.annotations }} + annotations: +{{ toYaml .Values.persistence.annotations | indent 4 }} + {{- end }} +spec: + selector: + matchLabels: + name: {{ .Release.Name }}-{{ .Values.persistence.staticPvName }} + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size }} + {{- if .Values.persistence.storageClass }} + {{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" + {{- end }} + {{- end }} +{{- end -}}
\ No newline at end of file diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/secrets.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/secrets.yaml new file mode 100755 index 0000000000..2ded35b660 --- /dev/null +++ b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/secrets.yaml @@ -0,0 +1,34 @@ +{{/* +# Copyright © 2018 Bell Canada, Amdocs +# +# 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. +*/}} + +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.fullname" . }}-pass + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +type: Opaque +data: + DB_PASSWORD: {{ .Values.config.dbPassword | b64enc | quote }} + EMAIL_PASSWORD: {{ .Values.config.emailPassword | b64enc | quote }} + NAPALM_PASSWORD: {{ .Values.config.napalmPassword | b64enc | quote }} + SECRET_KEY: {{ .Values.config.secretKey | b64enc | quote }} + SUPERUSER_PASSWORD: {{ .Values.config.superuserPassword | b64enc | quote }} + SUPERUSER_API_TOKEN: {{ .Values.config.superuserAPIToken | b64enc | quote }}
\ No newline at end of file diff --git a/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/service.yaml b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/service.yaml new file mode 100755 index 0000000000..1eff4716eb --- /dev/null +++ b/kubernetes/contrib/charts/netbox/charts/netbox-app/templates/service.yaml @@ -0,0 +1,42 @@ +{{/* +# Copyright © 2018 Amdocs, Bell Canada +# +# 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. +*/}} + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.servicename" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.internalPort }} + name: {{ include "common.name" . }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + {{- else -}} + - port: {{ .Values.service.externalPort }} + name: {{ include "common.name" . }} + targetPort: {{ .Values.service.internalPort }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} |