Commit new App releases for TrueCharts

Signed-off-by: TrueCharts-Bot <bot@truecharts.org>
This commit is contained in:
TrueCharts-Bot 2021-09-11 19:00:37 +00:00
parent babd693b41
commit 84e83efc46
16 changed files with 1631 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<a name="postgresql-2.1.0"></a>
### [postgresql-2.1.0](https://github.com/truecharts/apps/compare/postgresql-2.0.0...postgresql-2.1.0) (2021-09-11)
#### Chore
* Use bitnami instead of stock postgresql container ([#960](https://github.com/truecharts/apps/issues/960))
* update non-major
#### Feat
* pin all container references to digests ([#963](https://github.com/truecharts/apps/issues/963))
#### Fix
* make sure podSecurityContext is included in both SCALE and Helm installs ([#956](https://github.com/truecharts/apps/issues/956))
* move runAsNonRoot to container securityContext to allow root sidecarts ([#954](https://github.com/truecharts/apps/issues/954))

View File

@ -0,0 +1,8 @@
# Configuration Options
##### Connecting to other apps
If you need to connect this App to other Apps on TrueNAS SCALE, please refer to our "Linking Apps Internally" quick-start guide:
https://truecharts.org/manual/Quick-Start%20Guides/14-linking-apps/
##### Available config options
In the future this page is going to contain an automated list of options available in the installation/edit UI.

View File

@ -0,0 +1,6 @@
dependencies:
- name: common
repository: https://truecharts.org/
version: 7.0.2
digest: sha256:0fedec7df721ee22e53c87584f5ba740c93f0c2f5445056ed55412eb25ce47a2
generated: "2021-09-11T18:59:36.001105Z"

View File

@ -0,0 +1,28 @@
apiVersion: v2
appVersion: 13.4.0@sha
dependencies:
- name: common
repository: https://truecharts.org/
version: 7.0.2
deprecated: false
description: PostgresSQL
home: https://github.com/truecharts/apps/tree/master/stable/postgres
icon: https://d1q6f0aelx0por.cloudfront.net/product-logos/library-postgres-logo.png
keywords:
- postgres
- postgressql
- dtabase
- sql
kubeVersion: '>=1.16.0-0'
maintainers:
- email: info@truecharts.org
name: TrueCharts
url: truecharts.org
- email: kjeld@schouten-lebbing.nl
name: Ornias1993
url: truecharts.org
name: postgresql
sources:
- https://www.postgresql.org/
type: application
version: 2.1.0

View File

@ -0,0 +1,37 @@
# Introduction
PostgresSQL
TrueCharts are designed to be installed as TrueNAS SCALE app only. We can not guarantee this charts works as a stand-alone helm installation.
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/truecharts/apps/issues/new/choose)**
## Source Code
* <https://www.postgresql.org/>
## Requirements
Kubernetes: `>=1.16.0-0`
## Dependencies
| Repository | Name | Version |
|------------|------|---------|
| https://truecharts.org/ | common | 7.0.2 |
## Installing the Chart
To install this App on TrueNAS SCALE check our [Quick-Start Guide](https://truecharts.org/manual/Quick-Start%20Guides/03-Installing-an-App/).
## Uninstalling the Chart
To remove this App from TrueNAS SCALE check our [Quick-Start Guide](https://truecharts.org/manual/Quick-Start%20Guides/07-Deleting-an-App/).
## Support
- Please check our [quick-start guides](https://truecharts.org/manual/Quick-Start%20Guides/01-Open-Apps/) first.
- See the [Wiki](https://truecharts.org)
- Check our [Discord](https://discord.gg/tVsPTHWTtr)
- Open a [issue](https://github.com/truecharts/apps/issues/new/choose)
---
All Rights Reserved - The TrueCharts Project

View File

@ -0,0 +1,3 @@
PostgresSQL
This App is supplied by TrueCharts, for more information please visit https://truecharts.org

Binary file not shown.

View File

@ -0,0 +1,66 @@
# Default Helm-Values
TrueCharts is primarily build to supply TrueNAS SCALE Apps.
However, we also supply all Apps as standard Helm-Charts. In this document we aim to document the default values in our values.yaml file.
Most of our Apps also consume our "common" Helm Chart.
If this is the case, this means that all values.yaml values are set to the common chart values.yaml by default. This values.yaml file will only contain values that deviate from the common chart.
You will, however, be able to use all values referenced in the common chart here, besides the values listed in this document.
## Values
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| enableUpgradeBackup | bool | `false` | |
| envTpl.POSTGRES_DB | string | `"{{ .Values.postgresqlDatabase }}"` | |
| envTpl.POSTGRES_USER | string | `"{{ .Values.postgresqlUsername }}"` | |
| envValueFrom.POSTGRES_PASSWORD.secretKeyRef.key | string | `"postgresql-password"` | |
| envValueFrom.POSTGRES_PASSWORD.secretKeyRef.name | string | `"{{ ( tpl .Values.existingSecret $ ) | default ( include \"common.names.fullname\" . ) }}"` | |
| existingSecret | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"bitnami/postgresql"` | |
| image.tag | string | `"13.4.0@sha256:7fff0f7e827cd8e1daa3adbf0ca3f19e21006023c0f6d1c2d835718961516a87"` | |
| initContainers.migrate-db.command[0] | string | `"/bin/sh"` | |
| initContainers.migrate-db.command[1] | string | `"-cx"` | |
| initContainers.migrate-db.command[2] | string | `"echo 'trying to migrate old db to new location...'\nmkdir -p /bitnami/postgresql/data\nmv -f /bitnami/postgresql/old/* /bitnami/postgresql/data/ || true\nchown -R {{ .Values.podSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }} /bitnami/postgresql/data\nchmod 775 /bitnami/postgresql/data\n"` | |
| initContainers.migrate-db.image | string | `"{{ .Values.alpineImage.repository}}:{{ .Values.alpineImage.tag }}"` | |
| initContainers.migrate-db.imagePullPolicy | string | `"IfNotPresent"` | |
| initContainers.migrate-db.securityContext.allowPrivilegeEscalation | bool | `true` | |
| initContainers.migrate-db.securityContext.privileged | bool | `true` | |
| initContainers.migrate-db.securityContext.runAsNonRoot | bool | `false` | |
| initContainers.migrate-db.securityContext.runAsUser | int | `0` | |
| initContainers.migrate-db.volumeMounts[0].mountPath | string | `"/bitnami/postgresql/old"` | |
| initContainers.migrate-db.volumeMounts[0].name | string | `"db"` | |
| initContainers.migrate-db.volumeMounts[1].mountPath | string | `"/bitnami/postgresql"` | |
| initContainers.migrate-db.volumeMounts[1].name | string | `"data"` | |
| persistence.data.accessMode | string | `"ReadWriteOnce"` | |
| persistence.data.enabled | bool | `true` | |
| persistence.data.mountPath | string | `"/bitnami/postgresql"` | |
| persistence.data.size | string | `"999Gi"` | |
| persistence.data.type | string | `"pvc"` | |
| persistence.db.accessMode | string | `"ReadWriteOnce"` | |
| persistence.db.enabled | bool | `true` | |
| persistence.db.mountPath | string | `"/bitnami/postgresql/old"` | |
| persistence.db.size | string | `"999Gi"` | |
| persistence.db.type | string | `"pvc"` | |
| persistence.dbbackups.accessMode | string | `"ReadWriteOnce"` | |
| persistence.dbbackups.enabled | bool | `true` | |
| persistence.dbbackups.mountPath | string | `"/dbbackups"` | |
| persistence.dbbackups.size | string | `"999Gi"` | |
| persistence.dbbackups.type | string | `"pvc"` | |
| podSecurityContext.fsGroup | int | `568` | |
| podSecurityContext.fsGroupChangePolicy | string | `"OnRootMismatch"` | |
| podSecurityContext.runAsGroup | int | `0` | |
| podSecurityContext.runAsUser | int | `568` | |
| podSecurityContext.supplementalGroups | list | `[]` | |
| postgresqlDatabase | string | `"test"` | |
| postgresqlPassword | string | `"testpass"` | |
| postgresqlUsername | string | `"test"` | |
| securityContext.allowPrivilegeEscalation | bool | `true` | |
| securityContext.privileged | bool | `false` | |
| securityContext.readOnlyRootFilesystem | bool | `false` | |
| securityContext.runAsNonRoot | bool | `false` | |
| service.main.enabled | bool | `true` | |
| service.main.ports.main.port | int | `5432` | |
All Rights Reserved - The TrueCharts Project

View File

@ -0,0 +1,56 @@
##
# This file contains Values.yaml content that gets added to the output of questions.yaml
# It's ONLY meant for content that the user is NOT expected to change.
# Example: Everything under "image" is not included in questions.yaml but is included here.
##
image:
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4.0@sha256:7fff0f7e827cd8e1daa3adbf0ca3f19e21006023c0f6d1c2d835718961516a87
initContainers:
migrate-db:
image: "{{ .Values.alpineImage.repository}}:{{ .Values.alpineImage.tag }}"
securityContext:
runAsUser: 0
privileged: true
allowPrivilegeEscalation: true
runAsNonRoot: false
command:
- /bin/sh
- -cx
- |
echo 'trying to migrate old db to new location...'
chown -R {{ .Values.podSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }} /bitnami/postgresql/data /bitnami/postgresql/old
chmod 775 /bitnami/postgresql/data/ bitnami/postgresql/data /bitnami/postgresql/old
mkdir -p /bitnami/postgresql/data
mkdir -p /bitnami/postgresql/conf
mv -f /bitnami/postgresql/old/* /bitnami/postgresql/data/ || true
mv -f /bitnami/postgresql/data/pg_hba.conf /bitnami/postgresql/conf/pg_hba.conf || true
chown -R {{ .Values.podSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }} /bitnami/postgresql/data
chmod 775 /bitnami/postgresql/data
imagePullPolicy: IfNotPresent
volumeMounts:
- name: db
mountPath: /bitnami/postgresql/old
- name: data
mountPath: /bitnami/postgresql
envValueFrom:
POSTGRES_PASSWORD:
secretKeyRef:
name: '{{ .Values.existingSecret | default ( include "common.names.fullname" . ) }}'
key: "postgresql-password"
envTpl:
POSTGRES_USER: "{{ .Values.postgresqlUsername }}"
POSTGRES_DB: "{{ .Values.postgresqlDatabase }}"
# POSTGRESQL_POSTGRES_PASSWORD: "{{ .Values.postgrespassword }}"
# POSTGRESQL_PASSWORD: "{{ .Values.password }}"
##
# Most other defaults are set in questions.yaml
# For other options please refer to the wiki, default_values.yaml or the common library chart
##

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: "postgres-backup-hook-config-map"
annotations:
rollme: {{ randAlphaNum 5 | quote }}
data:
entrypoint.sh: |-
#!/bin/sh
cmd="/docker-entrypoint.sh postgres"
eval "${cmd}" & disown;
until pg_isready; do
sleep 5;
done;
pg_dump -U {{ .Values.postgresqlUser }} -d {{ .Values.postgresqlDatabase }} > /dbbackups/$BACKUP_NAME;

View File

@ -0,0 +1,2 @@
{{ include "common.all" . }}

View File

@ -0,0 +1,13 @@
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:
postgresql-password: {{ ( .Values.postgresqlPassword | default "empty" ) | b64enc | quote }}

View File

@ -0,0 +1,56 @@
{{- if and ( .Values.enableUpgradeBackup ) ( .Values.ixChartContext ) -}}
{{- if .Values.ixChartContext.isUpgrade -}}
{{- $upgradeDict := .Values.ixChartContext.upgradeMetadata -}}
{{ $values := (. | mustDeepCopy) }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: "pre-upgrade-hook2"
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-weight": "1"
"helm.sh/hook-delete-policy": hook-succeeded
rollme: {{ randAlphaNum 5 | quote }}
spec:
template:
metadata:
name: "pre-upgrade-hook2"
spec:
restartPolicy: Never
containers:
- name: {{ .Chart.Name }}-postgres-backup
image: {{ printf "%v:%v" .Values.image.repository .Values.image.tag}}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: BACKUP_NAME
value: {{- printf "postgres-backup-from-%s-to-%s-revision-%d" $upgradeDict.oldChartVersion $upgradeDict.newChartVersion (int64 $upgradeDict.preUpgradeRevision) -}}
- name: POSTGRES_USER
value: {{ .Values.postgresqlUsername | quote }}
- name: POSTGRES_DB
value: {{ .Values.postgresqlDatabase | quote }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ ( .Values.existingSecret | default ( include "common.names.fullname" . ) ) | quote }}
key: "postgresql-password"
command:
- "/bin/backup_entrypoint.sh"
volumeMounts:
- name: backup-script-configmap
mountPath: /bin/backup_entrypoint.sh
readOnly: true
subPath: entrypoint.sh
{{- with (include "common.controller.volumeMounts" . | trim) }}
{{ nindent 4 . }}
{{- end }}
volumes:
- name: backup-script-configmap
configMap:
defaultMode: 0700
name: "postgres-backup-hook-config-map"
{{- with (include "common.controller.volumes" . | trim) }}
{{- nindent 2 . }}
{{- end }}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,91 @@
image:
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4.0@sha256:7fff0f7e827cd8e1daa3adbf0ca3f19e21006023c0f6d1c2d835718961516a87
service:
main:
enabled: true
ports:
main:
port: 5432
## TODO: Fix the backup-on-upgrade system
enableUpgradeBackup: false
initContainers:
migrate-db:
image: "{{ .Values.alpineImage.repository}}:{{ .Values.alpineImage.tag }}"
securityContext:
runAsUser: 0
privileged: true
allowPrivilegeEscalation: true
runAsNonRoot: false
command:
- /bin/sh
- -cx
- |
echo 'trying to migrate old db to new location...'
mkdir -p /bitnami/postgresql/data
mv -f /bitnami/postgresql/old/* /bitnami/postgresql/data/ || true
chown -R {{ .Values.podSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }} /bitnami/postgresql/data
chmod 775 /bitnami/postgresql/data
imagePullPolicy: IfNotPresent
volumeMounts:
- name: db
mountPath: /bitnami/postgresql/old
- name: data
mountPath: /bitnami/postgresql
securityContext:
privileged: false
readOnlyRootFilesystem: false
allowPrivilegeEscalation: true
runAsNonRoot: false
podSecurityContext:
runAsUser: 568
runAsGroup: 0
fsGroup: 568
supplementalGroups: []
fsGroupChangePolicy: "OnRootMismatch"
persistence:
db:
enabled: true
mountPath: "/bitnami/postgresql/old"
type: pvc
accessMode: ReadWriteOnce
size: "999Gi"
data:
enabled: true
mountPath: "/bitnami/postgresql"
type: pvc
accessMode: ReadWriteOnce
size: "999Gi"
dbbackups:
enabled: true
mountPath: "/dbbackups"
type: pvc
accessMode: ReadWriteOnce
size: "999Gi"
postgresqlPassword: "testpass"
postgresqlUsername: "test"
postgresqlDatabase: "test"
existingSecret: ""
envValueFrom:
POSTGRES_PASSWORD:
secretKeyRef:
name: '{{ ( tpl .Values.existingSecret $ ) | default ( include "common.names.fullname" . ) }}'
key: "postgresql-password"
envTpl:
POSTGRES_USER: "{{ .Values.postgresqlUsername }}"
POSTGRES_DB: "{{ .Values.postgresqlDatabase }}"
# POSTGRESQL_POSTGRES_PASSWORD: "{{ .Values.postgrespassword }}"
# POSTGRESQL_PASSWORD: "{{ .Values.password }}"

View File