diff --git a/charts/repo/index.yaml b/charts/repo/index.yaml index a4715288..be77e0c1 100644 --- a/charts/repo/index.yaml +++ b/charts/repo/index.yaml @@ -2,7 +2,55 @@ apiVersion: v1 entries: timescaledb-multinode: - apiVersion: v1 - created: "2021-04-12T14:27:32.368475328+02:00" + created: "2021-07-22T09:54:55.736858883+03:00" + description: TimescaleDB Multinode Deployment. + digest: f07bab11cdb498809c07d807974cd4499a304fae9c9251779a4a6eaac3551515 + home: https://github.com/timescale/timescaledb-kubernetes + maintainers: + - email: support@timescale.com + name: TimescaleDB + name: timescaledb-multinode + sources: + - https://github.com/timescale/timescaledb-kubernetes + - https://github.com/timescale/timescaledb-docker-ha + - https://github.com/zalando/patroni + urls: + - timescaledb-multinode-0.9.0.tgz + version: 0.9.0 + - apiVersion: v1 + created: "2021-07-22T09:54:55.735903222+03:00" + description: TimescaleDB Multinode Deployment. + digest: bc4f70989a2bdc35e5a4a9efe311a87ffcef3e0acb5ee704a010d49ecb372765 + home: https://github.com/timescale/timescaledb-kubernetes + maintainers: + - email: support@timescale.com + name: TimescaleDB + name: timescaledb-multinode + sources: + - https://github.com/timescale/timescaledb-kubernetes + - https://github.com/timescale/timescaledb-docker-ha + - https://github.com/zalando/patroni + urls: + - timescaledb-multinode-0.8.2.tgz + version: 0.8.2 + - apiVersion: v1 + created: "2021-07-22T09:54:55.734946117+03:00" + description: TimescaleDB Multinode Deployment. + digest: e0729d1731fb22f769494b921b275153d625aebcbdb68c432c2ccd1897f4d66c + home: https://github.com/timescale/timescaledb-kubernetes + maintainers: + - email: support@timescale.com + name: TimescaleDB + name: timescaledb-multinode + sources: + - https://github.com/timescale/timescaledb-kubernetes + - https://github.com/timescale/timescaledb-docker-ha + - https://github.com/zalando/patroni + urls: + - timescaledb-multinode-0.8.1.tgz + version: 0.8.1 + - apiVersion: v1 + created: "2021-07-22T09:54:55.734141299+03:00" description: TimescaleDB Multinode Deployment. digest: 101d72220765f49e6b081c134c1f793bbe90d7f67a4f4c36c794be989e34623d home: https://github.com/timescale/timescaledb-kubernetes @@ -18,7 +66,7 @@ entries: - timescaledb-multinode-0.8.0.tgz version: 0.8.0 - apiVersion: v1 - created: "2021-04-12T14:27:32.367943817+02:00" + created: "2021-07-22T09:54:55.733314553+03:00" description: TimescaleDB Multinode Deployment. digest: db2bea7290cd265835e11859a39e72562c7e21f1a90df0401e14e05d7adea1d6 home: https://github.com/timescale/timescaledb-kubernetes @@ -34,7 +82,7 @@ entries: - timescaledb-multinode-0.7.0.tgz version: 0.7.0 - apiVersion: v1 - created: "2021-04-12T14:27:32.36740087+02:00" + created: "2021-07-22T09:54:55.732478183+03:00" description: TimescaleDB Multinode Deployment. digest: d537d361eb0f72bce12d8e4f993dbc980f7850a22bb1a7bcd8825a7a4a00d38f home: https://github.com/timescale/timescaledb-kubernetes @@ -50,7 +98,7 @@ entries: - timescaledb-multinode-0.6.3.tgz version: 0.6.3 - apiVersion: v1 - created: "2021-04-12T14:27:32.36684507+02:00" + created: "2021-07-22T09:54:55.731592561+03:00" description: TimescaleDB Multinode Deployment. digest: a6c664a75489e069cdd2d36dff87ca6d2b3a38a3edf16de4234418b354e40eea home: https://github.com/timescale/timescaledb-kubernetes @@ -67,7 +115,7 @@ entries: version: 0.3.0 timescaledb-single: - apiVersion: v1 - created: "2021-04-12T14:27:32.398815015+02:00" + created: "2021-07-22T09:54:55.779912355+03:00" description: TimescaleDB HA Deployment. digest: 8bb26c938538e767a0da086f7535e1b81fa03af292becf44d406d7a8d8da9321 home: https://github.com/timescale/timescaledb-kubernetes @@ -83,7 +131,7 @@ entries: - timescaledb-single-0.9.0.tgz version: 0.9.0 - apiVersion: v1 - created: "2021-04-12T14:27:32.396520469+02:00" + created: "2021-07-22T09:54:55.777334123+03:00" description: TimescaleDB HA Deployment. digest: a976fc399539e012942a3e55dce1d735c5c36bb4678e57a66ac7d280c8bfceb9 home: https://github.com/timescale/timescaledb-kubernetes @@ -99,7 +147,7 @@ entries: - timescaledb-single-0.8.2.tgz version: 0.8.2 - apiVersion: v1 - created: "2021-04-12T14:27:32.39453048+02:00" + created: "2021-07-22T09:54:55.774752711+03:00" description: TimescaleDB HA Deployment. digest: d047ac65b447b75f748c6fe94cec7ed208e91c20b42eb912baa7aa4f4131518c home: https://github.com/timescale/timescaledb-kubernetes @@ -115,7 +163,7 @@ entries: - timescaledb-single-0.8.1.tgz version: 0.8.1 - apiVersion: v1 - created: "2021-04-12T14:27:32.392625053+02:00" + created: "2021-07-22T09:54:55.772154048+03:00" description: TimescaleDB HA Deployment. digest: 63a9d362ea53efbe6103b8fd0cf07400aa2ccb090740eda213f862d588320c79 home: https://github.com/timescale/timescaledb-kubernetes @@ -131,7 +179,7 @@ entries: - timescaledb-single-0.8.0.tgz version: 0.8.0 - apiVersion: v1 - created: "2021-04-12T14:27:32.390635441+02:00" + created: "2021-07-22T09:54:55.769156425+03:00" description: TimescaleDB HA Deployment. digest: 1948357489eff42eb81bcb59a465615e20b791dc54178d1bbaf1a650b7f46de1 home: https://github.com/timescale/timescaledb-kubernetes @@ -147,7 +195,7 @@ entries: - timescaledb-single-0.7.1.tgz version: 0.7.1 - apiVersion: v1 - created: "2021-04-12T14:27:32.388602011+02:00" + created: "2021-07-22T09:54:55.766780779+03:00" description: TimescaleDB HA Deployment. digest: 39e270f51713dd0f2be64c8a80d747bc1e78173fd3e2c6172ff993f9a7dacd1b home: https://github.com/timescale/timescaledb-kubernetes @@ -163,7 +211,7 @@ entries: - timescaledb-single-0.7.0.tgz version: 0.7.0 - apiVersion: v1 - created: "2021-04-12T14:27:32.386868236+02:00" + created: "2021-07-22T09:54:55.764406695+03:00" description: TimescaleDB HA Deployment. digest: 463bf4eca84cbefbd2e4a88928fe1ccc59a69fb95a4952ce15ca746adb479a29 home: https://github.com/timescale/timescaledb-kubernetes @@ -179,7 +227,7 @@ entries: - timescaledb-single-0.6.2.tgz version: 0.6.2 - apiVersion: v1 - created: "2021-04-12T14:27:32.38534498+02:00" + created: "2021-07-22T09:54:55.762224915+03:00" description: TimescaleDB HA Deployment. digest: 8ad82438d3fc818e6729afa77607521b7510b68fa4e0b4e7d0836f33990f0a63 home: https://github.com/timescale/timescaledb-kubernetes @@ -195,7 +243,7 @@ entries: - timescaledb-single-0.6.1.tgz version: 0.6.1 - apiVersion: v1 - created: "2021-04-12T14:27:32.383853585+02:00" + created: "2021-07-22T09:54:55.759367663+03:00" description: TimescaleDB HA Deployment. digest: b1c985faf6852aea91e6931230d19656f126fb7eabff004e92ffa2fb411cfbe2 home: https://github.com/timescale/timescaledb-kubernetes @@ -211,7 +259,7 @@ entries: - timescaledb-single-0.6.0.tgz version: 0.6.0 - apiVersion: v1 - created: "2021-04-12T14:27:32.382306958+02:00" + created: "2021-07-22T09:54:55.75719717+03:00" description: TimescaleDB HA Deployment. digest: 977ccd3dfe52e84a18e9ecf8c4138a937621910f743071fff58b497c357afb7c home: https://github.com/timescale/timescaledb-kubernetes @@ -227,7 +275,7 @@ entries: - timescaledb-single-0.5.8.tgz version: 0.5.8 - apiVersion: v1 - created: "2021-04-12T14:27:32.380478308+02:00" + created: "2021-07-22T09:54:55.755007106+03:00" description: TimescaleDB HA Deployment. digest: 069c515c7055289ecf8189962e648e033053e8e7bdb47c39f9ec058e99911183 home: https://github.com/timescale/timescaledb-kubernetes @@ -243,7 +291,7 @@ entries: - timescaledb-single-0.5.7.tgz version: 0.5.7 - apiVersion: v1 - created: "2021-04-12T14:27:32.378981809+02:00" + created: "2021-07-22T09:54:55.752936113+03:00" description: TimescaleDB HA Deployment. digest: f0c9b30a4bf3d3e9c221efa37946bef05bad7fe79eb1808a7c8088c2d24e1075 home: https://github.com/timescale/timescaledb-kubernetes @@ -259,7 +307,7 @@ entries: - timescaledb-single-0.5.6.tgz version: 0.5.6 - apiVersion: v1 - created: "2021-04-12T14:27:32.37748912+02:00" + created: "2021-07-22T09:54:55.750472815+03:00" description: TimescaleDB HA Deployment. digest: 27098601d61f727ac71c2bfb67a1240c99188fc56ab4d0a0375cf5abc09547dc home: https://github.com/timescale/timescaledb-kubernetes @@ -275,7 +323,7 @@ entries: - timescaledb-single-0.5.5.tgz version: 0.5.5 - apiVersion: v1 - created: "2021-04-12T14:27:32.376116858+02:00" + created: "2021-07-22T09:54:55.748234847+03:00" description: TimescaleDB HA Deployment. digest: 5bd289b789c7fae00b98ae9d1ce0b86e6b8463fbe4fbdaf20d59b60aca137580 home: https://github.com/timescale/timescaledb-kubernetes @@ -291,7 +339,7 @@ entries: - timescaledb-single-0.5.4.tgz version: 0.5.4 - apiVersion: v1 - created: "2021-04-12T14:27:32.374771844+02:00" + created: "2021-07-22T09:54:55.746307884+03:00" description: TimescaleDB HA Deployment. digest: 6cd19bcb822c9610ad13fbe49b03c3bd9d5f4655920b44e41f937487ecf86d9d home: https://github.com/timescale/timescaledb-kubernetes @@ -307,7 +355,7 @@ entries: - timescaledb-single-0.5.3.tgz version: 0.5.3 - apiVersion: v1 - created: "2021-04-12T14:27:32.373587337+02:00" + created: "2021-07-22T09:54:55.74452903+03:00" description: TimescaleDB HA Deployment. digest: 9e2570426e0445a2e4f079fe757bbaadbc95a764c12ce10903f426d3b69cfde9 home: https://github.com/timescale/timescaledb-kubernetes @@ -323,7 +371,7 @@ entries: - timescaledb-single-0.5.2.tgz version: 0.5.2 - apiVersion: v1 - created: "2021-04-12T14:27:32.371986155+02:00" + created: "2021-07-22T09:54:55.742781451+03:00" description: TimescaleDB HA Deployment. digest: 128a7f0738f176a2abe6b7e1c3a1173ac6c4a77f7816704add3f0664609915aa home: https://github.com/timescale/timescaledb-kubernetes @@ -339,7 +387,7 @@ entries: - timescaledb-single-0.5.1.tgz version: 0.5.1 - apiVersion: v1 - created: "2021-04-12T14:27:32.370764712+02:00" + created: "2021-07-22T09:54:55.740886787+03:00" description: TimescaleDB HA Deployment. digest: f4e0e05c989f04c78d9bd0a5b7ab2c6e1d2227af72ad05f7451a3e01b462bba0 home: https://github.com/timescale/timescaledb-kubernetes @@ -355,7 +403,7 @@ entries: - timescaledb-single-0.5.0.tgz version: 0.5.0 - apiVersion: v1 - created: "2021-04-12T14:27:32.369619685+02:00" + created: "2021-07-22T09:54:55.738562002+03:00" description: TimescaleDB HA Deployment. digest: 2ae9d4a4ba25caf626e837244bf092721439e822d486f2c17f238b479012dedb home: https://github.com/timescale/timescaledb-kubernetes @@ -370,4 +418,4 @@ entries: urls: - timescaledb-single-0.4.0.tgz version: 0.4.0 -generated: "2021-04-12T14:27:32.366210995+02:00" +generated: "2021-07-22T09:54:55.730629048+03:00" diff --git a/charts/repo/timescaledb-multinode-0.8.1.tgz b/charts/repo/timescaledb-multinode-0.8.1.tgz new file mode 100644 index 00000000..d6cb2399 Binary files /dev/null and b/charts/repo/timescaledb-multinode-0.8.1.tgz differ diff --git a/charts/repo/timescaledb-multinode-0.8.2.tgz b/charts/repo/timescaledb-multinode-0.8.2.tgz new file mode 100644 index 00000000..86c9e808 Binary files /dev/null and b/charts/repo/timescaledb-multinode-0.8.2.tgz differ diff --git a/charts/repo/timescaledb-multinode-0.9.0.tgz b/charts/repo/timescaledb-multinode-0.9.0.tgz new file mode 100644 index 00000000..3698224e Binary files /dev/null and b/charts/repo/timescaledb-multinode-0.9.0.tgz differ diff --git a/charts/timescaledb-multinode/Chart.yaml b/charts/timescaledb-multinode/Chart.yaml index b59b46e5..4750bd35 100644 --- a/charts/timescaledb-multinode/Chart.yaml +++ b/charts/timescaledb-multinode/Chart.yaml @@ -4,7 +4,7 @@ apiVersion: v1 name: timescaledb-multinode description: 'TimescaleDB Multinode Deployment.' -version: 0.8.0 +version: 0.9.0 # appVersion specifies the version of the software, which can vary wildly, # e.g. TimescaleDB 1.4.1 on PostgreSQL 11 or TimescaleDB 1.5.0 on PostgreSQL 12. # https://github.com/helm/helm/blob/master/docs/charts.md#the-appversion-field diff --git a/charts/timescaledb-multinode/README.md b/charts/timescaledb-multinode/README.md index fe94a34a..b0e1f6ab 100644 --- a/charts/timescaledb-multinode/README.md +++ b/charts/timescaledb-multinode/README.md @@ -24,6 +24,7 @@ To install the chart as a release and name it `my-release`: ```console helm upgrade --install my-release . ``` +Configurations can be defined seprately for each node type - access node and data node. You can override parameters using the `--set key=value[,key=value]` argument to `helm upgrade --install`, e.g., to install the chart with randomly generated passwords: @@ -39,6 +40,21 @@ Alternatively, a YAML file that specifies the values for the parameters can be p helm upgrade --install my-release -f myvalues.yaml . ``` +### Secret override + +Instead of setting secrets in values.yaml, they can be manually generated. The following example is for timescaledb-access node and timescaledb-data node. + +In values.yaml set: +```console +credentials: + fromValues: false +``` + +```console +kubectl create secret generic `my-release`-access --from-literal=password-superuser='' +kubectl create secret generic `my-release`-data --from-literal=password-superuser='' +``` + For details about what parameters you can set, have a look at the [Administrator Guide](admin-guide.md#configure) ## Using a local image @@ -108,6 +124,14 @@ our [TimescaleDB > Tutorial: Scaling out TimescaleDB](https://docs.timescale.com to create distributed hypertables and start using multinode TimescaleDB. ### Connecting from another pod +If you are connecting from inside a pod in the Kubernetes cluster set service type to ClusterIP. Edit the following in values.yaml: + +```console +access: + service: + type: ClusterIP +``` +Additionaly, when running the service as ClusterIP, you can specify a static IP addess or run service in headless mode by setting `accessNode.service.clusterIP` to `None` From inside a pod in the Kubernetes cluster, you need to use the internal DNS address, e.g., diff --git a/charts/timescaledb-multinode/admin-guide.md b/charts/timescaledb-multinode/admin-guide.md index b06ca784..696da0b9 100644 --- a/charts/timescaledb-multinode/admin-guide.md +++ b/charts/timescaledb-multinode/admin-guide.md @@ -14,35 +14,60 @@ Please see the included NOTICE for copyright information and LICENSE for a copy ## Configuration The following table lists the configurable parameters of the TimescaleDB Helm chart and their default values. +##### Global Parameters | Parameter | Description | Default | |-----------------------------------|---------------------------------------------|-----------------------------------------------------| | `nameOverride` | Override the name of the chart | `timescaledb` | | `fullnameOverride` | Override the fullname of the chart | `nil` | -| `replicaCount` | Amount of pods to spawn | `3` | | `image.repository` | The image to pull | `timescale/timescaledb-ha` | | `image.tag` | The version of the image to pull | `pg12.5-ts2.0.0-p0` | `image.pullPolicy` | The pull policy | `IfNotPresent` | +| `credentials.fromValues` | Load credentials from values.yaml | `true` | | `credentials.accessNode.superuser`| Password of the superuser for the Access Node | `tea` | | `credentials.dataNode.superuser` | Password of the superuser for the Data Nodes | `coffee` | | `env` | Extra custom environment variables, expressed as [EnvVar](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#envvarsource-v1-core) | `PGDATA` and some language settings | -| `resources` | Any resources you wish to assign to the pod | `{}` | -| `nodeSelector` | Node label to use for scheduling | `{}` | -| `tolerations` | List of node taints to tolerate | `[]` | +| `schedulerName` | Alternate scheduler name | `nil` | | `affinityTemplate` | A template string to use to generate the affinity settings | Anti-affinity preferred on hostname | | `affinity` | Affinity settings. Overrides `affinityTemplate` if set. | `{}` | -| `postgresql.databases` | List of databases to automatically create a multinode setup for | `["postgres", "example"]` | -| `postgresql.parameters` | [PostgreSQL parameters](https://www.postgresql.org/docs/current/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE)) | Some required and preferred settings | -| `schedulerName` | Alternate scheduler name | `nil` | -| `persistentVolume.accessModes` | Persistent Volume access modes | `[ReadWriteOnce]` | -| `persistentVolume.annotations` | Annotations for Persistent Volume Claim` | `{}` | -| `persistentVolume.mountPath` | Persistent Volume mount root path | `/var/lib/postgresql` | -| `persistentVolume.size` | Persistent Volume size | `5Gi` | -| `persistentVolume.storageClass` | Persistent Volume Storage Class | `volume.alpha.kubernetes.io/storage-class: default` | -| `persistentVolume.subPath` | Subdirectory of Persistent Volume to mount | `""` | | `rbac.create` | Create required role and rolebindings | `true` | | `serviceAccount.create` | If true, create a new service account | `true` | | `serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the fullname template | `nil` | + +##### Access Node Parameters +| Parameter | Description | Default | +|----------------------------------------------|---------------------------------------------|-----------------------------------------------------| +| `accessNode.service.type` | Setup external access using LoadBalancer or ClusterIP | `LoadBalancer` | +| `accessNode.service.clusterIP` | Setup service to run in headless mode or with static IP| `nil` | +| `accessNode.resources` | Any resources you wish to assign to the Access Node pod |`{}` | +| `accessNode.postgresql.databases` | List of databases to automatically create a multinode setup for | `["postgres", "example"]` | +| `accessNode.postgresql.parameters` | [PostgreSQL parameters](https://www.postgresql.org/docs/current/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE)) | Some required and preferred settings | +| `accessNode.persistentVolume.accessModes` | Persistent Volume access modes | `[ReadWriteOnce]` | +| `accessNode.persistentVolume.annotations` | Annotations for Persistent Volume Claim` | `{}` | +| `accessNode.persistentVolume.mountPath` | Persistent Volume mount root path | `/var/lib/postgresql` | +| `accessNode.persistentVolume.size` | Persistent Volume size | `5Gi` | +| `accessNode.persistentVolume.storageClass` | Persistent Volume Storage Class | `volume.alpha.kubernetes.io/storage-class: default` | +| `accessNode.persistentVolume.subPath` | Subdirectory of Persistent Volume to mount | `""` | +| `accessNode.nodeSelector` | Access Node label to use for scheduling | `{}` | +| `accessNode.tolerations` | List of node taints to tolerate by Access Node | `[]` | +| `accessNode.affinity` | Affinity settings | `{}` | + +##### Data Nodes Parameters +| Parameter | Description | Default | +|--------------------------------------------|---------------------------------------------|-----------------------------------------------------| +| `dataNode.instances` | Number of Data Node instances | `3` | +| `dataNode.resources` | Any resources you wish to assign to the Access Node pod | `{}` | +| `dataNode.postgresql.parameters` | [PostgreSQL parameters](https://www.postgresql.org/docs/current/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE)) | Some required and preferred settings | +| `dataNode.persistentVolume.accessModes` | Persistent Volume access modes | `[ReadWriteOnce]` | +| `dataNode.persistentVolume.annotations` | Annotations for Persistent Volume Claim` | `{}` | +| `dataNode.persistentVolume.mountPath` | Persistent Volume mount root path | `/var/lib/postgresql` | +| `dataNode.persistentVolume.size` | Persistent Volume size | `5Gi` | +| `dataNode.persistentVolume.storageClass` | Persistent Volume Storage Class | `volume.alpha.kubernetes.io/storage-class: default` | +| `dataNode.persistentVolume.subPath` | Subdirectory of Persistent Volume to mount | `""` | +| `dataNode.nodeSelector` | Access Node label to use for scheduling | `{}` | +| `dataNode.tolerations` | List of node taints to tolerate by Access Node | `[]` | +| `dataNode.affinity` | Affinity settings | `{}` | + ### Examples - Override value using commandline parameters ```console diff --git a/charts/timescaledb-multinode/templates/job-attach-datanode.yaml b/charts/timescaledb-multinode/templates/job-attach-datanode.yaml index ea706c99..c6ceaf5d 100644 --- a/charts/timescaledb-multinode/templates/job-attach-datanode.yaml +++ b/charts/timescaledb-multinode/templates/job-attach-datanode.yaml @@ -1,8 +1,8 @@ # This file and its contents are licensed under the Apache License 2.0. # Please see the included NOTICE for copyright information and LICENSE for a copy of the license. -{{- range $pod, $e := until ( .Values.dataNodes | int) }} -{{- range $index, $dbname := $.Values.postgresql.databases }} +{{- range $pod, $e := until ( .Values.dataNode.instances | int) }} +{{- range $index, $dbname := $.Values.accessNode.postgresql.databases }} --- apiVersion: batch/v1 kind: Job @@ -71,7 +71,7 @@ https://www.postgresql.org/docs/current/app-psql.html#APP-PSQL-INTERPOLATION name: {{ template "timescaledb.accessname" $ }} key: password-superuser restartPolicy: OnFailure - backoffLimit: 2 + backoffLimit: 20 ... {{ end }} {{ end }} diff --git a/charts/timescaledb-multinode/templates/job-create-databases.yaml b/charts/timescaledb-multinode/templates/job-create-databases.yaml index 9b4fae33..c44a63cf 100644 --- a/charts/timescaledb-multinode/templates/job-create-databases.yaml +++ b/charts/timescaledb-multinode/templates/job-create-databases.yaml @@ -1,7 +1,7 @@ # This file and its contents are licensed under the Apache License 2.0. # Please see the included NOTICE for copyright information and LICENSE for a copy of the license. -{{- range $index, $dbname := .Values.postgresql.databases }} +{{- range $index, $dbname := .Values.accessNode.postgresql.databases }} --- apiVersion: batch/v1 kind: Job diff --git a/charts/timescaledb-multinode/templates/sec-timescaledb.yaml b/charts/timescaledb-multinode/templates/sec-timescaledb.yaml index dcf5bd02..1af6cf35 100644 --- a/charts/timescaledb-multinode/templates/sec-timescaledb.yaml +++ b/charts/timescaledb-multinode/templates/sec-timescaledb.yaml @@ -1,6 +1,7 @@ # This file and its contents are licensed under the Apache License 2.0. # Please see the included NOTICE for copyright information and LICENSE for a copy of the license. +{{- if .Values.credentials.fromValues }} --- apiVersion: v1 kind: Secret @@ -29,3 +30,4 @@ type: Opaque data: password-superuser: {{ .Values.credentials.dataNode.superuser | b64enc }} ... +{{- end }} diff --git a/charts/timescaledb-multinode/templates/statefulset-timescaledb-accessnode.yaml b/charts/timescaledb-multinode/templates/statefulset-timescaledb-accessnode.yaml index dd06740a..d8a23e1c 100644 --- a/charts/timescaledb-multinode/templates/statefulset-timescaledb-accessnode.yaml +++ b/charts/timescaledb-multinode/templates/statefulset-timescaledb-accessnode.yaml @@ -26,6 +26,9 @@ spec: app: {{ template "timescaledb.fullname" . }} release: {{ .Release.Name }} timescaleNodeType: access + {{- with .Values.accessNode.extraPodLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: serviceAccountName: {{ template "timescaledb.serviceAccountName" . }} securityContext: @@ -44,7 +47,7 @@ spec: env: - name: POSTGRESQL_CUSTOM_PARAMETERS value: | - {{- range $key, $value := .Values.postgresql.parameters }} + {{- range $key, $value := .Values.accessNode.postgresql.parameters }} {{ printf "%s = '%s'" $key ($value | toString) }} {{- end }} - name: POSTGRES_PASSWORD @@ -81,8 +84,8 @@ spec: chmod 0600 "${PGDATA}/../.pgpass" volumeMounts: - name: storage-volume - mountPath: "{{ .Values.persistentVolume.mountPath }}" - subPath: "{{ .Values.persistentVolume.subPath }}" + mountPath: "{{ .Values.accessNode.persistentVolume.mountPath }}" + subPath: "{{ .Values.accessNode.persistentVolume.subPath }}" containers: - name: timescaledb securityContext: @@ -107,39 +110,39 @@ spec: - containerPort: 5432 volumeMounts: - name: storage-volume - mountPath: "{{ .Values.persistentVolume.mountPath }}" - subPath: "{{ .Values.persistentVolume.subPath }}" + mountPath: "{{ .Values.accessNode.persistentVolume.mountPath }}" + subPath: "{{ .Values.accessNode.persistentVolume.subPath }}" resources: -{{ toYaml .Values.resources | indent 10 }} - {{- with .Values.nodeSelector }} +{{ toYaml .Values.accessNode.resources | indent 10 }} + {{- with .Values.accessNode.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} {{- end }} - {{- with .Values.tolerations }} + {{- with .Values.accessNode.tolerations }} tolerations: {{ toYaml . | indent 8 }} {{- end }} {{- if .Values.schedulerName }} schedulerName: {{ .Values.schedulerName }} {{- end }} - {{- if .Values.affinity }} + {{- if .Values.accessNode.affinity }} affinity: -{{ .Values.affinity | toYaml | indent 8 }} +{{ .Values.accessNode.affinity | toYaml | indent 8 }} {{- else if .Values.affinityTemplate }} affinity: {{ tpl .Values.affinityTemplate . | indent 8 }} {{- end }} - {{- if not .Values.persistentVolume.enabled }} + {{- if not .Values.accessNode.persistentVolume.enabled }} - name: storage-volume emptyDir: {} {{- end }} - {{- if .Values.persistentVolume.enabled }} + {{- if .Values.accessNode.persistentVolume.enabled }} volumeClaimTemplates: - metadata: name: storage-volume annotations: - {{- if .Values.persistentVolume.annotations }} -{{ toYaml .Values.persistentVolume.annotations | indent 8 }} + {{- if .Values.accessNode.persistentVolume.annotations }} +{{ toYaml .Values.accessNode.persistentVolume.annotations | indent 8 }} {{- end }} labels: app: {{ template "timescaledb.fullname" . }} @@ -147,15 +150,15 @@ spec: heritage: {{ .Release.Service }} spec: accessModes: -{{ toYaml .Values.persistentVolume.accessModes | indent 8 }} +{{ toYaml .Values.accessNode.persistentVolume.accessModes | indent 8 }} resources: requests: - storage: "{{ .Values.persistentVolume.size }}" - {{- if .Values.persistentVolume.storageClass }} - {{- if (eq "-" .Values.persistentVolume.storageClass) }} + storage: "{{ .Values.accessNode.persistentVolume.size }}" + {{- if .Values.accessNode.persistentVolume.storageClass }} + {{- if (eq "-" .Values.accessNode.persistentVolume.storageClass) }} storageClassName: "" {{- else }} - storageClassName: "{{ .Values.persistentVolume.storageClass }}" + storageClassName: "{{ .Values.accessNode.persistentVolume.storageClass }}" {{- end }} {{- end }} {{- end }} diff --git a/charts/timescaledb-multinode/templates/statefulset-timescaledb-datanode.yaml b/charts/timescaledb-multinode/templates/statefulset-timescaledb-datanode.yaml index b1661168..4fc31501 100644 --- a/charts/timescaledb-multinode/templates/statefulset-timescaledb-datanode.yaml +++ b/charts/timescaledb-multinode/templates/statefulset-timescaledb-datanode.yaml @@ -12,7 +12,7 @@ metadata: heritage: {{ .Release.Service }} spec: serviceName: {{ template "timescaledb.dataname" . }} - replicas: {{ .Values.dataNodes }} + replicas: {{ .Values.dataNode.instances }} podManagementPolicy: Parallel selector: matchLabels: @@ -26,6 +26,9 @@ spec: app: {{ template "timescaledb.fullname" . }} release: {{ .Release.Name }} timescaleNodeType: data + {{- with .Values.dataNode.extraPodLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: serviceAccountName: {{ template "timescaledb.serviceAccountName" . }} securityContext: @@ -44,7 +47,7 @@ spec: env: - name: POSTGRESQL_CUSTOM_PARAMETERS value: | - {{- range $key, $value := .Values.postgresql.parameters }} + {{- range $key, $value := .Values.dataNode.postgresql.parameters }} {{ printf "%s = '%s'" $key ($value | toString) }} {{- end }} - name: POSTGRES_PASSWORD @@ -76,8 +79,8 @@ spec: echo "DROP EXTENSION timescaledb" | /docker-entrypoint.sh postgres --single -D "${PGDATA}" template1 volumeMounts: - name: storage-volume - mountPath: "{{ .Values.persistentVolume.mountPath }}" - subPath: "{{ .Values.persistentVolume.subPath }}" + mountPath: "{{ .Values.dataNode.persistentVolume.mountPath }}" + subPath: "{{ .Values.dataNode.persistentVolume.subPath }}" containers: - name: timescaledb securityContext: @@ -102,39 +105,39 @@ spec: - containerPort: 5432 volumeMounts: - name: storage-volume - mountPath: "{{ .Values.persistentVolume.mountPath }}" - subPath: "{{ .Values.persistentVolume.subPath }}" + mountPath: "{{ .Values.dataNode.persistentVolume.mountPath }}" + subPath: "{{ .Values.dataNode.persistentVolume.subPath }}" resources: -{{ toYaml .Values.resources | indent 10 }} - {{- with .Values.nodeSelector }} +{{ toYaml .Values.dataNode.resources | indent 10 }} + {{- with .Values.dataNode.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} {{- end }} - {{- with .Values.tolerations }} + {{- with .Values.dataNode.tolerations }} tolerations: {{ toYaml . | indent 8 }} {{- end }} {{- if .Values.schedulerName }} schedulerName: {{ .Values.schedulerName }} {{- end }} - {{- if .Values.affinity }} + {{- if .Values.dataNode.affinity }} affinity: -{{ .Values.affinity | toYaml | indent 8 }} +{{ .Values.dataNode.affinity | toYaml | indent 8 }} {{- else if .Values.affinityTemplate }} affinity: {{ tpl .Values.affinityTemplate . | indent 8 }} {{- end }} - {{- if not .Values.persistentVolume.enabled }} + {{- if not .Values.dataNode.persistentVolume.enabled }} - name: storage-volume emptyDir: {} {{- end }} - {{- if .Values.persistentVolume.enabled }} + {{- if .Values.dataNode.persistentVolume.enabled }} volumeClaimTemplates: - metadata: name: storage-volume annotations: - {{- if .Values.persistentVolume.annotations }} -{{ toYaml .Values.persistentVolume.annotations | indent 8 }} + {{- if .Values.dataNode.persistentVolume.annotations }} +{{ toYaml .Values.dataNode.persistentVolume.annotations | indent 8 }} {{- end }} labels: app: {{ template "timescaledb.fullname" . }} @@ -142,15 +145,15 @@ spec: heritage: {{ .Release.Service }} spec: accessModes: -{{ toYaml .Values.persistentVolume.accessModes | indent 8 }} +{{ toYaml .Values.dataNode.persistentVolume.accessModes | indent 8 }} resources: requests: - storage: "{{ .Values.persistentVolume.size }}" - {{- if .Values.persistentVolume.storageClass }} - {{- if (eq "-" .Values.persistentVolume.storageClass) }} + storage: "{{ .Values.dataNode.persistentVolume.size }}" + {{- if .Values.dataNode.persistentVolume.storageClass }} + {{- if (eq "-" .Values.dataNode.persistentVolume.storageClass) }} storageClassName: "" {{- else }} - storageClassName: "{{ .Values.persistentVolume.storageClass }}" + storageClassName: "{{ .Values.dataNode.persistentVolume.storageClass }}" {{- end }} {{- end }} {{- end }} diff --git a/charts/timescaledb-multinode/templates/svc-timescaledb-access.yaml b/charts/timescaledb-multinode/templates/svc-timescaledb-access.yaml index 205d7068..766d6d97 100644 --- a/charts/timescaledb-multinode/templates/svc-timescaledb-access.yaml +++ b/charts/timescaledb-multinode/templates/svc-timescaledb-access.yaml @@ -14,7 +14,10 @@ metadata: annotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "4000" spec: - type: LoadBalancer + type: {{ .Values.accessNode.service.type }} + {{- if .Values.accessNode.service.clusterIP }} + clusterIP: {{ .Values.accessNode.service.clusterIP }} + {{- end }} ports: - name: postgresql port: 5432 diff --git a/charts/timescaledb-multinode/values.yaml b/charts/timescaledb-multinode/values.yaml index f991dbd3..f264fb6a 100644 --- a/charts/timescaledb-multinode/values.yaml +++ b/charts/timescaledb-multinode/values.yaml @@ -1,8 +1,6 @@ # This file and its contents are licensed under the Apache License 2.0. # Please see the included NOTICE for copyright information and LICENSE for a copy of the license. -dataNodes: 3 - # To prevent very long names, we override the name, otherwise it would default to # timescaledb-multinode (the name of the chart) nameOverride: timescaledb @@ -16,6 +14,7 @@ image: # Credentials used by PostgreSQL credentials: + fromValues: true accessNode: superuser: tea dataNode: @@ -35,63 +34,95 @@ env: # a Docker Volume in many Docker images, which means the data is not actually persisted. value: /var/lib/postgresql/pgdata -persistentVolume: - enabled: true - size: 5G - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - subPath: "" - mountPath: "/var/lib/postgresql" - annotations: {} - accessModes: - - ReadWriteOnce +accessNode: + extraPodLabels: {} + #enable external access using LoadBalancer + service: + type: LoadBalancer + resources: {} + postgresql: + databases: + - postgres + - example + parameters: + enable_partitionwise_aggregate: on + jit: off + max_connections: 100 + shared_buffers: 300MB + work_mem: 16MB + timescaledb.passfile: '../.pgpass' + log_connections: 'on' + log_line_prefix: "%t [%p]: [%c-%l] %u@%d,app=%a [%e] " + log_min_duration_statement: '1s' + log_statement: ddl + log_checkpoints: 'on' + log_lock_waits: 'on' + # These values are set as the default data volume size + # is small as well. + min_wal_size: 256MB + max_wal_size: 512MB + temp_file_limit: 1GB + + persistentVolume: + enabled: true + size: 5Gi + subPath: "" + mountPath: "/var/lib/postgresql" + annotations: {} + accessModes: + - ReadWriteOnce -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 + nodeSelector: {} + tolerations: [] + affinity: {} -postgresql: - databases: - - postgres - - example - parameters: - max_connections: 100 - max_prepared_transactions: 150 - # This is rather small, but as this Helm Chart may be used to spin up - # 1 access node and 4 data nodes on a single minikube/microk8s this is set - # to a conservative value - shared_buffers: 300MB - work_mem: 16MB - timescaledb.passfile: '../.pgpass' - log_connections: 'on' - log_line_prefix: "%t [%p]: [%c-%l] %u@%d,app=%a [%e] " - log_min_duration_statement: '1s' - log_statement: ddl - log_checkpoints: 'on' - log_lock_waits: 'on' - # These values are set as the default data volume size - # is small as well. - min_wal_size: 256MB - max_wal_size: 512MB - temp_file_limit: 1GB +dataNode: + extraPodLabels: {} + instances: 3 + 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 + postgresql: + parameters: + max_prepared_transactions: 150 + # This is rather small, but as this Helm Chart may be used to spin up + # 1 access node and 4 data nodes on a single minikube/microk8s this is set + # to a conservative value + shared_buffers: 300MB + work_mem: 16MB + timescaledb.passfile: '../.pgpass' + # These values are set as the default data volume size + # is small as well. + min_wal_size: 256MB + max_wal_size: 512MB + temp_file_limit: 1GB -# https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector -nodeSelector: {} + persistentVolume: + enabled: true + size: 5Gi + ## database data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + subPath: "" + mountPath: "/var/lib/postgresql" + annotations: {} + accessModes: + - ReadWriteOnce -# https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -tolerations: [] + nodeSelector: {} + tolerations: [] + affinity: {} # https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity affinityTemplate: |