This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add static deploy.yaml that includes Kubernetes manifests for Promscale
- Loading branch information
1 parent
0f7b95b
commit 41c4ad7
Showing
2 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |