Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

charts/timescaledb-single: added resources to all containers #573

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/timescaledb-single/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
apiVersion: v1
name: timescaledb-single
description: 'TimescaleDB HA Deployment.'
version: 0.33.2
version: 0.34.0
icon: https://cdn.iconscout.com/icon/free/png-256/timescaledb-1958407-1651618.png

# appVersion specifies the version of the software, which can vary wildly,
Expand Down
3 changes: 3 additions & 0 deletions charts/timescaledb-single/docs/admin-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ The following table lists the configurable parameters of the TimescaleDB Helm ch
| `backup.resources` | Any resources you wish to assign to the pgbackrest container | `{}` |
| `callbacks.configMap` | A kubernetes ConfigMap containing [Patroni callbacks](#callbacks). You can use templates in the name. | `nil` |
| `clusterName` | Override the name of the PostgreSQL cluster | Equal to the Helm release name |
| `curl.resources` | Any resources you wish to assign to the job and cronjob containers which are using the curl image | `{}` |
| `env` | Extra custom environment variables, expressed as [EnvVar](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#envvarsource-v1-core) | `[]` |
| `envFrom` | Extra custom environment variables, expressed as [EnvFrom](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#envfromsource-v1-core) | `[]` |
| `fullnameOverride` | Override the fullname of the chart | `nil` |
Expand Down Expand Up @@ -67,6 +68,7 @@ The following table lists the configurable parameters of the TimescaleDB Helm ch
| `pgBouncer.enabled` | If enabled, run a [pgBouncer](https://www.pgbouncer.org/) sidecar | `false` |
| `pgBouncer.port` | The port on which the Load Balancer should listen for pgBouncer requests | `6432` |
| `pgBouncer.pg_hba` | The `pg_hba` to be used by pgBouncer | A `pg_hba` allowing non-superuser ssl-only connections |
| `pgBouncer.resources` | Any resources you wish to assign to the pgBouncer container | `{}` |
| `pgBouncer.userListSecretName` | If set, a [user authentication file](https://www.pgbouncer.org/config.html#authentication-file-format) to be used by pgBouncer. | `nil` |
| `podManagementPolicy` | Either [`OrderedReady` or `Parallel`](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies) | `OrderedReady` |
| `podMonitor.enabled` | Enable deployment of podMonitor used with prometheus-operator. | `false` |
Expand All @@ -81,6 +83,7 @@ The following table lists the configurable parameters of the TimescaleDB Helm ch
| `prometheus.image.pullPolicy` | The pull policy for the postgres\_exporter | `IfNotPresent` |
| `prometheus.image.repository` | The postgres\_exporter docker repo | `quay.io/prometheuscommunity/postgres_exporter` |
| `prometheus.image.tag` | The tag of the postgres\_exporter image | `v0.11.0` |
| `prometheus.resources` | Any resources you wish to assign to the postgres-exporter container | `{}` |
| `rbac.create` | Create required role and rolebindings | `true` |
| `replicaCount` | Amount of pods to spawn | `3` |
| `resources` | Any resources you wish to assign to the timescaledb container | `{}` |
Expand Down
2 changes: 2 additions & 0 deletions charts/timescaledb-single/templates/job-update-patroni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ spec:
{{ .Values.patroni.bootstrap.dcs | toJson | quote }} \
"http://{{ template "clusterName" . }}-config:8008/config"
exit 0
resources:
{{- toYaml .Values.curl.resources | nindent 10 }}
2 changes: 2 additions & 0 deletions charts/timescaledb-single/templates/pgbackrest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ spec:
- |
{"type": {{ quote .type }}}
- "http://{{ template "timescaledb.fullname" $ }}-backup:8081/backups/"
resources:
{{- toYaml $.Values.curl.resources | nindent 16 }}
...
{{- end }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
mountPath: {{ template "scripts_dir" . }}
readOnly: true
resources:
{{ toYaml .Values.resources | nindent 10 }}
{{- toYaml .Values.resources | nindent 10 }}
{{- end }}
# Issuing the final checkpoints on a busy database may take considerable time.
# Unfinished checkpoints will require more time during startup, so the tradeoff
Expand Down Expand Up @@ -318,7 +318,7 @@ spec:
name: pgbackrest-bootstrap
readOnly: true
resources:
{{ toYaml .Values.resources | nindent 10 }}
{{- toYaml .Values.resources | nindent 10 }}

{{- if .Values.pgBouncer.enabled }}
- name: pgbouncer
Expand Down Expand Up @@ -361,6 +361,8 @@ spec:
- -i
- /usr/sbin/pgbouncer
- /etc/pgbouncer/pgbouncer-sidecar.ini
resources:
{{- toYaml .Values.pgBouncer.resources | nindent 10 }}
{{- end }}

{{- if or .Values.backup.enabled .Values.backup.enable }}
Expand All @@ -375,7 +377,7 @@ spec:
- containerPort: 8081
name: pgbackrest
resources:
{{ toYaml .Values.backup.resources | nindent 10 }}
{{- toYaml .Values.backup.resources | nindent 10 }}
volumeMounts:
- name: socket-directory
mountPath: /var/run/postgresql
Expand Down Expand Up @@ -451,6 +453,8 @@ spec:
{{- if .Values.prometheus.env }}
{{ .Values.prometheus.env | default list | toYaml | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.prometheus.resources | nindent 10 }}
{{- end }}

{{- with .Values.nodeSelector }}
Expand Down
58 changes: 37 additions & 21 deletions charts/timescaledb-single/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
"mimimum": 0,
"type": "integer"
},
"resources": {
"additionalProperties": false,
"properties": {
"limits": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"requests": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"type": "object"
},
"service": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -142,10 +160,7 @@
]
},
"resources": {
"type": [
"object",
"null"
]
"$ref": "#/definitions/resources"
}
},
"required": [
Expand Down Expand Up @@ -192,6 +207,15 @@
"maxLength": 30,
"type": "string"
},
"curl": {
"additionalProperties": false,
"properties": {
"resources": {
"$ref": "#/definitions/resources"
}
},
"type": "object"
},
"curlImage": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -541,6 +565,9 @@
],
"type": "integer"
},
"resources": {
"$ref": "#/definitions/resources"
},
"userListSecretName": {
"description": "A pointer to a SecretName containing user/password pairs in the format expected by pgbouncer\nhttps://www.pgbouncer.org/config.html#authentication-file-format\n",
"type": [
Expand Down Expand Up @@ -617,6 +644,9 @@
"image": {
"type": "object"
},
"resources": {
"$ref": "#/definitions/resources"
},
"volumeMounts": {
"items": {
"type": "object"
Expand Down Expand Up @@ -682,22 +712,7 @@
"type": "integer"
},
"resources": {
"additionalProperties": false,
"properties": {
"limits": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"requests": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"type": "object"
"$ref": "#/definitions/resources"
},
"schedulerName": {
"type": "string"
Expand Down Expand Up @@ -814,10 +829,11 @@
"backup",
"bootstrapFromBackup",
"callbacks",
"curl",
"curlImage",
"debug",
"fullnameOverride",
"image",
"curlImage",
"networkPolicy",
"nodeSelector",
"patroni",
Expand Down
41 changes: 26 additions & 15 deletions charts/timescaledb-single/values.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ required:
- backup
- bootstrapFromBackup
- callbacks
- curl
- curlImage
- debug
- fullnameOverride
- image
- curlImage
- networkPolicy
- nodeSelector
- patroni
Expand Down Expand Up @@ -163,17 +164,7 @@ properties:
- array
- "null"
resources:
type: object
additionalProperties: false
properties:
limits:
type: object
additionalProperties:
type: string
requests:
type: object
additionalProperties:
type: string
"$ref": "#/definitions/resources"
affinity:
type: object
additionalProperties: true
Expand Down Expand Up @@ -350,6 +341,8 @@ properties:
type: object
image:
type: object
resources:
"$ref": "#/definitions/resources"
volumes:
type:
- array
Expand Down Expand Up @@ -410,6 +403,8 @@ properties:
type:
- object
- "null"
resources:
"$ref": "#/definitions/resources"
nodeSelector:
type: object
podAnnotations:
Expand Down Expand Up @@ -469,9 +464,7 @@ properties:
- array
- "null"
resources:
type:
- object
- "null"
"$ref": "#/definitions/resources"
secrets:
type: object
additionalProperties: false
Expand Down Expand Up @@ -510,6 +503,12 @@ properties:
- Always
- Never
- IfNotPresent
curl:
type: object
additionalProperties: false
properties:
resources:
"$ref": "#/definitions/resources"
curlImage:
type: object
additionalProperties: false
Expand Down Expand Up @@ -588,6 +587,18 @@ definitions:
- "null"
additionalProperties:
type: string
resources:
type: object
additionalProperties: false
properties:
limits:
type: object
additionalProperties:
type: string
requests:
type: object
additionalProperties:
type: string
volume:
type: object
additionalProperties: false
Expand Down
22 changes: 18 additions & 4 deletions charts/timescaledb-single/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ curlImage:
tag: "7.87.0"
pullPolicy: Always

# There are job and cronjob resources that run during updates or backups that use curl image
# Example: https://github.com/timescale/helm-charts/blob/main/charts/timescaledb-single/templates/job-update-patroni.yaml
curl:
resources: {}
# If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

# By default those secrets are randomly generated.
# To prevent misconfiguration, modifications from helm upgrade won't be applied to those secrets.
# As a result changing secrets cannot be done via helm and need manual intervention.
Expand Down Expand Up @@ -474,6 +487,7 @@ pgBouncer:
- hostssl all all ::0/0 md5
- hostnossl all all 0.0.0.0/0 reject
- hostnossl all all ::0/0 reject
resources: {}
# Secret should contain user/password pairs in the format expected by pgbouncer
# https://www.pgbouncer.org/config.html#authentication-file-format
# example:
Expand Down Expand Up @@ -518,13 +532,13 @@ prometheus:
# secretKeyRef:
# name: myapplication-passwords
# key: standby
# Additional volumes for prometheus, e.g., to support additional queries.
# These should be a Volume, as this allows you to inject any kind of Volume
# https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#volume-v1-core

resources: {}
# Extra custom CLI arguments for postgres_exporter.
args: []
# - --collector.database=disabled
# Additional volumes for prometheus, e.g., to support additional queries.
# These should be a Volume, as this allows you to inject any kind of Volume
# https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#volume-v1-core
volumes:
# - name: exporter-config
# configMap:
Expand Down