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

Commit

Permalink
charts/timescaledb-single: added resources to jobs and cronjobs
Browse files Browse the repository at this point in the history
  • Loading branch information
joschiwald committed Feb 20, 2023
1 parent b9cbc2d commit bea8ce1
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 38 deletions.
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.1
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
1 change: 1 addition & 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
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 @@ -375,7 +375,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
49 changes: 29 additions & 20 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 @@ -682,22 +706,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
34 changes: 20 additions & 14 deletions charts/timescaledb-single/values.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,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 @@ -469,9 +459,7 @@ properties:
- array
- "null"
resources:
type:
- object
- "null"
"$ref": "#/definitions/resources"
secrets:
type: object
additionalProperties: false
Expand Down Expand Up @@ -526,6 +514,12 @@ properties:
- Always
- Never
- IfNotPresent
curl:
type: object
additionalProperties: false
properties:
resources:
"$ref": "#/definitions/resources"
replicaCount:
type: integer
minimum: 0
Expand Down Expand Up @@ -588,6 +582,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
13 changes: 13 additions & 0 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

0 comments on commit bea8ce1

Please sign in to comment.