Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose version numbers as environment vars + update #30

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion environment_examples/global_env_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ export DOCKER_REPOSITORY={{ docker_repository }}

export NGINX_INGRESS_CONTROLLER_NAME=contrasting-umbrellabird
export NGINX_INGRESS_SERVICE_NAME=nginx-ingress-service
export NGINX_INGRESS_CHART_VERSION=4.1.4
export CERT_MANAGER_CHART_VERSION=v1.8.0
export DNS_HOSTNAME=${ENVIRONMENT}.${DOMAIN_NAME}
export CRD_GITHUB_PATH=https://raw.githubusercontent.com/jetstack/cert-manager/release-0.8/deploy/manifests/00-crds.yaml
# export CRD_GITHUB_PATH=https://raw.githubusercontent.com/jetstack/cert-manager/release-0.8/deploy/manifests/00-crds.yaml
export DNS_HOSTNAMES=({{ dns_hostnames }})
export DNS_ZONES=({{ dns_zones }})

Expand All @@ -50,9 +52,22 @@ do
done
export DNS_INGRESS_PARA

export GCE_PROXY_IMAGE=gcr.io/cloudsql-docker/gce-proxy
export GCE_PROXY_TAG=1.31.0

export SYSCTL_BUDDY_IMAGE=alpine
export SYSCTL_BUDDY_TAG=3.16

export FLUENTD_GCP_IMAGE=gcr.io/google-containers/fluentd-gcp
export FLUENTD_GCP_TAG=2.1.1

export PROMETHEUS_TO_SD_IMAGE=gcr.io/google-containers/prometheus-to-sd
export PROMETHEUS_TO_SD_TAG=v0.9.2


# SQL INSTANCE

export SQL_INSTANCE_VERSION=POSTGRES_14
export SQL_INSTANCE_CPU=1
export SQL_INSTANCE_MEMORY=4
export SQL_AUTH_DB_NAME=authentication
Expand Down
27 changes: 26 additions & 1 deletion environment_examples/local_env_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ export DOCKER_REPOSITORY={{ docker_repository }}

export NGINX_INGRESS_CONTROLLER_NAME=contrasting-umbrellabird
export NGINX_INGRESS_SERVICE_NAME=nginx-ingress-service
export NGINX_INGRESS_CHART_VERSION=4.1.4
export CERT_MANAGER_CHART_VERSION=v1.8.0
export DNS_HOSTNAME=${ENVIRONMENT}.${DOMAIN_NAME}
export CRD_GITHUB_PATH=https://raw.githubusercontent.com/jetstack/cert-manager/release-0.8/deploy/manifests/00-crds.yaml
# export CRD_GITHUB_PATH=https://raw.githubusercontent.com/jetstack/cert-manager/release-0.8/deploy/manifests/00-crds.yaml
export DNS_HOSTNAMES=({{ dns_hostnames }})
export DNS_ZONES=({{ dns_zones }})

Expand All @@ -54,9 +56,32 @@ do
done
export DNS_INGRESS_PARA

export GCE_PROXY_IMAGE=gcr.io/cloudsql-docker/gce-proxy
export GCE_PROXY_TAG=1.31.0

export SYSCTL_BUDDY_IMAGE=alpine
export SYSCTL_BUDDY_TAG=3.16

export FLUENTD_GCP_IMAGE=gcr.io/google-containers/fluentd-gcp
export FLUENTD_GCP_TAG=2.1.1

export PROMETHEUS_TO_SD_IMAGE=gcr.io/google-containers/prometheus-to-sd
export PROMETHEUS_TO_SD_TAG=v0.9.2

export CELERY_EXPORTER_IMAGE=gcr.io/${DATA_PROJECT_NAME}/celery-metric-exporter
export CELERY_EXPORTER_TAG=v5

export FLOWER_IMAGE=cfarrend/flower
export FLOWER_TAG=v1.0.0


# REDIS

export REDIS_CHART_VERSION=16.12.2

# SQL INSTANCE

export SQL_INSTANCE_VERSION=POSTGRES_14
export SQL_INSTANCE_CPU=4
export SQL_INSTANCE_MEMORY=16
export SQL_ANNO_DB_NAME=annotation
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/global/configure_ingress.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source env_config.sh
source $ENV_REPO_PATH/$1.sh

