Skip to content
This repository has been archived by the owner on Apr 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #4 from CommercialTribe/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
jwaldrip committed Mar 22, 2017
2 parents 6845011 + 91778e9 commit 9559a81
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,19 @@ env:
- CLOUDSDK_CONTAINER_USE_CLIENT_CERTIFICATE=True
before_deploy:
# Authorize with gcloud
- echo $GCLOUD_ENCODED_CREDS | base64 -d > /tmp/gcloud.json
- gcloud auth activate-service-account $(jq -r ".client_email" /tmp/gcloud.json) --key-file=/tmp/gcloud.json
- >
if [[ -n "$TRAVIS_TAG" ]] ; then
echo $GCLOUD_ENCODED_CREDS | base64 -d > /tmp/gcloud.json &&
gcloud auth activate-service-account $(jq -r ".client_email" /tmp/gcloud.json) --key-file=/tmp/gcloud.json &&
gcloud container clusters get-credentials production --project=commercial-tribe --zone=us-east1-c;
else
echo $GCLOUD_ENCODED_STAGING_CREDS | base64 -d > /tmp/gcloud.json &&
gcloud auth activate-service-account $(jq -r ".client_email" /tmp/gcloud.json) --key-file=/tmp/gcloud.json &&
gcloud container clusters get-credentials staging --project=commercial-tribe-staging --zone=us-central1-a;
fi
# Install and configure kubectl
- CLOUDSDK_CORE_DISABLE_PROMPTS=true sudo gcloud components update kubectl --version 142.0.0
- export PATH=/usr/lib/google-cloud-sdk/bin:$PATH
- sudo chown -R $USER /home/travis/.config/gcloud

# Authorize docker for access to gcloud
- gcloud docker --authorize-only
deploy:
- provider: script
script: ./build-and-push.sh
Expand Down
1 change: 1 addition & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env bash
kubectl --context="$1" --namespace="$2" apply -Rf=./k8s --force
kubectl --context="$1" --namespace="$2" delete pods -l name=redis-nodes
14 changes: 13 additions & 1 deletion k8s/redis-node-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ spec:
mountPath: /data
- name: redis-config
mountPath: /config
resources:
requests:
cpu: 100m
memory: 1Gi
livenessProbe: &healthcheck
exec:
command: [ "redis-cli", "ping" ]
Expand All @@ -42,6 +46,10 @@ spec:
ports:
- name: sentinel
containerPort: 26379
resources:
requests:
cpu: 25m
memory: 50mi
livenessProbe: &healthcheck
exec:
command: [ "redis-cli", "-p", "26379", "ping" ]
Expand All @@ -63,6 +71,10 @@ spec:
readinessProbe:
exec:
command: [ "cat", "booted" ]
resources:
requests:
cpu: 25m
memory: 50mi

volumes:
- name: pod-info
Expand All @@ -79,7 +91,7 @@ spec:
name: data
annotations:
volume.beta.kubernetes.io/storage-class: "ssd"
gcp-auto-snapshot: "true"
gcp-auto-backup: "yes"
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
Expand Down

0 comments on commit 9559a81

Please sign in to comment.