项目作者: weaveworks-experiments

项目描述 :
Weave Cloud Istio Flagger demo
高级语言:
项目地址: git://github.com/weaveworks-experiments/istio-demo.git
创建时间: 2018-11-01T11:47:23Z
项目社区:https://github.com/weaveworks-experiments/istio-demo

开源协议:MIT License

下载


Weave Cloud Istio demo

Prerequisites:

  • GKE and CloudDNS
  • Helm and Tiller
  • Istio

Setup Istio with Let’s Encrypt wildcard certs on Google Cloud by following this guide.

Install Flagger

Flagger is a Kubernetes operator that automates the promotion of canary deployments
using Istio routing for traffic shifting and Prometheus metrics for canary analysis.

Deploy Flagger and Grafana in the istio-system namespace using Helm:

  1. helm repo add flagger https://flagger.app
  2. helm upgrade -i flagger flagger/flagger \
  3. --namespace=istio-system \
  4. --set metricsServer=http://prometheus.istio-system:9090 \
  5. --set controlLoopInterval=1m
  6. helm upgrade -i flagger-grafana flagger/grafana \
  7. --namespace=istio-system

Install Flux

Prerequisites:

  • Create a new branch from master
  • Edit the workloads/canary.yaml and change the podinfo.example.com with your own domain
  • Push the changes to your branch

Before installing Flux scale down the weave agent anf flux deployments that are running in weave namespace:

  1. kubectl -n weave scale --replicas=0 deployment/weave-agent
  2. kubectl -n weave scale --replicas=0 deployment/weave-flux-agent

Add the weaveworks repo:

  1. helm repo add weaveworks https://weaveworks.github.io/flux

Install Flux using Helm (make sure to use a unique Flux git tag):

  1. export GIT_BRANCH=your-branch
  2. export GIT_TAG=your-git-tag
  3. export WC_TOKEN=your-weave-token
  4. helm upgrade -i flux weaveworks/flux \
  5. --namespace flux \
  6. --set helmOperator.create=true \
  7. --set rbac.create=true \
  8. --set registry.pollInterval=30s \
  9. --set registry.cacheExpiry=24h \
  10. --set git.pollInterval=2m \
  11. --set git.url=ssh://git@github.com/weaveworks-experiments/istio-demo \
  12. --set git.branch=${GIT_BRANCH} \
  13. --set git.label=${GIT_TAG} \
  14. --set token=${WC_TOKEN}

At startup Flux generates a SSH key and logs the public key. Find the SSH public key with:

  1. kubectl -n flux logs deployment/flux | grep identity.pub | cut -d '"' -f2

In order to sync your cluster state with GitHub you need to copy the public key and create a deploy key
with write access on your GitHub repository. Go to Settings > Deploy keys click on Add deploy key, check
Allow write access, paste the Flux public key and click Add key.

GitOps: Istio canary deployments

Canary demo:

  • Open the podinfo URL and it should display the 1.3.0 version
  • In Weave Cloud Deploy do a manual release of quay.io/stefanprodan/podinfo:1.3.1
  • The podinfo UI will automatically refresh and display the 1.3.1 version

Automated demo:

  • In Weave Cloud Deploy enable automation for test:deployment/podinfo
  • Create a Flux filter of type semver ~1.3