-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from ostelco/feature/fix-locale-pseudonyms
Use one specific locale for Calendar
- Loading branch information
Showing
5 changed files
with
64 additions
and
47 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 |
---|---|---|
@@ -1,52 +1,67 @@ | ||
# Pseudonym Server | ||
|
||
#PROJECT_ID=pantel-2decb | ||
export PROJECT_ID="$(gcloud config get-value project -q)" | ||
export PSEUDONYM_VERSION="$(gradle properties -q | grep "version:" | awk '{print $2}' | tr -d '[:space:]')" | ||
|
||
How to deploy this in kubernetes cluster | ||
|
||
``` | ||
#PROJECT_ID=pantel-2decb | ||
export PROJECT_ID="$(gcloud config get-value project -q)" | ||
Build the Docker image (In the folder with Dockerfile) | ||
|
||
# Create cluster | ||
gcloud container clusters create private-cluster --scopes=default,bigquery,datastore,pubsub,sql,storage-rw --num-nodes=3 | ||
docker build -t gcr.io/${PROJECT_ID}/pseudonym-server:${PSEUDONYM_VERSION} . | ||
|
||
# Build the Docker image (In the folder with Dockerfile) | ||
docker build -t gcr.io/${PROJECT_ID}/pseudonym-server:v1 . | ||
# Push to the registry | ||
gcloud docker -- push gcr.io/${PROJECT_ID}/pseudonym-server:v1 | ||
Push to the registry | ||
|
||
# Apply the deployment | ||
kubectl apply -f ./pseudonym-server.yaml | ||
gcloud docker -- push gcr.io/${PROJECT_ID}/pseudonym-server:${PSEUDONYM_VERSION} | ||
|
||
# Details of the deployment | ||
kubectl describe deployment pseudonym-server | ||
kubectl get pods | ||
Update the tag (version) of prime's docker image in `infra/prime.yaml`. | ||
|
||
# Deploy the service | ||
kubectl apply -f ./pseudonym-server-service.yaml | ||
# Details of service | ||
kubectl describe service pseudonym-server-service | ||
Apply the deployment & service | ||
|
||
# Delete service | ||
kubectl delete service pseudonym-server-service | ||
# Delete deployment | ||
kubectl delete deployment pseudonym-server | ||
sed -e "s/PSEUDONYM_VERSION/$PSEUDONYM_VERSION/" pseudonym-server.yaml | kubectl apply -f - | ||
|
||
# Delete cluster | ||
gcloud container clusters delete private-cluster | ||
|
||
# Container to test DNS | ||
kubectl run curl --image=radial/busyboxplus:curl -i --tty | ||
nslookup pseudonym-server-service | ||
curl pseudonym-server-service.default.svc.cluster.local/pseudonym/current/47333 | ||
Details of the deployment | ||
|
||
# SQL for joining dataconsumption and pseudonyms table | ||
SELECT | ||
hc.bytes, ps.msisdnid, hc.timestamp | ||
FROM | ||
[pantel-2decb:data_consumption.hourly_consumption] as hc | ||
JOIN | ||
[pantel-2decb:exported_pseudonyms.3ebcdc4a7ecc4cd385e82087e49b7b7b] as ps | ||
ON ps.msisdn = hc.msisdn | ||
kubectl describe deployment pseudonym-server | ||
kubectl get pods | ||
|
||
|
||
Helper Commands | ||
|
||
Create cluster | ||
|
||
gcloud container clusters create private-cluster --scopes=default,bigquery,datastore,pubsub,sql,storage-rw --num-nodes=3 | ||
|
||
Delete cluster | ||
|
||
gcloud container clusters delete private-cluster | ||
|
||
Delete service | ||
|
||
kubectl delete service pseudonym-server-service | ||
|
||
Delete deployment | ||
|
||
kubectl delete deployment pseudonym-server | ||
|
||
|
||
Container to test DNS | ||
|
||
kubectl run curl --image=radial/busyboxplus:curl -i --tty | ||
nslookup pseudonym-server-service | ||
curl pseudonym-server-service.default.svc.cluster.local/pseudonym/current/47333 | ||
|
||
SQL for joining dataconsumption and pseudonyms table | ||
|
||
SELECT | ||
hc.bytes, ps.msisdnid, hc.timestamp | ||
FROM | ||
[pantel-2decb:data_consumption.hourly_consumption] as hc | ||
JOIN | ||
[pantel-2decb:exported_pseudonyms.3ebcdc4a7ecc4cd385e82087e49b7b7b] as ps | ||
ON ps.msisdn = hc.msisdn | ||
|
||
Login to gcr.io for pushing images | ||
|
||
docker login -u oauth2accesstoken -p "$(gcloud auth print-access-token)" https://gcr.io | ||
|
||
``` |
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
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
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
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