timescaledb_pod.yml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Timescaledb pod definition
  16. kubernetes.core.k8s:
  17. state: present
  18. definition:
  19. apiVersion: apps/v1
  20. kind: StatefulSet
  21. metadata:
  22. name: "{{ timescaledb_k8s_name }}"
  23. namespace: "{{ namespace }}"
  24. spec:
  25. selector:
  26. matchLabels:
  27. app: "{{ timescaledb_k8s_name }}"
  28. serviceName: "{{ timescaledb_k8s_name }}"
  29. replicas: "{{ statefulset_replicas }}"
  30. template:
  31. metadata:
  32. labels:
  33. app: "{{ timescaledb_k8s_name }}"
  34. spec:
  35. volumes:
  36. - name: telemetry-reference-tools
  37. hostPath:
  38. path: "{{ mount_location + idrac_telemetry_folder_name }}"
  39. type: Directory
  40. - name: timescaledb-pvc
  41. persistentVolumeClaim:
  42. claimName: "{{ pvc_name }}"
  43. - name: timezone
  44. hostPath:
  45. path: "{{ zoneinfo_dir + timezone }}"
  46. type: File
  47. containers:
  48. - name: timescale
  49. image: timescale/timescaledb:latest-pg12
  50. imagePullPolicy: "IfNotPresent"
  51. volumeMounts:
  52. - mountPath: /go/src/github.com/telemetry-reference-tools
  53. name: telemetry-reference-tools
  54. - mountPath: /var/lib/postgresql/
  55. name: timescaledb-pvc
  56. - mountPath: /etc/localtime
  57. name: timezone
  58. workingDir: /go/src/github.com/telemetry-reference-tools
  59. env:
  60. - name: node.name
  61. value: timescale
  62. - name: POSTGRES_USER
  63. valueFrom:
  64. secretKeyRef:
  65. name: "{{ secrets_name }}"
  66. key: timescaledb_user
  67. - name: POSTGRES_PASSWORD
  68. valueFrom:
  69. secretKeyRef:
  70. name: "{{ secrets_name }}"
  71. key: timescaledb_password
  72. - name: TIMESCALE_DB
  73. value: "{{ timescaledb_name }}"
  74. ports:
  75. - containerPort: "{{ timescaledb_container_port }}"