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

Commit

Permalink
add static deploy.yaml that includes Kubernetes manifests for Promscale
Browse files Browse the repository at this point in the history
  • Loading branch information
VineethReddy02 committed May 31, 2021
1 parent 0f7b95b commit 41c4ad7
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
73 changes: 73 additions & 0 deletions deploy/static/deploy.yaml
@@ -0,0 +1,73 @@
---
# Source: promscale/templates/svc-connector.yaml
apiVersion: v1
kind: Service
metadata:
name: promscale-connector
labels:
app: promscale
chart: promscale-0.4.1
release: promscale
heritage: Helm
annotations:
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "4000"
spec:
selector:
app: promscale
type: LoadBalancer
ports:
- name: connector-port
port: 9201
protocol: TCP
---
# Source: promscale/templates/deployment-connector.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: promscale
labels:
app: promscale
chart: promscale-0.4.1
release: promscale
heritage: Helm
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: promscale
template:
metadata:
labels:
app: promscale

annotations:
prometheus.io/path: /metrics
prometheus.io/port: "9201"
prometheus.io/scrape: "true"

spec:
containers:
- image: timescale/promscale
imagePullPolicy: IfNotPresent
name: promscale-connector
ports:
- containerPort: 9201
name: connector-port
env:
- name: PROMSCALE_DB_PORT
value: "5432"
- name: PROMSCALE_DB_USER
value: postgres
- name: PROMSCALE_DB_PASSWORD
valueFrom:
secretKeyRef:
name: promscale-credentials
key: PATRONI_SUPERUSER_PASSWORD
- name: PROMSCALE_DB_HOST
value: promscale.default.svc.cluster.local
- name: PROMSCALE_DB_NAME
value: timescale
- name: PROMSCALE_DB_SSL_MODE
value: require
35 changes: 35 additions & 0 deletions scripts/generate-script-deploy.sh
@@ -0,0 +1,35 @@
#!/bin/bash

if [ -n "$DEBUG" ]; then
set -x
fi

DIR=$(cd $(dirname "${BASH_SOURCE}") && pwd -P)
HELMDIR="${DIR}/../helm-chart"

# Default values.yaml file to provide to helm template command.
FILE_ARG="${HELMDIR}/values.yaml"

# Check if values file filepath was supplied.
if [ "$#" -eq "1" ]; then
if [ -f "$1" ]; then
FILE_ARG=$1
fi
fi

set -o errexit
set -o nounset
set -o pipefail

# Default to promscale helm release name i.e. adds the label values as promscale
RELEASE_NAME=promscale
# Default to to default namespace
NAMESPACE=default

helm dependency update ${HELMDIR}

OUTPUT_FILE="${DIR}/../deploy/static/deploy.yaml"
cat << EOF | helm template $RELEASE_NAME ${HELMDIR} --namespace $NAMESPACE --values $FILE_ARG > ${OUTPUT_FILE}
EOF

echo "$(cat ${OUTPUT_FILE})" > ${OUTPUT_FILE}

0 comments on commit 41c4ad7

Please sign in to comment.