Skip to content

Commit

Permalink
[#616] Fix configuration provisionning
Browse files Browse the repository at this point in the history
  • Loading branch information
ljupcovangelski committed Jan 12, 2021
1 parent d494938 commit f788179
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 40 deletions.
75 changes: 38 additions & 37 deletions infrastructure/airy.conf.all
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,41 @@ global:
containerRegistry: ghcr.io/airyhq
namespace: default
# Configuration for the Kafka cluster
apps:
kafka:
brokers: "airy-cp-kafka-headless:9092"
schemaRegistryUrl: "http://schema-registry:8081"
commitInterval: 30000
# Configuration for the Redis database
redis:
hostname: "redis-cluster"
port: 6379
# Configuration for the PostgreSQL database
postgresql:
endpoint: "postgres:5432"
dbName: "admin"
username: "postgresadmin"
password: "long-random-generated-password"
# Specific configurations for sources
sources:
facebook:
appId: "changeme"
appSecret: "changeme"
webhookSecret: "changeme"
google:
partnerKey: "changeme"
saFile: >
'{"type":"service_account","project_id":"airy","private_key_id":"no","private_key":"nokey","client_email":"no","client_id":"no","auth_uri":"no","token_uri":"no","no":"no","client_x509_cert_url":"no"}'
twilio:
authToken: "changeme"
accountSid: "changeme"
# Specific configuration for the API apps
api:
mailFrom: "changeme"
mailPort: 587
mailUrl: "changeme"
mailUsername: "changeme"
mailPassword: "changeme"
jwtSecret: "long-random-generated-jwt-secret"
allowedOrigins: "*"
core:
apps:
kafka:
brokers: "kafka-headless:9092"
schemaRegistryUrl: "http://schema-registry:8081"
commitInterval: 30000
# Configuration for the Redis database
redis:
hostname: "redis-cluster"
port: 6379
# Configuration for the PostgreSQL database
postgresql:
endpoint: "postgres:5432"
dbName: "admin"
username: "postgresadmin"
password: "long-random-generated-password"
# Specific configurations for sources
sources:
facebook:
appId: "changeme"
appSecret: "changeme"
webhookSecret: "changeme"
google:
partnerKey: "changeme"
saFile: >
'{"type":"service_account","project_id":"airy","private_key_id":"no","private_key":"nokey","client_email":"no","client_id":"no","auth_uri":"no","token_uri":"no","no":"no","client_x509_cert_url":"no"}'
twilio:
authToken: "changeme"
accountSid: "changeme"
# Specific configuration for the API apps
api:
mailFrom: "changeme"
mailPort: 587
mailUrl: "changeme"
mailUsername: "changeme"
mailPassword: "changeme"
jwtSecret: "long-random-generated-jwt-secret"
allowedOrigins: "*"
2 changes: 1 addition & 1 deletion infrastructure/helm-chart/charts/apps/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for the Airy Core Platform application
name: airy-apps
name: core
version: 0.5.0
15 changes: 13 additions & 2 deletions infrastructure/scripts/conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,23 @@ fi

source ${INFRASTRUCTURE_PATH}/scripts/lib/k8s.sh

CORE_VERSION=`kubectl get configmap core-config -o jsonpath='{.data.APP_IMAGE_TAG}'`
DEPLOYED_AIRY_VERSION=`kubectl get configmap core-config -o jsonpath='{.data.APP_IMAGE_TAG}'`
if $(grep -q " appImageTag" ${INFRASTRUCTURE_PATH}/airy.conf); then
CONFIGURED_AIRY_VERSION=$(grep " appImageTag" ${INFRASTRUCTURE_PATH}/airy.conf | head -n 1 | awk '{ print $2}')
else
CONFIGURED_AIRY_VERSION=""
fi

if [ -z ${CONFIGURED_AIRY_VERSION} ]; then
AIRY_VERSION=${DEPLOYED_AIRY_VERSION}
else
AIRY_VERSION=${CONFIGURED_AIRY_VERSION}
fi

kubectl delete pod startup-helper --force 2>/dev/null || true
kubectl run startup-helper --image busybox --command -- /bin/sh -c "tail -f /dev/null"

helm upgrade core ${INFRASTRUCTURE_PATH}/helm-chart/ --values ${INFRASTRUCTURE_PATH}/airy.conf --set global.appImageTag=${CORE_VERSION} --timeout 1000s > /dev/null 2>&1
helm upgrade core ${INFRASTRUCTURE_PATH}/helm-chart/ --values ${INFRASTRUCTURE_PATH}/airy.conf --set global.appImageTag=${AIRY_VERSION} --timeout 1000s > /dev/null 2>&1

kubectl scale deployment schema-registry --replicas=1

Expand Down

0 comments on commit f788179

Please sign in to comment.