Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Continuous Delivery the Cloud Native way using ...

Joonathan
December 20, 2018

Continuous Delivery the Cloud Native way using Spinnaker and Kubernetes

Joonathan

December 20, 2018
Tweet

More Decks by Joonathan

Other Decks in Technology

Transcript

  1. WHAT IS CONTINUOUS DELIVERY? Continuous Delivery is the ability to

    get changes of all types—including new features, configuration changes, bug fixes and experiments—into production, or into the hands of users, safely and quickly in a sustainable way.
  2. CONTINUOUS INTEGRATION? Continuous Integration is the process of automating the

    build and testing of code every time a team member commits changes to version control.
  3. CONTINUOUS INTEGRATION AND CONTINUOUS DELIVERY? Continuous Integration starts the Continuous

    Delivery process and the pipeline stages each successive environment the next upon successful completion of tests.
  4. SPINNAKER? Spinnaker is an open source, multi-cloud continuous delivery platform

    for releasing software changes with high velocity and confidence. https://www.spinnaker.io
  5. SPINNAKER? • CI integrations • Monitoring integrations • Role-based Access

    Control • Notifications • White-listed Execution Windows & multiple Deployment Strategies • Chaos Monkey Integration • Manual Judgments
  6. GETTING STARTED Prepare Cluster We set up a cluster on

    GKE and set up some prerequisites Setup Spinnaker Using Helm to deploy Spinnaker to one of our clusters Deploy Build and Deploy your applications Prepare Pipeline Configure Cloud Builder and Spinnaker Pipelines
  7. PREPARE KUBERNETES CLUSTER gcloud iam service-accounts create spinnaker-account \ --display-name

    spinnaker-account export SPINNAKERACCOUNT_EMAIL=$(gcloud iam service-accounts list \ --filter="displayName:spinnaker-account" \ --format='value(email)') export PROJECT=$(gcloud info --format='value(config.project)')
  8. PREPARE KUBERNETES CLUSTER gcloud beta pubsub topics create projects/$PROJECT/topics/gcr gcloud

    beta pubsub subscriptions create gcr-triggers \ --topic projects/${PROJECT}/topics/gcr gcloud beta pubsub subscriptions add-iam-policy-binding gcr-triggers \ --role roles/pubsub.subscriber \
 --member serviceAccount:$SPINNAKERACCOUNT_EMAIL
  9. DEPLOY SPINNAKER USING HELM kubectl create clusterrolebinding user-admin-binding \ --clusterrole=cluster-admin

    --user=$(gcloud config get-value account) kubectl create serviceaccount tiller \ --namespace kube-system kubectl create clusterrolebinding tiller-admin-binding \ --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
 
 kubectl create clusterrolebinding --clusterrole=cluster-admin \ --serviceaccount=default:default spinnaker-admin
  10. DEPLOY SPINNAKER USING HELM export BUCKET=$PROJECT-spinnaker-config gsutil mb -c regional

    -l europe-north1 gs://$BUCKET export SERVICEACCOUNT_JSON=$(cat spinnaker-serviceaccount.json)
  11. DEPLOY SPINNAKER USING HELM helm install -n cd stable/spinnaker \


    -f spinnaker-config.yaml --timeout 600 \ --version 1.1.6 --wait
  12. DEPLOY SPINNAKER USING HELM export DECK_POD=$(kubectl get pods --namespace default

    \
 -l "cluster=spin-deck" \ -o jsonpath="{.items[0].metadata.name}") kubectl port-forward --namespace default $DECK_POD 8080:9000
  13. PREPARE THE PIPELINE spin application save --application-name sample \ --owner-email

    [email protected] \ --cloud-providers kubernetes \ --gate-endpoint http://localhost:8080/gate spin pipeline save \
 --gate-endpoint http://localhost:8080/gate \
 -f pipeline.json