feat(mongodb): add-mongodb (#2307)
* add-mongodb * fix secret * Update charts/dependency/mongodb/Chart.yaml * Update charts/dependency/mongodb/templates/secret.yaml * Update charts/dependency/mongodb/Chart.yaml * Update charts/dependency/mongodb/values.yaml * Update charts/dependency/mongodb/values.yaml * Update charts/dependency/mongodb/values.yaml * Update charts/dependency/mongodb/values.yaml * Update charts/dependency/mongodb/values.yaml * Update charts/dependency/mongodb/values.yaml * test probes * escape * test hardcoded 1st * hmm * again * different syntax * var * try different * revert * quit * try rootless? * adjust questions * Update charts/dependency/mongodb/values.yaml Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
This commit is contained in:
24
charts/dependency/mongodb/.helmignore
Normal file
24
charts/dependency/mongodb/.helmignore
Normal file
@@ -0,0 +1,24 @@
|
||||
# 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/
|
||||
# OWNERS file for Kubernetes
|
||||
OWNERS
|
||||
31
charts/dependency/mongodb/Chart.yaml
Normal file
31
charts/dependency/mongodb/Chart.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
apiVersion: v2
|
||||
appVersion: "4.2.19"
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://library-charts.truecharts.org
|
||||
version: 9.1.15
|
||||
deprecated: false
|
||||
description: Fast, reliable, scalable, and easy to use open-source no-sql database system.
|
||||
home: https://github.com/truecharts/apps/tree/master/stable/mongodb
|
||||
icon: https://truecharts.org/_static/img/appicons/mongodb.png
|
||||
keywords:
|
||||
- mongodb
|
||||
- database
|
||||
- nosql
|
||||
kubeVersion: '>=1.16.0-0'
|
||||
maintainers:
|
||||
- email: info@truecharts.org
|
||||
name: TrueCharts
|
||||
url: https://truecharts.org
|
||||
name: mongodb
|
||||
sources:
|
||||
- https://hub.docker.com/r/bitnami/mongodb
|
||||
- https://github.com/bitnami/bitnami-docker-mongodb
|
||||
- https://www.mongodb.com
|
||||
type: application
|
||||
version: 0.0.1
|
||||
annotations:
|
||||
truecharts.org/catagories: |
|
||||
- database
|
||||
truecharts.org/SCALE-support: "true"
|
||||
truecharts.org/grade: U
|
||||
303
charts/dependency/mongodb/questions.yaml
Normal file
303
charts/dependency/mongodb/questions.yaml
Normal file
@@ -0,0 +1,303 @@
|
||||
# Include{groups}
|
||||
questions:
|
||||
- variable: portal
|
||||
group: "Container Image"
|
||||
label: "Configure Portal Button"
|
||||
schema:
|
||||
type: dict
|
||||
hidden: true
|
||||
attrs:
|
||||
- variable: enabled
|
||||
label: "Enable"
|
||||
description: "enable the portal button"
|
||||
schema:
|
||||
hidden: true
|
||||
editable: false
|
||||
type: boolean
|
||||
default: false
|
||||
# Include{global}
|
||||
- variable: controller
|
||||
group: "Controller"
|
||||
label: ""
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: advanced
|
||||
label: "Show Advanced Controller Settings"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
show_subquestions_if: true
|
||||
subquestions:
|
||||
- variable: type
|
||||
description: "Please specify type of workload to deploy"
|
||||
label: "(Advanced) Controller Type"
|
||||
schema:
|
||||
type: string
|
||||
default: "statefulset"
|
||||
required: true
|
||||
enum:
|
||||
- value: "deployment"
|
||||
description: "Deployment"
|
||||
- value: "statefulset"
|
||||
description: "Statefulset"
|
||||
- value: "daemonset"
|
||||
description: "Daemonset"
|
||||
- variable: replicas
|
||||
description: "Number of desired pod replicas"
|
||||
label: "Desired Replicas"
|
||||
schema:
|
||||
type: int
|
||||
default: 1
|
||||
required: true
|
||||
- variable: strategy
|
||||
description: "Please specify type of workload to deploy"
|
||||
label: "(Advanced) Update Strategy"
|
||||
schema:
|
||||
type: string
|
||||
default: "RollingUpdate"
|
||||
required: true
|
||||
enum:
|
||||
- value: "Recreate"
|
||||
description: "Recreate: Kill existing pods before creating new ones"
|
||||
- value: "RollingUpdate"
|
||||
description: "RollingUpdate: Create new pods and then kill old ones"
|
||||
- value: "OnDelete"
|
||||
description: "(Legacy) OnDelete: ignore .spec.template changes"
|
||||
# Include{controllerExpert}
|
||||
|
||||
# Include{containerConfig}
|
||||
|
||||
- variable: mongodbDatabase
|
||||
group: "App Configuration"
|
||||
label: "Database Name"
|
||||
schema:
|
||||
type: string
|
||||
default: "mydatabase"
|
||||
required: true
|
||||
- variable: mongodbUsername
|
||||
group: "App Configuration"
|
||||
label: "Database User"
|
||||
schema:
|
||||
type: string
|
||||
default: "mydatabaseuser"
|
||||
required: true
|
||||
- variable: mongodbPassword
|
||||
group: "App Configuration"
|
||||
label: "Database Password"
|
||||
schema:
|
||||
type: string
|
||||
default: ""
|
||||
required: true
|
||||
|
||||
- variable: service
|
||||
group: "Networking and Services"
|
||||
label: "Configure Service(s)"
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: main
|
||||
label: "Main Service"
|
||||
description: "The Primary service on which the healthcheck runs, often the webUI"
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
# Include{serviceSelector}
|
||||
- variable: main
|
||||
label: "Main Service Port Configuration"
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: port
|
||||
label: "Port"
|
||||
description: "This port exposes the container port on the service"
|
||||
schema:
|
||||
type: int
|
||||
default: 27017
|
||||
required: true
|
||||
- variable: advanced
|
||||
label: "Show Advanced settings"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
show_subquestions_if: true
|
||||
subquestions:
|
||||
- variable: protocol
|
||||
label: "Port Type"
|
||||
schema:
|
||||
type: string
|
||||
default: "TCP"
|
||||
enum:
|
||||
- value: HTTP
|
||||
description: "HTTP"
|
||||
- value: "HTTPS"
|
||||
description: "HTTPS"
|
||||
- value: TCP
|
||||
description: "TCP"
|
||||
- value: "UDP"
|
||||
description: "UDP"
|
||||
- variable: nodePort
|
||||
label: "Node Port (Optional)"
|
||||
description: "This port gets exposed to the node. Only considered when service type is NodePort, Simple or LoadBalancer"
|
||||
schema:
|
||||
type: int
|
||||
min: 9000
|
||||
max: 65535
|
||||
- variable: targetPort
|
||||
label: "Target Port"
|
||||
description: "The internal(!) port on the container the Application runs on"
|
||||
schema:
|
||||
type: int
|
||||
default: 27017
|
||||
|
||||
- variable: serviceexpert
|
||||
group: "Networking and Services"
|
||||
label: "Show Expert Config"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
show_subquestions_if: true
|
||||
subquestions:
|
||||
- variable: hostNetwork
|
||||
group: "Networking and Services"
|
||||
label: "Host-Networking (Complicated)"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
# Include{serviceExpert}
|
||||
|
||||
# Include{serviceList}
|
||||
|
||||
- variable: volumeClaimTemplates
|
||||
label: "Integrated Persistent Storage"
|
||||
description: "Integrated Persistent Storage"
|
||||
group: "Storage and Persistence"
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: data
|
||||
label: "DB Storage"
|
||||
description: "Stores the old Application Database."
|
||||
schema:
|
||||
type: dict
|
||||
hidden: true
|
||||
attrs:
|
||||
- variable: type
|
||||
label: "Type of Storage"
|
||||
description: "Sets the persistence type, Anything other than PVC could break rollback!"
|
||||
schema:
|
||||
type: string
|
||||
default: "simplePVC"
|
||||
enum:
|
||||
- value: "simplePVC"
|
||||
description: "PVC (simple)"
|
||||
- value: "pvc"
|
||||
description: "pvc"
|
||||
# Include{persistenceBasic}
|
||||
- variable: hostPath
|
||||
label: "hostPath"
|
||||
description: "Path inside the container the storage is mounted"
|
||||
schema:
|
||||
show_if: [["type", "=", "hostPath"]]
|
||||
type: hostpath
|
||||
- variable: medium
|
||||
label: "EmptyDir Medium"
|
||||
schema:
|
||||
show_if: [["type", "=", "emptyDir"]]
|
||||
type: string
|
||||
default: ""
|
||||
enum:
|
||||
- value: ""
|
||||
description: "Default"
|
||||
- value: "Memory"
|
||||
description: "Memory"
|
||||
# Include{persistenceAdvanced}
|
||||
- variable: mountPath
|
||||
label: "mountPath (Non-editable)"
|
||||
description: "Path inside the container the storage is mounted"
|
||||
schema:
|
||||
type: string
|
||||
default: "/bitnami/mariadb"
|
||||
editable: false
|
||||
valid_chars: '^\/([a-zA-Z0-9._-]+(\s?[a-zA-Z0-9._-]+|\/?))+$'
|
||||
|
||||
# Include{persistenceList}
|
||||
|
||||
# Include{ingressList}
|
||||
|
||||
# Include{security}
|
||||
|
||||
- variable: advancedSecurity
|
||||
label: "Show Advanced Security Settings"
|
||||
group: "Security and Permissions"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
show_subquestions_if: true
|
||||
subquestions:
|
||||
- variable: securityContext
|
||||
label: "Security Context"
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: privileged
|
||||
label: "Privileged mode"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- variable: readOnlyRootFilesystem
|
||||
label: "ReadOnly Root Filesystem"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- variable: allowPrivilegeEscalation
|
||||
label: "Allow Privilege Escalation"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- variable: runAsNonRoot
|
||||
label: "runAsNonRoot"
|
||||
schema:
|
||||
type: boolean
|
||||
default: true
|
||||
# Include{securityContextAdvanced}
|
||||
|
||||
- variable: podSecurityContext
|
||||
group: "Security and Permissions"
|
||||
label: "Pod Security Context"
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: runAsUser
|
||||
label: "runAsUser"
|
||||
description: "The UserID of the user running the application"
|
||||
schema:
|
||||
type: int
|
||||
default: 568
|
||||
- variable: runAsGroup
|
||||
label: "runAsGroup"
|
||||
description: The groupID this App of the user running the application"
|
||||
schema:
|
||||
type: int
|
||||
default: 0
|
||||
- variable: fsGroup
|
||||
label: "fsGroup"
|
||||
description: "The group that should own ALL storage."
|
||||
schema:
|
||||
type: int
|
||||
default: 568
|
||||
# Include{podSecurityContextAdvanced}
|
||||
|
||||
# Include{resources}
|
||||
|
||||
# Include{advanced}
|
||||
|
||||
# Include{addons}
|
||||
1
charts/dependency/mongodb/templates/common.yaml
Normal file
1
charts/dependency/mongodb/templates/common.yaml
Normal file
@@ -0,0 +1 @@
|
||||
{{ include "common.all" . }}
|
||||
14
charts/dependency/mongodb/templates/secret.yaml
Normal file
14
charts/dependency/mongodb/templates/secret.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
{{- with .Values.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
mongodb-password: {{ ( .Values.mongodbPassword | default "empty" ) | b64enc | quote }}
|
||||
mongodb-root-password: {{ ( .Values.mongodbRootPassword | default "empty" ) | b64enc | quote }}
|
||||
116
charts/dependency/mongodb/values.yaml
Normal file
116
charts/dependency/mongodb/values.yaml
Normal file
@@ -0,0 +1,116 @@
|
||||
image:
|
||||
repository: bitnami/mongodb
|
||||
pullPolicy: IfNotPresent
|
||||
tag: 4.4.13@sha256:c78b3d35adaae2efe74aa75be9ca31a9825bf43fd88ae50a674d8cf9915f4a45
|
||||
|
||||
controller:
|
||||
# -- Set the controller type.
|
||||
# Valid options are deployment, daemonset or statefulset
|
||||
type: statefulset
|
||||
# -- Number of desired pods
|
||||
replicas: 1
|
||||
# -- Set the controller upgrade strategy
|
||||
# For Deployments, valid values are Recreate (default) and RollingUpdate.
|
||||
# For StatefulSets, valid values are OnDelete and RollingUpdate (default).
|
||||
# DaemonSets ignore this.
|
||||
strategy: RollingUpdate
|
||||
rollingUpdate:
|
||||
# -- Set deployment RollingUpdate max unavailable
|
||||
unavailable: 1
|
||||
# -- Set deployment RollingUpdate max surge
|
||||
surge:
|
||||
# -- Set statefulset RollingUpdate partition
|
||||
partition:
|
||||
# -- ReplicaSet revision history limit
|
||||
revisionHistoryLimit: 3
|
||||
|
||||
service:
|
||||
main:
|
||||
ports:
|
||||
main:
|
||||
port: 27017
|
||||
targetPort: 27017
|
||||
|
||||
securityContext:
|
||||
readOnlyRootFilesystem: false
|
||||
|
||||
podSecurityContext:
|
||||
runAsGroup: 0
|
||||
|
||||
volumeClaimTemplates:
|
||||
data:
|
||||
enabled: true
|
||||
mountPath: "/bitnami/mongodb"
|
||||
|
||||
# -- Probe configuration
|
||||
# -- [[ref]](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
|
||||
# @default -- See below
|
||||
probes:
|
||||
# -- Liveness probe configuration
|
||||
# @default -- See below
|
||||
liveness:
|
||||
# -- Enable the liveness probe
|
||||
enabled: true
|
||||
# -- Set this to `true` if you wish to specify your own livenessProbe
|
||||
custom: true
|
||||
# -- The spec field contains the values for the default livenessProbe.
|
||||
# If you selected `custom: true`, this field holds the definition of the livenessProbe.
|
||||
# @default -- See below
|
||||
spec:
|
||||
exec:
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- echo "db.runCommand(\"ping\").ok" | mongo --host localhost --port 27017 ${MONGODB_DATABASE} --quiet
|
||||
|
||||
# -- Redainess probe configuration
|
||||
# @default -- See below
|
||||
readiness:
|
||||
# -- Enable the readiness probe
|
||||
enabled: true
|
||||
# -- Set this to `true` if you wish to specify your own readinessProbe
|
||||
custom: true
|
||||
# -- The spec field contains the values for the default readinessProbe.
|
||||
# If you selected `custom: true`, this field holds the definition of the readinessProbe.
|
||||
# @default -- See below
|
||||
spec:
|
||||
exec:
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- echo "db.runCommand(\"ping\").ok" | mongo --host localhost --port 27017 ${MONGODB_DATABASE} --quiet
|
||||
# -- Startup probe configuration
|
||||
# @default -- See below
|
||||
startup:
|
||||
# -- Enable the startup probe
|
||||
enabled: true
|
||||
custom: true
|
||||
# -- The spec field contains the values for the default livenessProbe.
|
||||
# If you selected `custom: true`, this field holds the definition of the livenessProbe.
|
||||
# @default -- See below
|
||||
spec:
|
||||
exec:
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- echo "db.runCommand(\"ping\").ok" | mongo --host localhost --port 27017 ${MONGODB_DATABASE} --quiet
|
||||
|
||||
mongodbPassword: "testpass"
|
||||
mongodbUsername: "test"
|
||||
mongodbDatabase: "test"
|
||||
mongodbRootPassword: "testroot"
|
||||
existingSecret: ""
|
||||
|
||||
envValueFrom:
|
||||
MONGODB_PASSWORD:
|
||||
secretKeyRef:
|
||||
name: '{{ ( tpl .Values.existingSecret $ ) | default ( include "common.names.fullname" . ) }}'
|
||||
key: "mongodb-password"
|
||||
MONGODB_ROOT_PASSWORD:
|
||||
secretKeyRef:
|
||||
name: '{{ ( tpl .Values.existingSecret $ ) | default ( include "common.names.fullname" . ) }}'
|
||||
key: "mongodb-root-password"
|
||||
|
||||
env:
|
||||
MONGODB_USERNAME: "{{ .Values.mongodbUsername }}"
|
||||
MONGODB_DATABASE: "{{ .Values.mongodbDatabase }}"
|
||||
BIN
docs/_static/img/appicons/mongodb.png
vendored
Normal file
BIN
docs/_static/img/appicons/mongodb.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -385,6 +385,7 @@ These defaults can of course be changed, but as we guarantee "sane, working defa
|
||||
| verysync | data | data | 22330 | TCP | |
|
||||
| minecraft-java | main | main | 25565 | TCP | |
|
||||
| minecraft-java | rcon | rcon | 25575 | TCP | |
|
||||
| mongodb | main | main | 27017 | TCP | |
|
||||
| storj-node | coretcp | coretcp | 28967 | TCP | |
|
||||
| storj-node | coreudp | coreudp | 28967 | UDP | |
|
||||
| omada-controller | omada-udp | omada-udp1 | 29810 | UDP | |
|
||||
|
||||
Reference in New Issue
Block a user