Presentation repository at Codito Ergo Sum hosted by TheFamily in Paris, Jan 19th 2017. Edit
-
Create a K8S cluster
-
Get the cluster credentials
-
Create a Private GitHub repo containing your application code, etc.
-
Create and add the Dockerfile
-
Build and test the Docker image
-
Push the Docker image in GCR:
gcloud docker -- push gcr.io/tribe-testing/codito-jan2017:pre
-
Create the K8S deployment and allow external traffic to the application
(At this point you have the application/container running in the cluster!!!)
-
Enable the created repo on Travis
-
Create and add the .travis.yml and deploy.sh file
-
Run
chmod +x resources/deploy.sh
to give execution permission to the deploy.sh file -
Create and download a gcloud key in JSON format
-
Run
cat gcloud.json | base64
and copy the output -
Create a secret
GCLOUD_SERVICE_KEY
variable in the Travis repo settings -
Commit the everything
docker build -t gcr.io/tribe-testing/codito-jan2017:pre .
docker run -d -p 8080:8080 --name codito_jan2017 gcr.io/tribe-testing/codito-jan2017:pre
gcloud --quiet config set project tribe-testing
gcloud --quiet config set container/cluster cluster-codito-jan2017
gcloud --quiet config set compute/zone us-east1-b
gcloud --quiet container clusters get-credentials cluster-codito-jan2017
kubectl run codito-jan2017 --image=gcr.io/tribe-staging/codito-jan2017:pre --port=8080
kubectl expose deployment codito-jan2017 --type="LoadBalancer"
gcloud container clusters get-credentials cluster-codito-jan2017 --zone us-east1-b --project tribe-testing
kubectl proxy
kubectl scale deployment codito-jan2017 --replicas=3