helm upgrade -f $YAML_FOLDER/nginx-ingress-helm-config.yml ${NGINX_INGRESS_CONTROLLER_NAME} ingress-nginx/ingress-nginx --version 3.4.1 --namespace kube-system
helm upgrade -f $YAML_FOLDER/nginx-ingress-helm-config.yml ${NGINX_INGRESS_CONTROLLER_NAME} ingress-nginx/ingress-nginx --version ${NGINX_INGRESS_CHART_VERSION} --namespace kube-system
2 changes: 1 addition & 1 deletion infrastructure/global/launch_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gcloud compute addresses create $CLUSTER_NAME --region=$REGION

gcloud redis instances create $REDIS_NAME --size=2 --region=$REGION --zone=$ZONE --network=$NETWORK_NAME

gcloud sql instances create $SQL_INSTANCE_NAME --database-version=POSTGRES_9_6 --region=$REGION --cpu=$SQL_INSTANCE_CPU --memory=$SQL_INSTANCE_MEMORY
gcloud sql instances create $SQL_INSTANCE_NAME --database-version=$SQL_INSTANCE_VERSION --region=$REGION --cpu=$SQL_INSTANCE_CPU --memory=$SQL_INSTANCE_MEMORY

gcloud sql databases create $SQL_AUTH_DB_NAME --instance=$SQL_INSTANCE_NAME
gcloud sql databases create $SQL_INFO_DB_NAME --instance=$SQL_INSTANCE_NAME
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/global/run_cloudsql_proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ source $ENV_REPO_PATH/$1.sh
gcloud auth application-default login
export INSTANCE_CONNECTION_NAME=$PROJECT_NAME:$REGION:$SQL_INSTANCE_NAME

docker pull gcr.io/cloudsql-docker/gce-proxy:1.16
docker pull $GCE_PROXY_IMAGE:$GCE_PROXY_TAG
docker rm --force gce-proxy
docker rm --force adminer
docker run -d \
-v $HOME/.config/gcloud/:/config \
-p 127.0.0.1:3306:3306 \
--name gce-proxy \
gcr.io/cloudsql-docker/gce-proxy:1.16 /cloud_sql_proxy \
$GCE_PROXY_IMAGE:$GCE_PROXY_TAG /cloud_sql_proxy \
-instances=$INSTANCE_CONNECTION_NAME=tcp:0.0.0.0:3306 -credential_file=/config/application_default_credentials.json
docker run --link gce-proxy:db -p 8080:8080 --name adminer adminer
4 changes: 2 additions & 2 deletions infrastructure/global/setup_ingress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ kubectl apply -f $YAML_FOLDER/service-accounts.yml
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo add stable https://charts.helm.sh/stable
helm repo update
helm install ${NGINX_INGRESS_CONTROLLER_NAME} ingress-nginx/ingress-nginx --set rbac.create=true --namespace kube-system --version 3.4.1
helm install ${NGINX_INGRESS_CONTROLLER_NAME} ingress-nginx/ingress-nginx --set rbac.create=true --namespace kube-system --version $NGINX_INGRESS_CHART_VERSION

gcloud compute addresses describe ${CLUSTER_NAME} --region $REGION | grep address: | sed "s/address: //"

Expand All @@ -20,7 +20,7 @@ kubectl create namespace cert-manager
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--version v1.0.2 \
--version $CERT_MANAGER_CHART_VERSION \
-f $YAML_FOLDER/cert-manager-values.yml \
--set installCRDs=true
./infrastructure/global/configure_ingress.sh $1
2 changes: 1 addition & 1 deletion infrastructure/local/configure_ingress.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source env_config.sh
source $ENV_REPO_PATH/$1.sh

helm upgrade -f $YAML_FOLDER/nginx-ingress-helm-config.yml ${NGINX_INGRESS_CONTROLLER_NAME} ingress-nginx/ingress-nginx --version 4.1.2 --namespace kube-system
helm upgrade -f $YAML_FOLDER/nginx-ingress-helm-config.yml ${NGINX_INGRESS_CONTROLLER_NAME} ingress-nginx/ingress-nginx --version ${NGINX_INGRESS_CHART_VERSION} --namespace kube-system
4 changes: 2 additions & 2 deletions infrastructure/local/install_redis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ source $ENV_REPO_PATH/$1.sh
./infrastructure/local/switch_context.sh $1

