apiVersion: apps/v1
kind: Deployment
metadata:
  name: timescaledb
  labels:
    app: timescaledb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: timescaledb
  template:
    metadata:
      labels:
        app: timescaledb
    spec:
      containers:
        - name: timescaledb
          image: timescale/timescaledb:1.5.1-pg11-oss
          ports:
            - containerPort: 5432
          env:
            - name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: database-secret-config
                  key: password
          volumeMounts:
            - mountPath: /var/lib/postgresql/data
              name: timescaledb
      volumes:
        - name: timescaledb
          persistentVolumeClaim:
            claimName: timescaledb-pv-claim
