Share
Embed
Continuous Delivery the Cloud Native way using Spinnaker and Kubernetes
Joonathan
December 20, 2018
Transcript
24 slides
-
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. -
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. -
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. -
SPINNAKER? Spinnaker is an open source, multi-cloud continuous delivery platform
for releasing software changes with high velocity and confidence. https://www.spinnaker.io -
SPINNAKER? • CI integrations • Monitoring integrations • Role-based Access
Control • Notifications • White-listed Execution Windows & multiple Deployment Strategies • Chaos Monkey Integration • Manual Judgments -
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 -
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)') -
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 -
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 -
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) -
DEPLOY SPINNAKER USING HELM helm install -n cd stable/spinnaker \
-f spinnaker-config.yaml --timeout 600 \ --version 1.1.6 --wait -
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 -
PREPARE THE PIPELINE curl -LO https://storage.googleapis.com/spinnaker-artifacts/spin/$(curl -s https://storage.googleapis.com/spinnaker-artifacts/spin/latest)/ darwin/amd64/spin
chmod +x spin sudo mv spin /usr/local/bin/spin -
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 -
PREPARE THE PIPELINE gsutil mb -l europe-north1 gs://$PROJECT-kubernetes-manifests gsutil versioning
set on gs://$PROJECT-kubernetes-manifests