timescaledb_pod.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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: Timescale db 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. containers:
  44. - name: timescale
  45. image: timescale/timescaledb:latest-pg12
  46. imagePullPolicy: "IfNotPresent"
  47. volumeMounts:
  48. - mountPath: /go/src/github.com/telemetry-reference-tools
  49. name: telemetry-reference-tools
  50. - mountPath: /var/lib/postgresql/
  51. name: timescaledb-pvc
  52. workingDir: /go/src/github.com/telemetry-reference-tools
  53. env:
  54. - name: node.name
  55. value: timescale
  56. - name: POSTGRES_USER
  57. valueFrom:
  58. secretKeyRef:
  59. name: "{{ secrets_name }}"
  60. key: timescaledb_user
  61. - name: POSTGRES_PASSWORD
  62. valueFrom:
  63. secretKeyRef:
  64. name: "{{ secrets_name }}"
  65. key: timescaledb_password
  66. - name: TIMESCALE_DB
  67. value: "{{ timescaledb_name }}"
  68. ports:
  69. - containerPort: "{{ timescaledb_container_port }}"