helm repo add bitnami https://charts.bitnami.com/bitnami
helm install redis-release bitnami/redis --values ${YAML_FOLDER}/redis_production_values.yml --version 10.7.11
helm install redis-release bitnami/redis --values ${YAML_FOLDER}/redis_production_values.yml --version ${REDIS_CHART_VERSION}

# helm upgrade --force --recreate-pods -f ${YAML_FOLDER}/redis_production_values.yml redis-release bitnami/redis --version 10.7.11
# helm upgrade --force --recreate-pods -f ${YAML_FOLDER}/redis_production_values.yml redis-release bitnami/redis --version ${REDIS_CHART_VERSION}

helm repo add zettaai http://zetta.ai/helm-charts/charts
helm repo update
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/local/launch_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gcloud container node-pools delete default-pool --cluster $CLUSTER_NAME

gcloud compute addresses create $CLUSTER_NAME --region=$REGION

gcloud sql instances create $SQL_INSTANCE_NAME --database-version=POSTGRES_13 --region=$REGION --cpu=$SQL_INSTANCE_CPU --memory=$SQL_INSTANCE_MEMORY
gcloud sql instances create $SQL_INSTANCE_NAME --database-version=$SQL_INSTANCE_VERSION --region=$REGION --cpu=$SQL_INSTANCE_CPU --memory=$SQL_INSTANCE_MEMORY

gcloud sql databases create $SQL_ANNO_DB_NAME --instance=$SQL_INSTANCE_NAME
gcloud sql databases create $SQL_MAT_DB_NAME --instance=$SQL_INSTANCE_NAME
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/local/run_cloudsql_proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ source $ENV_REPO_PATH/$1.sh
gcloud auth application-default login
export INSTANCE_CONNECTION_NAME=$PROJECT_NAME:$REGION:$SQL_INSTANCE_NAME

docker pull gcr.io/cloudsql-docker/gce-proxy:1.16
docker pull $GCE_PROXY_IMAGE:$GCE_PROXY_TAG
docker rm --force gce-proxy
docker rm --force adminer
docker run -d \
-v $HOME/.config/gcloud/:/config \
-p 127.0.0.1:3306:3306 \
--name gce-proxy \
gcr.io/cloudsql-docker/gce-proxy:1.16 /cloud_sql_proxy \
$GCE_PROXY_IMAGE:$GCE_PROXY_TAG /cloud_sql_proxy \
-instances=$INSTANCE_CONNECTION_NAME=tcp:0.0.0.0:3306 -credential_file=/config/application_default_credentials.json
docker run --link gce-proxy:db -p 8080:8080 --name adminer adminer
4 changes: 2 additions & 2 deletions infrastructure/local/setup_ingress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kubectl apply -f $YAML_FOLDER/service-accounts.yml
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo add stable https://charts.helm.sh/stable
helm repo update
helm install ${NGINX_INGRESS_CONTROLLER_NAME} ingress-nginx/ingress-nginx --set rbac.create=true --namespace kube-system --version 3.4.1 -f $YAML_FOLDER/nginx-ingress-helm-config.yml
helm install ${NGINX_INGRESS_CONTROLLER_NAME} ingress-nginx/ingress-nginx --set rbac.create=true --namespace kube-system --version $NGINX_INGRESS_CHART_VERSION -f $YAML_FOLDER/nginx-ingress-helm-config.yml

gcloud compute addresses describe ${CLUSTER_NAME} --region $REGION | grep address: | sed "s/address: //"

Expand All @@ -21,7 +21,7 @@ kubectl create namespace cert-manager
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--version v1.0.2 \
--version $CERT_MANAGER_CHART_VERSION \
-f $YAML_FOLDER/cert-manager-values.yml \
--set installCRDs=true
./infrastructure/local/configure_ingress.sh $1
2 changes: 1 addition & 1 deletion infrastructure/local/update_redis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ source $ENV_REPO_PATH/$1.sh
./infrastructure/local/switch_context.sh $1
./infrastructure/local/create_yaml_files_from_templates.sh $1

