diff --git a/deploy/static/deploy.yaml b/deploy/static/deploy.yaml new file mode 100644 index 0000000000..83f5102fd3 --- /dev/null +++ b/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 diff --git a/scripts/generate-script-deploy.sh b/scripts/generate-script-deploy.sh new file mode 100755 index 0000000000..47cebbce61 --- /dev/null +++ b/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}