helm upgrade --recreate-pods -f ${YAML_FOLDER}/redis_production_values.yml redis-release bitnami/redis --version 10.7.11
helm upgrade --recreate-pods -f ${YAML_FOLDER}/redis_production_values.yml redis-release bitnami/redis --version ${REDIS_CHART_VERSION}
4 changes: 2 additions & 2 deletions kubetemplates/annotation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ spec:
timeoutSeconds: 1
periodSeconds: 60
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.11
image: ${GCE_PROXY_IMAGE}:${GCE_PROXY_TAG}
command:
[
"/cloud_sql_proxy",
Expand All @@ -151,7 +151,7 @@ spec:
mountPath: /secrets/cloudsql
readOnly: true
- name: sysctl-buddy
image: alpine:3.4
image: ${SYSCTL_BUDDY_IMAGE}:${SYSCTL_BUDDY_TAG}
command:
- /bin/sh
- -c
Expand Down
4 changes: 2 additions & 2 deletions kubetemplates/auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ spec:
timeoutSeconds: 1
periodSeconds: 60
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.11
image: ${GCE_PROXY_IMAGE}:${GCE_PROXY_TAG}
command:
[
"/cloud_sql_proxy",
Expand All @@ -155,7 +155,7 @@ spec:
mountPath: /secrets/cloudsql
readOnly: true
- name: sysctl-buddy
image: alpine:3.4
image: ${SYSCTL_BUDDY_IMAGE}:${SYSCTL_BUDDY_TAG}
command:
- /bin/sh
- -c
Expand Down
2 changes: 1 addition & 1 deletion kubetemplates/celery-scaler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: celery-scaler
spec:
scaleTargetRef:
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
name: celery
minReplicas: 1
Expand Down
2 changes: 1 addition & 1 deletion kubetemplates/dash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ spec:
timeoutSeconds: 1
periodSeconds: 60
- name: sysctl-buddy
image: alpine:3.4
image: ${SYSCTL_BUDDY_IMAGE}:${SYSCTL_BUDDY_TAG}
command:
- /bin/sh
- -c
Expand Down
4 changes: 2 additions & 2 deletions kubetemplates/fluentd-custom-daemonset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
- env:
- name: FLUENTD_ARGS
value: --no-supervisor
image: gcr.io/google-containers/fluentd-gcp:2.0.17
image: ${FLUENTD_GCP_IMAGE}:${FLUENTD_GCP_TAG}
imagePullPolicy: IfNotPresent
# If fluentd consumes its own logs, the following situation may happen:
# fluentd fails to send a chunk to the server => writes it to the log =>
Expand Down Expand Up @@ -104,7 +104,7 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
image: gcr.io/google-containers/prometheus-to-sd:v0.2.6
image: ${PROMETHEUS_TO_SD_IMAGE}:${PROMETHEUS_TO_SD_TAG}
imagePullPolicy: IfNotPresent
name: prometheus-to-sd-exporter
resources: {}
Expand Down
2 changes: 1 addition & 1 deletion kubetemplates/guidebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ spec:
timeoutSeconds: 1
periodSeconds: 60
- name: sysctl-buddy
image: alpine:3.4
image: ${SYSCTL_BUDDY_IMAGE}:${SYSCTL_BUDDY_TAG}
command:
- /bin/sh
- -c
Expand Down
4 changes: 2 additions & 2 deletions kubetemplates/info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
secretName: ${INFOSERVICE_SERVICE_ACCOUNT_SECRET}
containers:
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.11
image: ${GCE_PROXY_IMAGE}:${GCE_PROXY_TAG}
command:
[
"/cloud_sql_proxy",
Expand Down Expand Up @@ -132,7 +132,7 @@ spec:
timeoutSeconds: 1
periodSeconds: 60
- name: sysctl-buddy
image: alpine:3.4
image: ${SYSCTL_BUDDY_IMAGE}:${SYSCTL_BUDDY_TAG}
command:
- /bin/sh
- -c
Expand Down
4 changes: 2 additions & 2 deletions kubetemplates/materialize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ spec:
timeoutSeconds: 1
periodSeconds: 60
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.11
image: ${GCE_PROXY_IMAGE}:${GCE_PROXY_TAG}
command:
[
"/cloud_sql_proxy",
Expand All @@ -175,7 +175,7 @@ spec:
mountPath: /secrets/cloudsql
readOnly: true
- name: sysctl-buddy
image: alpine:3.4
image: ${SYSCTL_BUDDY_IMAGE}:${SYSCTL_BUDDY_TAG}
command:
- /bin/sh
- -c
Expand Down
Loading